Module ctr.qtm
The qtm module, for headtracking.
New3ds only.
Usage:
local qtm = require("ctr.qtm")
Functions
init () | Initialize the QTM module. |
shutdown () | Disable the QTM module. |
checkInitialized () | Check if the module is initialized. |
getHeadtrackingInfo () | Return informations about the headtracking |
checkHeadFullyDetected (qtmInfos) | Check if the head is fully detected |
convertCoordToScreen (qtmInfos, coordinates[, screenWidth=400[, screenHeight=320]]) | Convert QTM coordinates to screen coordinates |
qtmInfos object
:checkHeadFullyDetected () | Check if the head is fully detected |
:convertCoordToScreen (coordinates[, screenWidth=400[, screenHeight=320]]) | Convert QTM coordinates to screen coordinates |
index | When the object is indexed with a number from 1 to 4, it returns the coordinates of one of the headtracker points. |
Functions
- init ()
-
Initialize the QTM module.
Returns:
-
boolean
true
if everything went fineOr
-
boolean
false
in case of error - integer error code
-
boolean
- shutdown ()
- Disable the QTM module.
- checkInitialized ()
-
Check if the module is initialized.
Returns:
-
boolean
true
if initialized. - getHeadtrackingInfo ()
-
Return informations about the headtracking
Returns:
-
qtmInfos
QTM informations
- checkHeadFullyDetected (qtmInfos)
-
Check if the head is fully detected
Parameters:
- qtmInfos qtmInfos QTM informations
Returns:
-
boolean
true
if fully detected - convertCoordToScreen (qtmInfos, coordinates[, screenWidth=400[, screenHeight=320]])
-
Convert QTM coordinates to screen coordinates
Parameters:
- qtmInfos qtmInfos QTM informations
- coordinates number index
- screenWidth number specify a screen width (default 400)
- screenHeight number specify a screen height (default 320)
Returns:
- number screen X coordinate
- number screen Y coordinate
Or
- nil in case of error
- string error message
qtmInfos object
- :checkHeadFullyDetected ()
-
Check if the head is fully detected
Returns:
-
boolean
true
if fully detected - :convertCoordToScreen (coordinates[, screenWidth=400[, screenHeight=320]])
-
Convert QTM coordinates to screen coordinates
Parameters:
- coordinates number index
- screenWidth number specify a screen width (default 400)
- screenHeight number specify a screen height (default 320)
Returns:
- number screen X coordinate
- number screen Y coordinate
- index
-
When the object is indexed with a number from 1 to 4, it returns the coordinates
of one of the headtracker points.
- index number coordinates, as two numbers (not a table)
Usage:
coordX, coordY = qtmInfos[index]