Changes

2,737 bytes added ,  19:27, 1 December 2012
Fill in as much as possible about Wii Remote
Line 364: Line 364:  
The variable <tt>wiiu.remote.held</tt> is a bitmask indicating all buttons currently being depressed on the Wii Remote.
 
The variable <tt>wiiu.remote.held</tt> is a bitmask indicating all buttons currently being depressed on the Wii Remote.
   −
<b>TODO:</b> <i>Record what values in the bitmask correspond to which buttons on the GamePad.</i>
+
{| class='wikitable'
 +
{| class='wikitable'
 +
! Button
 +
! Decimal
 +
! Hex
 +
|-
 +
|{{WiiUGamePadSTARTButton}}
 +
|4096
 +
|0x00001000
 +
|-
 +
|{{WiiUGamePadDPadUp}}
 +
|2048
 +
|0x00000800
 +
|-
 +
|{{WiiUGamePadDPadRDown}}
 +
|1024
 +
|0x00000400
 +
|-
 +
|{{WiiUGamePadDPadRight}}
 +
|512
 +
|0x00000200
 +
|-
 +
|{{WiiUGamePadDPadLeft}}
 +
|256
 +
|0x00000100
 +
|-
 +
|{{WiiUGamePadHOMEButton}}
 +
|128
 +
|0x00000080
 +
|-
 +
|{{WiiUGamePadSELECTButton}}
 +
|16
 +
|0x00000010
 +
|-
 +
|{{WiiUGamePadAButton}}
 +
|8
 +
|0x00000008
 +
|-
 +
|{{WiiUGamePadBButton}}
 +
|4
 +
|0x00000004
 +
|-
 +
|2
 +
|2
 +
|0x00000002
 +
|-
 +
|1
 +
|1
 +
|0x00000001
 +
|}
    
==== Accelerometer ====
 
==== Accelerometer ====
The variables <tt>wiiu.remote.accX</tt>, <tt>wiiu.remote.accY</tt>, and <tt>wiiu.remote.accZ</tt> are a vector showing the current acceleration forces on the Wii Remote, 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 Wii Remote's accelerometers.
 +
{| class='wikitable'
 +
! Variable
 +
! Value
 +
|-
 +
| <tt>wiiu.remote.accX</tt>
 +
| Force on X (horizontal) axis
 +
|-
 +
| <tt>wiiu.remote.accY</tt>
 +
| Force on Y (depth) axis
 +
|-
 +
| <tt>wiiu.remote.accZ</tt>
 +
| Force on Z (vertical) axis
 +
|}
   −
==== D-Pad ====
+
These variables form a vector showing the current acceleration forces on the Wii Remote, 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).
<b>TODO:</b> <i>Document.</i>
+
 
 +
==== Pointer ====
 +
The following variables track the Wii Remote's cursor on the screen.
 +
{| class='wikitable'
 +
! Variable
 +
! Value
 +
|-
 +
| <tt>wiiu.remote.dpdX</tt>
 +
| X position in screen coordinates
 +
|-
 +
| <tt>wiiu.remote.dpdY</tt>
 +
| X position in screen coordinates
 +
|-
 +
| <tt>wiiu.remote.dpdDistance</tt>
 +
| Distance between Wii Remote and Sensor Bar
 +
|-
 +
| <tt>wiiu.remote.contentX</tt>
 +
| X position in page coordinates
 +
|-
 +
| <tt>wiiu.remote.contentY</tt>
 +
| X position in page coordinates
 +
|-
 +
| <tt>wiiu.remote.isCursorViewable</tt>
 +
| 1 if cursor display is enabled
 +
|-
 +
| <tt>wiiu.remote.dpdValidity</tt>
 +
| <b>TODO:</b> ?
 +
|}
 +
 
 +
Additionally, the function <tt>wiiu.remote.setCursorViewable()</tt> will enable or disable the display of the Wii Remote's cursor.
    
==== Motion Plus ====
 
==== Motion Plus ====
<b>TODO:</b> <i>Document.</i>
+
There are nine variables that tie into the Motion Plus orientation tracking, organized into three three-dimensional vectors:
 +
 
 +
{| class='wikitable'
 +
! Axis
 +
! X
 +
! Y
 +
! Z
 +
|-
 +
| X (horizontal) axis
 +
| <tt>wiiu.remote.mplsDirXx</tt>
 +
| <tt>wiiu.remote.mplsDirXy</tt>
 +
| <tt>wiiu.remote.mplsDirXz</tt>
 +
|-
 +
| Y (depth) axis
 +
| <tt>wiiu.remote.mplsDirYx</tt>
 +
| <tt>wiiu.remote.mplsDirYy</tt>
 +
| <tt>wiiu.remote.mplsDirYz</tt>
 +
|-
 +
| Z (vertical) axis
 +
| <tt>wiiu.remote.mplsDirZx</tt>
 +
| <tt>wiiu.remote.mplsDirZy</tt>
 +
| <tt>wiiu.remote.mplsDirZz</tt>
 +
|}
 +
 
 +
This is a basis of three perpendicular unit vectors; that is, each vector has length 1.0 and points along the relevant axis of the GamePad relative to an arbitrary starting orientation in three-dimensional space.
 +
 
 +
The following variables are also available to track the motion of the Wii Remote:
 +
 
 +
{| class='wikitable'
 +
! Variable
 +
! Value
 +
|-
 +
| <tt>wiiu.remote.mplsAngX</tt>
 +
| Rotation around X (horizontal) axis
 +
|-
 +
| <tt>wiiu.remote.mplsAngY</tt>
 +
| Rotation around Y (depth) axis
 +
|-
 +
| <tt>wiiu.remote.mplsAngZ</tt>
 +
| Rotation around Z (vertical) axis
 +
|-
 +
| <tt>wiiu.remote.mplsVelX</tt>
 +
| Movement speed along X (horizontal) axis
 +
|-
 +
| <tt>wiiu.remote.mplsVelY</tt>
 +
| Movement speed along Y (depth) axis
 +
|-
 +
| <tt>wiiu.remote.mplsVelZ</tt>
 +
| Movement speed along Z (vertical) axis
 +
|-
 +
| <tt>wiiu.remote.mplsRollX</tt>
 +
| <b>TODO:</b> ?
 +
|-
 +
| <tt>wiiu.remote.mplsRollY</tt>
 +
| <b>TODO:</b> ?
 +
|}
    
=== wiiu.videoplayer ===
 
=== wiiu.videoplayer ===
51

edits