This plug-in provides support for the WorldViz PPT Wand device.
The PPT plug-in is implemented as a Vizard extension, with the following methods/constants:
Method |
Description |
<ppt>.addWand(port=0) |
Add a PPT Wand device on the specified port. If port is 0, then automatically detect the wand on all available ports. A Wand sensor object will be returned. |
<ppt>.BUTTON_JOYSTICK <ppt>.BUTTON_UP <ppt>.BUTTON_DOWN <ppt>.BUTTON_LEFT <ppt>.BUTTON_RIGHT <ppt>.BUTTON_CENTER <ppt>.BUTTON_TRIGGER |
Button IDs supported by the PPT Wand sensor. |
<ppt>.WAND <ppt>.JOYSTICK |
PPT Wand sensor position/rotation flags. The default flag is <ppt>.WAND. |
The PPT Wand sensor provides orientation, button, and joystick data. The Wand object contains the following methods, in addition to the standard extension sensor methods:
Method | Description |
<wand>.getJoystick() | Get the joystick [x,y] position which will be in the [-1,1] range. This is a shortcut for calling <wand>.getPosition() with the <ppt>.JOYSTICK flag. |
This example shows how to connect to a PPT Wand device on port 1:
The following code shows how to detect when the trigger button on the Wand is pressed:
The PPT Wand sensor also support the vizconfig interface so you can quickly see the button/joystick values: