OVRControllerHelper Class
Extends MonoBehaviour, InputSource
Helper script for managing the rendering of a controller.
This script takes into account the ControllerType of the associated physical controller, initializes the correct assets, manages animation, and hides the visuals when the controller is disconnected.
You can assign new prefabs to the model fields to control which prefab represents the given controller type, though replacement prefabs must be very carefully constructed to fulfill all requirements.
GameObject m_modelOculusTouchQuestAndRiftSLeftController[Get]
The root GameObject that represents the prefab that controls the
Oculus Touch for Quest And RiftS Controller model (Left).
You can assign this field from the Unity Editor to control which prefab is used to represent this controller type.
GameObject m_modelOculusTouchQuestAndRiftSRightController[Get]
The root GameObject that represents the prefab for the
Oculus Touch for Quest And RiftS Controller model (Right).
GameObject m_modelOculusTouchRiftLeftController[Get]
The root GameObject that represents the prefab that controls the
Oculus Touch for Rift Controller model (Left).
This field can be assigned from the Unity Editor to control which prefab is used to represent this controller type.
GameObject m_modelOculusTouchRiftRightController[Get]
The root GameObject that represents the prefab that controls the
Oculus Touch for Rift Controller model (Right).
This field can be assigned from the Unity Editor to control which prefab is used to represent this controller type.
GameObject m_modelOculusTouchQuest2LeftController[Get]
The root GameObject that represents the prefab for the
Oculus Touch for Quest 2 Controller model (Left).
GameObject m_modelOculusTouchQuest2RightController[Get]
The root GameObject that represents the
Oculus Touch for Quest 2 Controller model (Right).
GameObject m_modelMetaTouchProLeftController[Get]
The root GameObject that represents the prefab that controls the
Meta Touch Pro Controller model (Left).
GameObject m_modelMetaTouchProRightController[Get]
The root GameObject that represents the prefab for the
Meta Touch Pro Controller model (Right).
GameObject m_modelMetaTouchPlusLeftController[Get]
The root GameObject that represents the prefab for
Meta Quest Plus Controller model (Left).
GameObject m_modelMetaTouchPlusRightController[Get]
The root GameObject that represents the
Meta Quest Plus Controller model (Right).
OVRControllerHelper queries
OVRInput and the underlying system for the appropriate controller data depending on the controller specified in this setting.
OVRInput.InputDeviceShowState m_showState[Get]
Determines if the controller should be hidden based on held state.
But default, this value is set to OVRInput.InputDeviceShowState.ControllerInHandOrNoHand.
bool showWhenHandsArePoweredByNaturalControllerPoses[Get]
If controller-driven hand poses is on, and the mode is Natural, controllers will be hidden unless this is true; in other words, enabling this setting will cause the controller visuals to be rendered while controller-driven hands are enabled in Natural mode.
An optional component for providing basic shell-like ray interaction functionality, highlighting where you're selecting in the UI and responding to pinches / button presses.
void InputFocusAquired ( )
Sets the associated controller to have input focus.
This is typically invoked in response to a button press or other clearly-intentional input and is used for purposes such as showing pointer rays, etc.
Sets the associated controller to not have input focus.
This is typically invoked in response to a button press or other clearly-intentional input on a different controller and is used for purposes such as hiding pointer rays, etc.
ReturnsTrue if the primary index trigger is down, false otherwise
ReturnsTrue if the primary index trigger is up, false otherwise
Transform GetPointerRayTransform ( )
Retrieves the Unity Transform which should be used as the origin of raycasts from the associated controller.
Specifically, raycasts should begin at the position and proceed in the forward direction of the returned transform.
ReturnsThe source transform for raycasts from the associated controller
Checks whether or not this
OVRControllerHelper instance has been Destroyed; a convenience wrapper around the Unity idiomatic this != null check.
ReturnsTrue if this instance has been Destroyed, false otherwise
Checks whether the associated controller is considered to be "active," i.e.
in use. Unrelated to Unity's built-in Behaviour.isActiveAndEnabled property or any other Unity-related concept of activity.
ReturnsTrue if the associated controller is active, false otherwise
OVRPlugin.Hand GetHand ( )
Queries the handedness of an associated
Oculus Touch controller.