Safe Haskell | None |
---|
A wrapper for the Sixense SDK, based on the C SDK.
- sixenseInit :: IO SixenseSuccess
- sixenseExit :: IO SixenseSuccess
- autoEnableHemisphereTracking :: ControllerID -> IO SixenseSuccess
- getMaxControllers :: Int
- maxBases :: Int
- setActiveBase :: Int -> IO SixenseSuccess
- baseConnected :: ControllerID -> IO Bool
- controllerEnabled :: ControllerID -> IO Bool
- numActiveControllers :: IO Int
- historySize :: IO Int
- data SixenseSuccess
- type ControllerID = Int
- data Button
- buttonBumper :: Button
- buttonJoystick :: Button
- button1 :: Button
- button2 :: Button
- button3 :: Button
- button4 :: Button
- buttonStart :: Button
- data ControllerData = ControllerData {
- pos :: Vector Float
- rotMat :: Matrix Float
- joystickX :: !Float
- joystickY :: !Float
- trigger :: !Float
- buttons :: !Button
- sequenceNumber :: !Word8
- rotQuat :: Vector Float
- firmwareRevision :: !CUShort
- hardwareRevision :: !CUShort
- packetType :: !CUShort
- magneticFrequency :: !CUShort
- enabled :: !Bool
- controllerIndex :: !CInt
- isDocked :: !Bool
- whichHand :: !Word8
- hemiTrackingEnabled :: !Bool
- data AllControllerData = AllControllerData {}
- getData :: ControllerID -> Int -> IO (Maybe ControllerData)
- getAllData :: Int -> IO (Maybe AllControllerData)
- getNewestData :: ControllerID -> IO (Maybe ControllerData)
- getAllNewestData :: IO (Maybe AllControllerData)
- setFilterEnabled :: Bool -> IO SixenseSuccess
- getFilterEnabled :: IO Bool
Initialization
sixenseInit :: IO SixenseSuccessSource
Initialize the Sixense library. This function initializes the Sixense library. It must be called at least one time per application. Subsequent calls will have no effect. Once initialized, the other Sixense function calls will work as described until sixenseExit() is called.
sixenseExit :: IO SixenseSuccessSource
Shut down the Sixense library. This shuts down the Sixense library. After this function call, all Sixense API calls will return failure, until sixenseInit() is called again.
autoEnableHemisphereTracking :: ControllerID -> IO SixenseSuccessSource
Shut down the Sixense library. This shuts down the Sixense library. After this function call, all Sixense API calls will return failure, until sixenseInit() is called again.
General information
controllerEnabled :: ControllerID -> IO BoolSource
Returns true if the referenced controller is currently connected to the Control Unit. This call is used to determine whether or not a given controller is powered on and connected to the system. The argument is an index between 0 and the maximum number of supported controllers.
Types
type ControllerID = IntSource
data ControllerData Source
ControllerData | |
|
data AllControllerData Source
Obtaining data
:: ControllerID | The ID of the desired controller. Valid values are from 0 to 3. If the desired controller is not connected, an empty data packet is returned. Empty data packets are initialized to a zero position and the identity rotation matrix. |
-> Int | length of the history to obtain. 0-9 |
-> IO (Maybe ControllerData) |
Get state of one of the controllers, selecting how far back into a history of the last 10 updates.
:: Int | length of the history to obtain. 0-9 |
-> IO (Maybe AllControllerData) |
Get state of all of the controllers, selecting how far back into a history of the last 10 updates.
getNewestData :: ControllerID -> IO (Maybe ControllerData)Source
Get the most recent state of one of the controllers.
getAllNewestData :: IO (Maybe AllControllerData)Source
Get the most recent state of all of the controllers.
Miscellaneous
setFilterEnabled :: Bool -> IO SixenseSuccessSource
Turn the internal position and orientation filtering on or off.
getFilterEnabled :: IO BoolSource
Returns the enable status of the internal position and orientation filtering.