Haply::Inverse::Unity::Inverse3Body
Manages the body orientation of an Inverse3 device, applying real-time orientation updates to a specified GameObject. More...
Inherits from Haply.Inverse.Unity.CursorBehaviour, MonoBehaviour
Protected Functions
Name | |
---|---|
override void | UpdateCursor() Updates the GameObject's rotation to match the current orientation of the associated Inverse3 device. |
virtual override void | AddDeviceListeners() Adds listeners to the device. |
virtual override void | RemoveDeviceListeners() Removes listeners from the device. |
Protected Properties
Name | |
---|---|
override bool | IsUpdateCursorRequired Indicates whether the UpdateCursor method needs to be called on the next FixedUpdate call. |
Public Attributes
Name | |
---|---|
float | rotationResolution The minimum change in orientation required to rotate the GameObject. |
Additional inherited members
Protected Functions inherited from Haply.Inverse.Unity.CursorBehaviour
Name | |
---|---|
virtual GameObject | GetModelPrefab() Gets the prefab that should be instantiated upon startup. |
virtual void | Awake() |
virtual void | OnEnable() |
void | Update() |
void | FixedUpdate() |
Public Properties inherited from Haply.Inverse.Unity.CursorBehaviour
Name | |
---|---|
DeviceBehaviour | Device Device that controls the cursor. |
Transform | ModelPrefab The prefab of a cursor model to show for this cursor that this behaviour automatically instantiates. |
Transform | ModelParent The transform that this behaviour uses as the parent for the model prefab when it is instantiated. |
Transform | Model The instance of the cursor model in the scene. |
bool | HideControllerModel Whether to hide the cursor model. |
float | Radius Gets the Model radius. |
Protected Properties inherited from Haply.Inverse.Unity.CursorBehaviour
Name | |
---|---|
bool | IsDeviceSet Indicates whether the Device has been set. |
Detailed Description
class Haply::Inverse::Unity::Inverse3Body;
Manages the body orientation of an Inverse3 device, applying real-time orientation updates to a specified GameObject.
The Inverse3Body component listens for orientation changes from its associated Inverse3 device and applies these updates to the transform of the GameObject it is attached to. This allows for a synchronized representation of the device's physical orientation within the virtual environment.
Orientation data received from the device can be modified before application through the Inverse3.coordinateConverter, allowing for adjustments such as axis reordering, negation, and applying a rotation offset. This flexibility ensures that the virtual representation can be aligned with the user's expectations and the specifics of the virtual scene.
The sensitivity of orientation updates can be controlled via the rotationResolution, which defines the minimum change in orientation required to update the GameObject's rotation. This helps in reducing jitter and unnecessary updates, enhancing the smoothness of the orientation representation.
This component requires an associated Inverse3 device to function correctly. It subscribes to orientation change events from the device and updates the GameObject's orientation accordingly. If the device is not set or becomes disconnected, the component will cease to update the GameObject's orientation.
Protected Functions Documentation
function UpdateCursor
override void UpdateCursor()
Updates the GameObject's rotation to match the current orientation of the associated Inverse3 device.
This method directly applies the latest orientation data from the Inverse3 device to the GameObject's transform, taking into account any modifications specified in Inverse3.coordinateConverter. It should be called whenever there is a significant change in the device's orientation that exceeds the threshold defined by rotationResolution.
function AddDeviceListeners
virtual override void AddDeviceListeners()
Adds listeners to the device.
Reimplements: Haply::Inverse::Unity::CursorBehaviour::AddDeviceListeners
Overridden to add custom orientation listeners.
function RemoveDeviceListeners
virtual override void RemoveDeviceListeners()
Removes listeners from the device.
Reimplements: Haply::Inverse::Unity::CursorBehaviour::RemoveDeviceListeners
Overridden to remove custom orientation listeners.
Protected Property Documentation
property IsUpdateCursorRequired
override bool IsUpdateCursorRequired;
Indicates whether the UpdateCursor method needs to be called on the next FixedUpdate call.
This property returns true if an update to the cursor's orientation is required. It is set when there is a significant change in the device's orientation that exceeds the threshold defined by rotationResolution.
Public Attributes Documentation
variable rotationResolution
float rotationResolution = 0.025f;
The minimum change in orientation required to rotate the GameObject.
Defines the sensitivity of orientation updates. Smaller values result in more frequent updates, while larger values may reduce jitter but decrease responsiveness.