Struct XRSimulatedControllerState
Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Simulation
Syntax
public struct XRSimulatedControllerState : IInputStateTypeInfo
Fields
batteryLevel
Declaration
public float batteryLevel
Field Value
| Type | Description |
|---|---|
| Single |
buttons
Declaration
public ushort buttons
Field Value
| Type | Description |
|---|---|
| UInt16 |
devicePosition
Declaration
public Vector3 devicePosition
Field Value
| Type | Description |
|---|---|
| Vector3 |
deviceRotation
Declaration
public Quaternion deviceRotation
Field Value
| Type | Description |
|---|---|
| Quaternion |
grip
Declaration
public float grip
Field Value
| Type | Description |
|---|---|
| Single |
isTracked
Declaration
public bool isTracked
Field Value
| Type | Description |
|---|---|
| Boolean |
primary2DAxis
Declaration
public Vector2 primary2DAxis
Field Value
| Type | Description |
|---|---|
| Vector2 |
secondary2DAxis
Declaration
public Vector2 secondary2DAxis
Field Value
| Type | Description |
|---|---|
| Vector2 |
trackingState
Declaration
public int trackingState
Field Value
| Type | Description |
|---|---|
| Int32 |
trigger
Declaration
public float trigger
Field Value
| Type | Description |
|---|---|
| Single |
Properties
format
Declaration
public FourCC format { get; }
Property Value
| Type | Description |
|---|---|
| FourCC |
Implements
formatId
Memory format identifier for XRSimulatedControllerState.
Declaration
public static FourCC formatId { get; }
Property Value
| Type | Description |
|---|---|
| FourCC |
See Also
Methods
Reset()
Declaration
public void Reset()
WithButton(ControllerButton, Boolean)
Set the button mask for the given button.
Declaration
public XRSimulatedControllerState WithButton(ControllerButton button, bool state = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerButton | button | Button whose state to set. |
| Boolean | state | Whether to set the bit on or off. |
Returns
| Type | Description |
|---|---|
| XRSimulatedControllerState | The same XRSimulatedControllerState with the change applied. |