Skip to content

TextStudio3DInteractionContext

StructTextStudio.ThreeDTextStudio.3D
public readonly struct TextStudio3DInteractionContext

Immutable pointer snapshot carrying interaction identity, phase, world pose, pressure, time, and optional feedback output.

TextStudio3DInteractionContext(int, TextStudio3DInteractionSource, TextStudio3DHandedness, TextStudio3DInteractionPhase, TextStudio3DPointerButton, Vector3, Vector3, Ray, float, bool, double, ITextStudio3DFeedbackOutput)

Section titled “TextStudio3DInteractionContext(int, TextStudio3DInteractionSource, TextStudio3DHandedness, TextStudio3DInteractionPhase, TextStudio3DPointerButton, Vector3, Vector3, Ray, float, bool, double, ITextStudio3DFeedbackOutput)”
public TextStudio3DInteractionContext(int pointerId, TextStudio3DInteractionSource source, TextStudio3DHandedness handedness, TextStudio3DInteractionPhase phase, TextStudio3DPointerButton button, Vector3 worldPosition, Vector3 worldNormal, Ray worldRay, float pressure = 1, bool isCanceled = false, double timestamp = -1, ITextStudio3DFeedbackOutput feedbackOutput = null)

Creates an immutable pointer snapshot, normalizing pressure and world normal and using unscaled time when no timestamp is supplied.

Parameters

Name Type
pointerId System.Int32
source TextStudio.ThreeD.TextStudio3DInteractionSource
handedness TextStudio.ThreeD.TextStudio3DHandedness
phase TextStudio.ThreeD.TextStudio3DInteractionPhase
button TextStudio.ThreeD.TextStudio3DPointerButton
worldPosition UnityEngine.Vector3
worldNormal UnityEngine.Vector3
worldRay UnityEngine.Ray
pressure System.Single
isCanceled System.Boolean
timestamp System.Double
feedbackOutput TextStudio.ThreeD.ITextStudio3DFeedbackOutput

WithPhase(TextStudio3DInteractionPhase, bool)

Section titled “WithPhase(TextStudio3DInteractionPhase, bool)”
public TextStudio3DInteractionContext WithPhase(TextStudio3DInteractionPhase phase, bool isCanceled = false)

Creates a copy with a new interaction phase and cancellation state while preserving the original pose and timestamp.

Parameters

Name Type
phase TextStudio.ThreeD.TextStudio3DInteractionPhase
isCanceled System.Boolean

Returns

TextStudio.ThreeD.TextStudio3DInteractionContext

WithPose(TextStudio3DInteractionPhase, Vector3, Vector3, Ray, float)

Section titled “WithPose(TextStudio3DInteractionPhase, Vector3, Vector3, Ray, float)”
public TextStudio3DInteractionContext WithPose(TextStudio3DInteractionPhase phase, Vector3 worldPosition, Vector3 worldNormal, Ray worldRay, float pressure)

Creates a copy with an updated phase and pointer pose stamped with the current unscaled time.

Parameters

Name Type
phase TextStudio.ThreeD.TextStudio3DInteractionPhase
worldPosition UnityEngine.Vector3
worldNormal UnityEngine.Vector3
worldRay UnityEngine.Ray
pressure System.Single

Returns

TextStudio.ThreeD.TextStudio3DInteractionContext

CreateProgrammatic(TextStudio3DInteractionPhase)

Section titled “CreateProgrammatic(TextStudio3DInteractionPhase)”
public static TextStudio3DInteractionContext CreateProgrammatic(TextStudio3DInteractionPhase phase = TextStudio3DInteractionPhase.Activated)

Creates a synthetic pointer context for activation or other commands initiated by script.

Parameters

Name Type
phase TextStudio.ThreeD.TextStudio3DInteractionPhase

Returns

TextStudio.ThreeD.TextStudio3DInteractionContext

public int PointerId { get; }

Returns

System.Int32

public TextStudio3DInteractionSource Source { get; }

Returns

TextStudio.ThreeD.TextStudio3DInteractionSource

public TextStudio3DHandedness Handedness { get; }

Returns

TextStudio.ThreeD.TextStudio3DHandedness

public TextStudio3DInteractionPhase Phase { get; }

Returns

TextStudio.ThreeD.TextStudio3DInteractionPhase

public TextStudio3DPointerButton Button { get; }

Returns

TextStudio.ThreeD.TextStudio3DPointerButton

public Vector3 WorldPosition { get; }

Returns

UnityEngine.Vector3

public Vector3 WorldNormal { get; }

Returns

UnityEngine.Vector3

public Ray WorldRay { get; }

Returns

UnityEngine.Ray

public float Pressure { get; }

Returns

System.Single

public bool IsCanceled { get; }

Returns

System.Boolean

public double Timestamp { get; }

Returns

System.Double

public ITextStudio3DFeedbackOutput FeedbackOutput { get; }

Returns

TextStudio.ThreeD.ITextStudio3DFeedbackOutput