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 fine

Or

  1. boolean false in case of error
  2. integer error code
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:

  1. number screen X coordinate
  2. number screen Y coordinate

Or

  1. nil in case of error
  2. 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:

  1. number screen X coordinate
  2. 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]
generated by LDoc 1.4.3 Last updated 2017-06-05 14:35:27