Class PoseControl
A control representing a Pose in 3D space, relative to an XR tracking origin
Inherited Members
Namespace: UnityEngine .InputSystem .XR
Assembly: Unity.InputSystem.dll
Syntax
[Preserve]
public class PoseControl : InputControl<PoseState>
Remarks
Note that unlike most other control types, PoseControls
do not have
a flexible memory layout. They are hardwired to Pose
For more information on tracking origins see Tracking
Constructors
PoseControl()
Default-initialize the pose control.
Declaration
public PoseControl()
Remarks
Sets the format to "Pose"
.
Properties
angularVelocity
The angular velocity of this tracked pose relative to the tracking origin.
Declaration
public Vector3Control angularVelocity { get; set; }
Property Value
Type | Description |
---|---|
Vector3Control | Control representing whether the pose is being fully tracked. Maps to the angular |
Remarks
The data for this control is only valid if the value returned from tracking
See Also
isTracked
Represents whether this pose is fully tracked or unavailable/simulated.
Declaration
public ButtonControl isTracked { get; set; }
Property Value
Type | Description |
---|---|
Button |
Control representing whether the pose is being fully tracked. Maps to the is |
See Also
position
The position, in meters, of this tracked pose relative to the tracking origin.
Declaration
public Vector3Control position { get; set; }
Property Value
Type | Description |
---|---|
Vector3Control | Control representing whether the pose is being fully tracked. Maps to the position value of the pose retrieved from this control. |
Remarks
The data for this control is only valid if the value returned from tracking
See Also
rotation
The rotation of this tracked pose relative to the tracking origin.
Declaration
public QuaternionControl rotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
Control representing whether the pose is being fully tracked. Maps to the rotation value of the pose retrieved from this control. |
Remarks
The data for this control is only valid if the value returned from tracking
See Also
trackingState
The other controls on this Pose
Declaration
public IntegerControl trackingState { get; set; }
Property Value
Type | Description |
---|---|
Integer |
Control representing whether the pose is being fully tracked. Maps to the tracking |
Remarks
This can be missing values when the device tracking this pose is restricted or not tracking properly.
See Also
velocity
The velocity, in meters per second, of this tracked pose relative to the tracking origin.
Declaration
public Vector3Control velocity { get; set; }
Property Value
Type | Description |
---|---|
Vector3Control | Control representing whether the pose is being fully tracked. Maps to the velocity value of the pose retrieved from this control. |
Remarks
The data for this control is only valid if the value returned from tracking
See Also
Methods
CalculateOptimizedControlDataType()
Calculates and returns an optimized data type that can represent a control's value in memory directly.
Declaration
protected override FourCC CalculateOptimizedControlDataType()
Returns
Type | Description |
---|---|
Four |
An optimized data type that can represent a control's value in memory directly. Input |
Overrides
Remarks
The value then is cached in optimized
FinishSetup()
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()
Overrides
Remarks
This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.
Examples
public class MyDevice : InputDevice
{
public ButtonControl button { get; private set; }
public AxisControl axis { get; private set; }
protected override void OnFinishSetup()
{
// Cache controls in getters.
button = GetChildControl("button");
axis = GetChildControl("axis");
}
}
ReadUnprocessedValueFromState(void*)
Read value from provided statePtr
.
Declaration
public override PoseState ReadUnprocessedValueFromState(void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
void* | statePtr | State pointer to read from. |
Returns
Type | Description |
---|---|
Pose |
The controls current value. |
Overrides
Remarks
Read value from provided statePtr
without any caching.
See Also
WriteValueIntoState(PoseState, void*)
Write a value into state at the given memory.
Declaration
public override void WriteValueIntoState(PoseState value, void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
Pose |
value | Value for the control to store in the state. |
void* | statePtr | State containing the control's state |
Overrides
Remarks
Writing values will NOT apply processors to the given value. This can mean that when reading a value from a control after it has been written to its state, the resulting value differs from what was written.
Exceptions
Type | Condition |
---|---|
Not |
The control does not support writing. This is the case, for example, that compute values (such as the magnitude of a vector). |