Vizard 8 » Reference » Input Devices » Gaming devices » Sixense Controllers
8.1

Sixense Controllers

This plug-in provides support for Sixense controllers, including the Razer Hydra. The Sixense controllers provide data for 6DOF position/orientation, analog joystick, and buttons.

Initialization

The Sixense plug-in is implemented as a Vizard extension, with the following methods:

Method Description
<sixense>.addController(id=0) Returns the controller with the specified ID.
<sixense>.getControllers() Returns a list of all the currently detected controllers.

<sixense>.BUTTON_1

<sixense>.BUTTON_2

<sixense>.BUTTON_3

<sixense>.BUTTON_4

<sixense>.BUTTON_START

<sixense>.BUTTON_BUMPER

<sixense>.BUTTON_JOYSTICK

Button IDs supported by the Sixense controller object.

<sixense>.CONTROLLER

<sixense>.JOYSTICK

<sixense>.TRIGGER

Sixense controller position flags. The default flag is <sixense>.CONTROLLER.

The Sixense controller object contains the following methods, in addition to the standard extension sensor methods:

Method Description
<controller>.getControllerID() Get the Sixense controller ID
<controller>.getJoystick() Get the joystick [x,y] position which will be in the [-1,1] range

<controller>.getTrigger()

Get the state of the analog trigger button in the [0,1] range

Example

The following code shows how to get all the connected Sixense controllers and attach a model to them:

# Add sixense extension
sixense = viz.add('sixense.dle')

# Add controllers
controllers = sixense.getControllers()
for c in controllers:
    viz.link(c, vizshape.addAxes(length=0.2))

The Sixense controllers also support the vizconfig interface so you can quickly see the button/joystick values:

# Register controllers with vizconfig window
import vizconfig
controllers = sixense.getControllers()
for c in controllers:
    vizconfig.register(c)