|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
wiiremotej.event.WREvent
wiiremotej.event.WRExtensionEvent
wiiremotej.event.WRNunchuckExtensionEvent
public class WRNunchuckExtensionEvent
Nunchuck extension event for Nintendo (R) Wii Remote (TM). Contains data from the nunchuck extension.
Field Summary | |
---|---|
static int |
C
Constant representing the C button of the nunchuck. |
static int |
Z
Constant representing the Z button of the nunchuck. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
WRNunchuckExtensionEvent(WiiRemote source,
byte[] input,
int offset,
WRNunchuckExtensionEvent lastEvent)
Creates a new WRNunchuckExtensionEvent from an array of input data. |
Method Summary | |
---|---|
static WRNunchuckExtensionEvent |
createBlankEvent()
Returns a WRNunchuckExtensionEvent with all the values cleared. |
AnalogStickData |
getAnalogStickData()
Returns AnalogStickData representing the current state of the analog stick on the nunchuck. |
double |
getPitch()
Returns the pitch of the nunchuck, in radians from 0 to 2PI. |
double |
getRoll()
Returns the roll of the nunchuck, in radians from 0 to 2PI. |
double |
getXAcceleration()
Returns the X-Acceleration of the nunchuck, in terms of G's. |
double |
getYAcceleration()
Returns the Y-Acceleration of the nunchuck, in terms of G's. |
double |
getZAcceleration()
Returns the Z-Acceleration of the nunchuck, in terms of G's. |
boolean |
isPressed(int button)
Returns true if the given button is pressed; otherwise false . |
boolean |
isStill()
Returns true if the nunchuck is not being moved; otherwise false . |
boolean |
wasPressed(int button)
Returns true if the given button was pressed; otherwise false . |
boolean |
wasReleased(int button)
Returns true if the given button was released; otherwise false . |
Methods inherited from class wiiremotej.event.WREvent |
---|
getSource |
Methods inherited from class java.util.EventObject |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int C
public static final int Z
Constructor Detail |
---|
public WRNunchuckExtensionEvent(WiiRemote source, byte[] input, int offset, WRNunchuckExtensionEvent lastEvent)
source
- the WiiRemote triggering this event.input
- data received from the extension port.offset
- the position of the first byte of extension data in the array.lastEvent
- the last received WRNunchuckExtensionEvent. Used for button-press information.Method Detail |
---|
public static WRNunchuckExtensionEvent createBlankEvent()
public boolean isStill()
true
if the nunchuck is not being moved; otherwise false
. This method checks the magnitude of the acceleration against 1 G.
If it is close to 1G, then the nunchuck is considered still. Therefore, the nunchuck could actually be moving, when isStill returns true, however, this
would be unlikely.
true
if the nunchuck is not being moved; otherwise false
.public double getXAcceleration()
public double getYAcceleration()
public double getZAcceleration()
public double getPitch()
public double getRoll()
public AnalogStickData getAnalogStickData()
public boolean isPressed(int button)
true
if the given button is pressed; otherwise false
. "isPressed" means that the button is currently depressed; it may
have just been depressed this event, or it may have been depressed previously.
Buttons are specified using the field constants in this class.
button
- the button to check if is pressed. You may specify either a single button or a button mask (multiple buttons added together).
true
if the given button is pressed; otherwise false
.public boolean wasPressed(int button)
true
if the given button was pressed; otherwise false
. "wasPressed" means that the button was not depressed before, and
was just depressed this event.
Buttons are specified using the field constants in this class.
button
- the button to check if was pressed. You may specify either a single button or a button mask (multiple buttons added together).
true
if the given button was pressed; otherwise false
.public boolean wasReleased(int button)
true
if the given button was released; otherwise false
. "wasReleased" means that the button was previously depressed, but
was just released this event.
Buttons are specified using the field constants in this class.
button
- the button to check if was released. You may specify either a single button or a button mask (multiple buttons added together).
true
if the given button was released; otherwise false
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |