Module vrOculusTouchController :: Class vrOculusTouchController
[frames] | no frames]

Class vrOculusTouchController

   object --+        
            |        
  ??.instance --+    
                |    
vrAEBase.vrAEBase --+
                    |
                   vrOculusTouchController

Deprecated; use vrDeviceService, vrdVRDevice and vrdDeviceInteraction instead. Important: VRED does not support the Oculus SDK anymore as of 2022.1. The API of this class is internally mapped to OpenVR. There are two key differences resulting from this change: the thumbRestTouched / thumbRestUntouched signal from the Oculus Touch Controller 1 is no longer supported. The haptics from triggerVibration with frequency and amplitude also does not work the way it used to. The parameters are ignored and the function will trigger a short haptic pulse. As a replacement there is now also triggerHapticPulse available which directly exposes the OpenVR API with the axis and duration parameters.

The vrOculusTouchController class is a proxy class for an Oculus Touch Controller. You only pass the name of the Oculus Touch Controller to the constructor to connect this proxy class to a controller. The controllers are named "LeftTouch" for the left hand controller and "RightTouch" for the right hand controller. Other names are not valid and will be ignored.

Instance Methods
 
__init__(name)
The constructor of the vrOculusTouchController class.
 
button0IsPressed()
SIGNAL is emitted while the X or A button is pressed down.
 
button0IsTouched()
SIGNAL is emitted while the X or A button is touched.
 
button0Pressed()
SIGNAL is emitted when the X or A button is pressed.
 
button0Released()
SIGNAL is emitted when the X or A button is released.
 
button0Touched()
SIGNAL is emitted when the X or A button is touched.
 
button0Untouched()
SIGNAL is emitted when the X or A button is untouched.
 
button1IsPressed()
SIGNAL is emitted while the Y or B button is pressed down.
 
button1IsTouched()
SIGNAL is emitted while the Y or B button is touched.
 
button1Pressed()
SIGNAL is emitted when the Y or B button is pressed.
 
button1Released()
SIGNAL is emitted when the Y or B button is is released.
 
button1Touched()
SIGNAL is emitted when the Y or B button is touched.
 
button1Untouched()
SIGNAL is emitted when the Y or B button is untouched.
 
controllerMoved()
SIGNAL is called constantly when the controller moves.
vrNodePtr
getControllerNode()
Returns the controller node.
int
getHandRole()
Get whether this controller is left or right hand.
float
getHandTriggerRatio()
Returns the current ratio of the hand trigger (grip button).
Vec2f
getThumbstickPosition()
Returns the current position on the thumbstick.
float
getTriggerRatio()
Returns the current value of the trigger.
int
getVisualizationMode()
Get whether the controller geometry or hands are displayed.
list of floats (32bit)
getWorldMatrix()
Returns the world space transformation matrix of the controller.
 
handPoseStarted(poseId)
SIGNAL is called when a hand pose is detected in Hand visualization mode.
 
handPoseStopped(poseId)
SIGNAL is called when a hand pose stops in Hand visualization mode.
 
handRoleChanged(role)
SIGNAL is called when the hand role has changed, after the hand model has been loaded.
 
handTouchContinues(touchedNodeId, fingerId)
SIGNAL is called when the finger continues touching the node.
 
handTouchStarted(touchedNodeId, fingerId)
SIGNAL is called when a finger of this controller's hand has touched a node in the scene that was made interactable with setNodeInteractableInVR(node, True).
 
handTouchStopped(touchedNodeId, fingerId)
SIGNAL is called when the finger stops touching the node.
 
handTriggerChanged(value)
SIGNAL is called when the value of the hand trigger button (grip button) is changed.
 
handTriggerIsPressed()
SIGNAL is emitted while the hand trigger button (grip button) is pressed down.
 
handTriggerPressed()
SIGNAL is emitted when the hand trigger button (grip button) is pressed.
 
handTriggerReleased()
SIGNAL is emitted when the hand trigger button (grip button) is released.
bool
isButton0Pressed()
Returns the pressed state of the X or A button.
bool
isButton0Touched()
Returns the touch state of the X or A button.
bool
isButton1Pressed()
Returns the pressed state of the Y or B button.
bool
isButton1Touched()
Returns the touch state of the Y or B button.
bool
isHandAnimationEnabled()
Get whether the finger joints are transfomed when the user pressed or touches buttons in Hand visualization mode.
bool
isHandInteractionEnabled()
Get whether the interaction with Web engines and Touch sensors is enabled in Hand visualization mode.
 
isHandPoseActive(poseId)
Return whether the user performs a specific hand pose.
bool
isHandTouchPointVisualizationEnabled()
Get whether the visualization of the touch point in Hand visualization mode is enabled.
bool
isHandTriggerPressed()
Returns the pressed state of the hand trigger button (grip button).
bool
isThumbRestTouched()
Returns the touch state of the thumb rest.
bool
isThumbstickPressed()
Returns the pressed state of the thumbstick.
bool
isThumbstickTouched()
Returns the touch state of the thumbstick button.
bool
isTriggerPressed()
Returns the pressed state of the trigger button.
bool
isTriggerTouched()
Returns the touch state of the trigger button.
bool
isVisible()
Gets the visibility of the visualization (geometry or hands) of this controller.
vrNodePtr
pickNode()
Performs a selection along the picking axis of the controller and returns the nearest node along the picking ray.
tuple<vrNodePtr, Pnt3f, Vec3f, Pnt2f>
pickNodeEx()
Performs a selection along the picking axis of the controller and returns the nearest node along the picking ray.
tuple<vrNodePtr, Pnt3f, Vec3f, Pnt2f>
pickNodeWithFinger(fingerId)
Performs a selection with a ray emenating from the finger tip and returns the nearest node along the picking ray.
 
setCustomPickingDirection(origin, direction, color)
Sets a custom axis for picking on this controller.
 
setHandAnimationEnabled(enabled)
Enables or disables transformation of finger joints when the user pressed or touches buttons in Hand visualization mode.
 
setHandInteractionEnabled(enabled)
Enables or disables the interaction with Web engines and Touch sensors in Hand visualization mode.
 
setHandTouchPointVisualizationEnabled(enabled)
Enables or disables visualization of the touch point in Hand visualization mode.
 
setPickingAxis(axis)
Sets the axis used for picking on this controller.
 
setVisible(visible)
Sets the visibility of the visualization (geometry or hands) of this controller.
 
setVisualizationMode(mode)
Sets how the controller should be visualized (controller geometry or hands).
 
showPickingAxis(on)
Shows the picking axis on this controller.
 
thumbRestIsTouched()
SIGNAL is emitted while the thumb rest is touched.
 
thumbRestTouched()
SIGNAL is emitted when the thumb rest is touched.
 
thumbRestUntouched()
SIGNAL is emitted when the thumb rest is untouched.
 
thumbstickChanged(position)
SIGNAL is called when the position on the thumbstick changed.
 
thumbstickIsPressed()
SIGNAL is emitted while the thumbstick is pressed down.
 
thumbstickIsTouched()
SIGNAL is emitted while the thumbstick button is touched.
 
thumbstickPressed()
SIGNAL is emitted when the thumbstick is pressed.
 
thumbstickReleased()
SIGNAL is emitted when the thumbstick is released.
 
thumbstickTouched()
SIGNAL is emitted when the thumbstick button is touched.
 
thumbstickUntouched()
SIGNAL is emitted when the thumbstick button is untouched.
 
triggerChanged(value)
SIGNAL is called when the value of the trigger is changed.
 
triggerHapticPulse(axis, duration)
Triggers a haptic pulse on the controller.
 
triggerIsPressed()
SIGNAL is emitted while the trigger button is pressed down.
 
triggerIsTouched()
SIGNAL is emitted while the trigger button is touched.
 
triggerPressed()
SIGNAL is emitted when the trigger button is pressed.
 
triggerReleased()
SIGNAL is emitted when the trigger button is released.
 
triggerTouched()
SIGNAL is emitted when the trigger button is touched.
 
triggerUntouched()
SIGNAL is emitted when the trigger button is untouched.
 
triggerVibration(frequency, amplitude)
Triggers a vibration on the controller.

Inherited from vrAEBase.vrAEBase: __reduce__, addLoop, callAllConnected, connect, connectSignal, emitSignal, getModuleName, isActive, loop, recEvent, removeConnections, setActive, setUpdateGUIEnabled, subLoop

Inherited from unreachable.instance: __new__

Class Variables
  __instance_size__ = 168
Method Details

__init__(name)
(Constructor)

 

The constructor of the vrOculusTouchController class.

Parameters:
  • name (string) - The name of the controller ("LeftTouch" or "RightTouch").
Overrides: vrAEBase.vrAEBase.__init__

getControllerNode()

 

Returns the controller node.

Returns: vrNodePtr
The controller node

getHandRole()

 

Get whether this controller is left or right hand.

Returns: int
Hand_Left, Hand_Right or Hand_Undefined

getHandTriggerRatio()

 

Returns the current ratio of the hand trigger (grip button).

Returns: float
The current value of the hand trigger in the range of 0.0 - 1.0.

getThumbstickPosition()

 

Returns the current position on the thumbstick.

Returns: Vec2f
The current position on the thumbstick.

getTriggerRatio()

 

Returns the current value of the trigger.

Returns: float
The current value of the trigger in the range of 0.0 - 1.0.

getVisualizationMode()

 

Get whether the controller geometry or hands are displayed. The default value is 'Hand'.

Returns: int
Visualization_Controller or Visualization_Hand

getWorldMatrix()

 

Returns the world space transformation matrix of the controller.

Returns: list of floats (32bit)
The 4 x 4 matrix consisting of 16 floats.

handPoseStarted(poseId)

 

SIGNAL is called when a hand pose is detected in Hand visualization mode.

Parameters:
  • poseId (int) - Pose_Pointing, Pose_Picking, Pose_ThumbsUp or Pose_Fist

handPoseStopped(poseId)

 

SIGNAL is called when a hand pose stops in Hand visualization mode.

Parameters:
  • poseId (int) - Pose_Pointing, Pose_Picking, Pose_ThumbsUp or Pose_Fist

handRoleChanged(role)

 

SIGNAL is called when the hand role has changed, after the hand model has been loaded.

Parameters:
  • role (int) - Hand_Left, Hand_Right or Hand_Undefined

handTouchContinues(touchedNodeId, fingerId)

 

SIGNAL is called when the finger continues touching the node.

Parameters:
  • touchedNodeId (unsigned int) - id of the touched scenegraph node.
  • fingerId (unsigned int) - Which finger touches the node.

handTouchStarted(touchedNodeId, fingerId)

 

SIGNAL is called when a finger of this controller's hand has touched a node in the scene that was made interactable with setNodeInteractableInVR(node, True).

Parameters:
  • touchedNodeId (unsigned int) - id of the touched scenegraph node. Create the node object with vrNodePtr(id).
  • fingerId (unsigned int) - Which finger touches the node. Value can be Finger_Thumb, Finger_Index, Finger_Middle, Finger_Ring, Finger_Pinky.

handTouchStopped(touchedNodeId, fingerId)

 

SIGNAL is called when the finger stops touching the node.

Parameters:
  • touchedNodeId (unsigned int) - id of the touched scenegraph node.
  • fingerId (unsigned int) - Which finger touched the node.

handTriggerChanged(value)

 

SIGNAL is called when the value of the hand trigger button (grip button) is changed.

Parameters:
  • value (float) - The hand trigger value in the range of 0.0 - 1.0.

isButton0Pressed()

 

Returns the pressed state of the X or A button.

Returns: bool
The button press state.

isButton0Touched()

 

Returns the touch state of the X or A button.

Returns: bool
The button touch state.

isButton1Pressed()

 

Returns the pressed state of the Y or B button.

Returns: bool
The button press state.

isButton1Touched()

 

Returns the touch state of the Y or B button.

Returns: bool
The button touch state.

isHandAnimationEnabled()

 

Get whether the finger joints are transfomed when the user pressed or touches buttons in Hand visualization mode. Default is 'on'.

Returns: bool
On (True), off (False)

isHandInteractionEnabled()

 

Get whether the interaction with Web engines and Touch sensors is enabled in Hand visualization mode. Default is 'on'.

Returns: bool
On (True), off (False)

isHandPoseActive(poseId)

 

Return whether the user performs a specific hand pose.

Parameters:
  • poseId (int) - Pose_Pointing, Pose_Picking, Pose_ThumbsUp or Pose_Fist

isHandTouchPointVisualizationEnabled()

 

Get whether the visualization of the touch point in Hand visualization mode is enabled. Default is 'on'.

Returns: bool
On (True), off (False)

isHandTriggerPressed()

 

Returns the pressed state of the hand trigger button (grip button).

Returns: bool
The button press state.

isThumbRestTouched()

 

Returns the touch state of the thumb rest. IMPORTANT: this is not implemented anymore as of VRED 2022.1.

Returns: bool
The touch state.

isThumbstickPressed()

 

Returns the pressed state of the thumbstick.

Returns: bool
The button press state.

isThumbstickTouched()

 

Returns the touch state of the thumbstick button.

Returns: bool
The button touch state.

isTriggerPressed()

 

Returns the pressed state of the trigger button.

Returns: bool
The button press state.

isTriggerTouched()

 

Returns the touch state of the trigger button.

Returns: bool
The button touch state.

isVisible()

 

Gets the visibility of the visualization (geometry or hands) of this controller. The default is 'not visible'.

Returns: bool
the visibility.

pickNode()

 

Performs a selection along the picking axis of the controller and returns the nearest node along the picking ray.

Returns: vrNodePtr
The hit node

pickNodeEx()

 

Performs a selection along the picking axis of the controller and returns the nearest node along the picking ray.

Returns: tuple<vrNodePtr, Pnt3f, Vec3f, Pnt2f>
The hit node, position, normal, uv

pickNodeWithFinger(fingerId)

 

Performs a selection with a ray emenating from the finger tip and returns the nearest node along the picking ray.

This method can only be used in hand visualization mode.

Parameters:
  • fingerId (unsigned int) - Finger to pick with. Value can be Finger_Thumb, Finger_Index, Finger_Middle, Finger_Ring, Finger_Pinky.
Returns: tuple<vrNodePtr, Pnt3f, Vec3f, Pnt2f>
The hit node, position, normal, uv

setCustomPickingDirection(origin, direction, color)

 

Sets a custom axis for picking on this controller.

Parameters:
  • origin (Pnt3f) - The origin of the picking ray.
  • direction (Vec3f) - The origin of the picking ray.
  • color (Vec3f) - The color of the picking ray visualization.

setHandAnimationEnabled(enabled)

 

Enables or disables transformation of finger joints when the user pressed or touches buttons in Hand visualization mode.

Parameters:
  • enabled (bool) - On (True), off (False).

setHandInteractionEnabled(enabled)

 

Enables or disables the interaction with Web engines and Touch sensors in Hand visualization mode.

Parameters:
  • enabled (bool) - on (True), off (False).

setHandTouchPointVisualizationEnabled(enabled)

 

Enables or disables visualization of the touch point in Hand visualization mode.

Parameters:
  • enabled (bool) - On (True), off (False).

setPickingAxis(axis)

 

Sets the axis used for picking on this controller.

Parameters:
  • axis (unsigned int) - The axis used for picking. Valid values are 0 for the X-Axis, 1 for the Y-Axis, 2 for the Z-Axis and 3 for the custom pick direction

setVisible(visible)

 

Sets the visibility of the visualization (geometry or hands) of this controller.

Parameters:
  • visible (bool) - visibility state.

setVisualizationMode(mode)

 

Sets how the controller should be visualized (controller geometry or hands).

Parameters:
  • mode (int) - Visualization_Controller or Visualization_Hand.

showPickingAxis(on)

 

Shows the picking axis on this controller.

Parameters:
  • on (bool) - on/off state.

thumbRestIsTouched()

 

SIGNAL is emitted while the thumb rest is touched. IMPORTANT: this is not implemented anymore as of VRED 2022.1.

thumbRestTouched()

 

SIGNAL is emitted when the thumb rest is touched. IMPORTANT: this is not implemented anymore as of VRED 2022.1.

thumbRestUntouched()

 

SIGNAL is emitted when the thumb rest is untouched. IMPORTANT: this is not implemented anymore as of VRED 2022.1.

thumbstickChanged(position)

 

SIGNAL is called when the position on the thumbstick changed.

Parameters:
  • position (tuple with 2 entries) - The position on the thumbstick.

triggerChanged(value)

 

SIGNAL is called when the value of the trigger is changed.

Parameters:
  • value (float) - The trigger value in the range of 0.0 - 1.0.

triggerHapticPulse(axis, duration)

 

Triggers a haptic pulse on the controller.

Parameters:
  • axis (unsigned int) - The axis to trigger the pulse on.
  • duration (unsigned int) - The duration of the pulse in microseconds.

triggerVibration(frequency, amplitude)

 

Triggers a vibration on the controller. IMPORTANT: beginning with VRED 2022.1 OpenVR is used and the parameters won't have any effect. The function will generate a single haptic pulse regardless of it's parameters. The function triggerHapticPulse() can be used as an alternative as it maps directly to the OpenVR API.

Parameters:
  • frequency (float) - The frequency of the vibration. Supported values are: 0.0 (disabled), 0.5 and 1.0.
  • amplitude (float) - The amplitude of the vibration. Must be between 0.0 and 1.0.