Struct TrackedDeviceModel
Namespace: UnityEngine.XR.Interaction.Toolkit.UI
Syntax
public struct TrackedDeviceModel
Constructors
TrackedDeviceModel(Int32)
Declaration
public TrackedDeviceModel(int pointerId)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | pointerId |
Properties
changedThisFrame
this to check if this model has meaningfully changed this frame. This is used by the UI system to avoid excessive work. Use TrackedDeviceModel.OnFrameFinished to reset.
Declaration
public bool changedThisFrame { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
maxRaycastDistance
The maximum distance to raycast to check for UI.
Declaration
public float maxRaycastDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
orientation
The 3D, world orientation of the model in Unity's world.
Declaration
public Quaternion orientation { get; set; }
Property Value
| Type | Description |
|---|---|
| Quaternion |
pointerId
A unique Id to identify this model from others within the UI system.
Declaration
public int pointerId { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
position
The 3D, world position of the model in Unity's world.
Declaration
public Vector3 position { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
raycastLayerMask
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> |
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 { get; }
Property Value
| Type | Description |
|---|---|
| ButtonDeltaState |
Methods
CopyFrom(TrackedDeviceEventData)
Copies data from the UI Event to this model
Declaration
public void CopyFrom(TrackedDeviceEventData eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackedDeviceEventData | eventData | The data to copy from. |
CopyTo(TrackedDeviceEventData)
Copies data from this model to the UI Event.
Declaration
public void CopyTo(TrackedDeviceEventData eventData)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackedDeviceEventData | eventData | The event that copies the data. |
OnFrameFinished()
To be called at the end of each frame to reset any tracking of changes within the frame.
Declaration
public void OnFrameFinished()
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. |