Module vrOpenVR :: Class vrOpenVRController
[frames] | no frames]

Class vrOpenVRController

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

Deprecated; use vrDeviceService, vrdVRDevice and vrdDeviceInteraction instead.

The vrOpenVRController class is a proxy class for an OpenVRController. You only pass the name of the OpenVR Controller to the constructor to connect this proxy class to a controller. Controllers are named Controller0 for the first controller, Controller1 for the second controller and so on. The generic tracker can also be accessed and are named GenericTracker0, GenericTracker1 and so on. Additional to functions and signals matched to the default OpenVR Controller this class also provides a generic interface to the OpenVRController using the same ids as the OpenVR library.

The following buttons are defined: OVRButton_System, OVRButton_ApplicationMenu, OVRButton_Grip, OVRButton_DPad_Left, OVRButton_DPad_Up,OVRButton_DPad_Right, OVRButton_DPad_Down, OVRButton_A, OVRButton_ProximitySensor,OVRButton_Axis0, OVRButton_Axis1, OVRButton_Axis2, OVRButton_Axis3, OVRButton_Axis4.

Instance Methods
 
__init__(name)
The constructor of the vrOpenVRController class.
 
buttonPositionChanged(id, position)
SIGNAL is called when the position ratios of the button changed.
 
buttonPressed(id)
SIGNAL is called when the button is pressed.
 
buttonReleased(id)
SIGNAL is called when the button is released.
 
buttonTouched(id)
SIGNAL is called when the button is touched.
 
buttonUntouched(id)
SIGNAL is called when the button is untouched.
 
controllerMoved()
SIGNAL is called constantly when the controller moves.
Vec2f
getButtonPosition(id)
Returns the current position ratio of the button.
int
getHandRole()
Get whether this controller is detected as left or right hand.
Vec2f
getTouchpadPosition()
Returns the current position on the touchpad.
floatf
getTriggerRatio()
Returns the current ratio the trigger is pressed.
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.
 
gripPressed()
SIGNAL is called when the grip is pressed.
 
gripReleased()
SIGNAL is called when the grip is released.
 
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.
bool
isButtonPressed(id)
Returns the pressed state of the button.
bool
isButtonSupported(id)
Return whether the button is supported by this controller.
bool
isButtonTouched(id)
Returns the touch state of the button.
bool
isGripPressed()
Returns the pressed state of the grip 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
isMenuButtonPressed()
Returns the pressed state of the menu button.
bool
isTouchpadPressed()
Returns the pressed state of the touchpad button.
bool
isTouchpadTouched()
Returns the touch state of the touchpad button.
bool
isTriggerPressed()
Returns the pressed state of the trigger button.
bool
isVisible()
Gets the visibility of the visualization (geometry or hands) of this controller.
 
menuButtonPressed()
SIGNAL is called when the menu button is pressed.
 
menuButtonReleased()
SIGNAL is called when the menu button is released.
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.
 
setHandRole(role)
Set this controller to left, right or undefined (no) hand role.
 
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.
 
touchpadPositionChanged(position)
SIGNAL is called when the position on the touchpad changed.
 
touchpadPressed()
SIGNAL is called when the touchpad is pressed.
 
touchpadReleased()
SIGNAL is called when the touchpad is released.
 
touchpadTouched()
SIGNAL is called when the touchpad is pressed.
 
touchpadUntouched()
SIGNAL is called when the touchpad is untouched.
 
triggerHapticPulse(axis, duration)
Triggers a haptic pulse on the controller.
 
triggerPressed()
SIGNAL is called when the trigger is pressed.
 
triggerReleased()
SIGNAL is called when the trigger is released.

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 vrOpenVRController class.

Parameters:
  • name (string) - The name of the button.
Overrides: vrAEBase.vrAEBase.__init__

buttonPositionChanged(id, position)

 

SIGNAL is called when the position ratios of the button changed.

Parameters:
  • id - the id of the button to query.
  • position (tuple with 2 entries) - The position ratios of the button.

buttonPressed(id)

 

SIGNAL is called when the button is pressed.

Parameters:
  • id - the id of the button being pressed.

buttonReleased(id)

 

SIGNAL is called when the button is released.

Parameters:
  • id - the id of the button being released.

buttonTouched(id)

 

SIGNAL is called when the button is touched.

Parameters:
  • id - the id of the button being touched.

buttonUntouched(id)

 

SIGNAL is called when the button is untouched.

Parameters:
  • id - the id of the button being untouched.

getButtonPosition(id)

 

Returns the current position ratio of the button.

Parameters:
  • id - the id of the button to query.
Returns: Vec2f
The current position of the button.

getHandRole()

 

Get whether this controller is detected as left or right hand.

Returns: int
Hand_Left, Hand_Right or Hand_Undefined

getTouchpadPosition()

 

Returns the current position on the touchpad.

Returns: Vec2f
The current position on the touchpad.

getTriggerRatio()

 

Returns the current ratio the trigger is pressed.

Returns: floatf
The current ratio of the trigger press.

getVisualizationMode()

 

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

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.

isButtonPressed(id)

 

Returns the pressed state of the button.

Parameters:
  • id - the id of the button to query.
Returns: bool
The button state.

isButtonSupported(id)

 

Return whether the button is supported by this controller.

Parameters:
  • id - the id of the button to query.
Returns: bool
Supported (True), unsupported (False).

isButtonTouched(id)

 

Returns the touch state of the button.

Parameters:
  • id - the id of the button to query.
Returns: bool
The touch state.

isGripPressed()

 

Returns the pressed state of the grip button.

Returns: bool
The grip button 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)

isMenuButtonPressed()

 

Returns the pressed state of the menu button.

Returns: bool
The menu button state.

isTouchpadPressed()

 

Returns the pressed state of the touchpad button.

Returns: bool
The touchpad button state.

isTouchpadTouched()

 

Returns the touch state of the touchpad button.

Returns: bool
The touchpad button touch state.

isTriggerPressed()

 

Returns the pressed state of the trigger button.

Returns: bool
The trigger button state.

isVisible()

 

Gets the visibility of the visualization (geometry or hands) of this controller. The default is '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).

setHandRole(role)

 

Set this controller to left, right or undefined (no) hand role. In most cases, the hand role is auto-detected by SteamVR and does not need to be set.

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

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 range is from 0 to 3 with 3 being the custom picking 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.

touchpadPositionChanged(position)

 

SIGNAL is called when the position on the touchpad changed.

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

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.