Struct TrackedDeviceModel
Models a tracked device.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.UI
Syntax
public struct TrackedDeviceModel
Constructors
TrackedDeviceModel(Int32)
Initializes and returns an instance of TrackedDeviceModel.
Declaration
public TrackedDeviceModel(int pointerId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | pointerId | The pointer id. |
Properties
changedThisFrame
Checks whether this model has meaningfully changed this frame. This is used by the UI system to avoid excessive work. Use OnFrameFinished() to reset.
Declaration
public bool changedThisFrame { readonly get; }
Property Value
Type | Description |
---|---|
Boolean |
currentRaycast
The last ray cast done for this model.
Declaration
public RaycastResult currentRaycast { readonly get; }
Property Value
Type | Description |
---|---|
RaycastResult |
See Also
currentRaycastEndpointIndex
The endpoint index within the list of ray cast points that the currentRaycast refers to when a hit occurred.
Otherwise, a value of 0
if no hit occurred.
Declaration
public int currentRaycastEndpointIndex { readonly get; }
Property Value
Type | Description |
---|---|
Int32 |
See Also
maxRaycastDistance
The maximum distance to ray cast to check for UI.
Declaration
[Obsolete("maxRaycastDistance has been deprecated. Its value was unused, calling this property is unnecessary and should be removed.")]
public float maxRaycastDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
maxRaycastDistance
has been deprecated. Its value was unused, calling this property is unnecessary and should be removed.
orientation
The world starting orientation of the cast for the tracked device.
Declaration
public Quaternion orientation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
pointerId
(Read Only) A unique Id to identify this model from others within the UI system.
Declaration
public readonly int pointerId { get; }
Property Value
Type | Description |
---|---|
Int32 |
position
The world starting position of the cast for the tracked device.
Declaration
public Vector3 position { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
raycastLayerMask
Layer mask for ray casts.
Declaration
public LayerMask raycastLayerMask { get; set; }
Property Value
Type | Description |
---|---|
LayerMask |
raycastPoints
A series of Ray segments used to hit UI.
Declaration
public List<Vector3> raycastPoints { get; set; }
Property Value
Type | Description |
---|---|
List<Vector3> |
Remarks
A polygonal chain represented by a list of endpoints which form line segments to approximate the curve. Each line segment is where the ray cast starts and ends. World space coordinates.
scrollDelta
The amount of scroll since the last update.
Declaration
public Vector2 scrollDelta { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
See Also
select
Whether or not the model should be selecting UI at this moment. This is the equivalent of left mouse down for a mouse.
Declaration
public bool select { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
selectDelta
Whether the state of the select option has changed this frame.
Declaration
public ButtonDeltaState selectDelta { readonly get; }
Property Value
Type | Description |
---|---|
ButtonDeltaState |
Methods
CopyFrom(TrackedDeviceEventData)
Copies data from the UI Event Data to this model.
Declaration
public void CopyFrom(TrackedDeviceEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
TrackedDeviceEventData | eventData | The data to copy from. |
See Also
CopyTo(TrackedDeviceEventData)
Copies data from this model to the UI Event Data.
Declaration
public void CopyTo(TrackedDeviceEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
TrackedDeviceEventData | eventData | The event that copies the data. |
See Also
OnFrameFinished()
To be called at the end of each frame to reset any tracking of changes within the frame.
Declaration
public void OnFrameFinished()
See Also
Reset(Boolean)
Resets this object back to defaults.
Declaration
public void Reset(bool resetImplementation = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | resetImplementation | If false, will reset only the external state of the object, and not internal, UI-used variables. Defaults to true. |