Line 271:
Line 271:
==== Accelerometer ====
==== Accelerometer ====
−
The variables <tt>wiiu.gamepad.accX</tt>, <tt>wiiu.gamepad.accY</tt>, and <tt>wiiu.gamepad.accZ</tt> are a vector showing the current acceleration forces on the GamePad, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).
+
The following variables hold the current state of the GamePad's accelerometers.
+
{| class='wikitable'
+
! Variable
+
! Value
+
|-
+
| <tt>wiiu.gamepad.accX</tt>
+
| Force on X (horizontal) axis
+
|-
+
| <tt>wiiu.gamepad.accY</tt>
+
| Force on Y (depth) axis
+
|-
+
| <tt>wiiu.gamepad.accZ</tt>
+
| Force on Z (vertical) axis
+
|}
+
+
These variables form a vector showing the current acceleration forces on the GamePad, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).
==== Gyroscope ====
==== Gyroscope ====
−
The variables <tt>wiiu.gamepad.gyroX</tt>, <tt>wiiu.gamepad.gyroY</tt>, and <tt>wiiu.gamepad.gyroZ</tt> contain the current readings of the GamePad gyroscopes.
+
The following variables hold the current state of the GamePad's gyroscopes.
+
{| class='wikitable'
+
! Variable
+
! Value
+
|-
+
| <tt>wiiu.gamepad.gyroX</tt>
+
| Rotation speed around X (horizontal) axis
+
|-
+
| <tt>wiiu.gamepad.gyroY</tt>
+
| Rotation speed around Y (depth) axis
+
|-
+
| <tt>wiiu.gamepad.gyroZ</tt>
+
| Rotation speed around Z (vertical) axis
+
|}
−
<b>TODO:</b> <i>Determine range and geometric interpretation of these variables.</i>
+
When the GamePad is motionless these values hover around 0.0.
==== Angle ====
==== Angle ====
−
The variables <tt>wiiu.gamepad.angleX</tt>, <tt>wiiu.gamepad.angleY</tt>, and <tt>wiiu.gamepad.angleZ</tt> contain the current angle of the GamePad.
+
The following variables hold the current angle of rotation of the GamePad.
+
{| class='wikitable'
+
! Variable
+
! Value
+
|-
+
| <tt>wiiu.gamepad.angleX</tt>
+
| Rotation around X (horizontal) axis
+
|-
+
| <tt>wiiu.gamepad.angleY</tt>
+
| Rotation around Y (depth) axis
+
|-
+
| <tt>wiiu.gamepad.angleZ</tt>
+
| Rotation around Z (vertical) axis
+
|}
+
+
A change of 1.0 in these values represents a complete revolution around the specified axis. These variables do not appear to wrap around; multiple revolutions around the same axis will cause the value to continuously increase or decrease.
−
<b>TODO:</b> <i>Determine range and geometric interpretation of these variables.</i>
+
If properly calibrated, angleX and angleZ should hover around 0.0 when the GamePad is held level, but as the gyroscopes have limited range and resolution the alignment will drift with use.
==== Direction Tracking ====
==== Direction Tracking ====