Class QuaternionControl
A generic input control reading quaternion (rotation) values.
Inherited Members
Namespace: UnityEngine.InputSystem.Controls
Assembly: Unity.InputSystem.dll
Syntax
public class QuaternionControl : InputControl<Quaternion>
Constructors
QuaternionControl()
Default-initialize the control.
Declaration
public QuaternionControl()
Properties
w
The W component of the quaternion.
Declaration
public AxisControl w { get; set; }
Property Value
Type | Description |
---|---|
AxisControl | Control representing the W component. |
x
The X component of the quaternion.
Declaration
public AxisControl x { get; set; }
Property Value
Type | Description |
---|---|
AxisControl | Control representing the X component. |
y
The Y component of the quaternion.
Declaration
public AxisControl y { get; set; }
Property Value
Type | Description |
---|---|
AxisControl | Control representing the Y component. |
z
The Z component of the quaternion.
Declaration
public AxisControl z { get; set; }
Property Value
Type | Description |
---|---|
AxisControl | Control representing the Z component. |
Methods
CalculateOptimizedControlDataType()
Calculates and returns a optimized data type that can represent a control's value in memory directly. The value then is cached in optimizedControlDataType. This method is for internal use only, you should not call this from your own code.
Declaration
protected override FourCC CalculateOptimizedControlDataType()
Returns
Type | Description |
---|---|
FourCC |
Overrides
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.
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");
}
}</code></pre></example>
ReadUnprocessedValueFromState(void*)
Declaration
public override Quaternion ReadUnprocessedValueFromState(void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
void* | statePtr |
Returns
Type | Description |
---|---|
Quaternion |
Overrides
WriteValueIntoState(Quaternion, void*)
Declaration
public override void WriteValueIntoState(Quaternion value, void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | value | |
void* | statePtr |