wiiusej.wiiusejevents.physicalevents
Class NunchukEvent

java.lang.Object
  extended by wiiusej.wiiusejevents.GenericEvent
      extended by wiiusej.wiiusejevents.physicalevents.ExpansionEvent
          extended by wiiusej.wiiusejevents.physicalevents.NunchukEvent

public class NunchukEvent
extends ExpansionEvent

This class represents the values from the joystick and its events.

Author:
guiguito

Field Summary
(package private)  NunchukButtonsEvent buttonsEvent
           
(package private)  JoystickEvent nunchukJoystickEvent
           
(package private)  MotionSensingEvent nunchukMotionSensingEvent
           
 
Constructor Summary
NunchukEvent(int id, short buttonsJustPressed, short buttonsJustReleased, short buttonsHeld, float orientationThreshold, int accelerationThreshold, boolean smoothingState, float alphaSmooth, float r, float p, float ya, float ar, float ap, float x, float y, float z, short xx, short yy, short zz, float angle, float magnitude, short max1, short max2, short min1, short min2, short center1, short center2)
          Constructor of NunchukEvent.
 
Method Summary
 NunchukButtonsEvent getButtonsEvent()
          Get joystick buttons event.
 JoystickEvent getNunchukJoystickEvent()
          Get the nunchuk joystick event.
 MotionSensingEvent getNunchukMotionSensingEvent()
          Get the nunchuk motion sensing event.
 boolean isThereMotionSensingEvent()
          Tell if there is a nunchuk motion sensing Event.
 boolean isThereNunchukJoystickEvent()
          Tell if there is a nunchuk joystick event.
 java.lang.String toString()
           
 
Methods inherited from class wiiusej.wiiusejevents.GenericEvent
getWiimoteId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buttonsEvent

NunchukButtonsEvent buttonsEvent

nunchukMotionSensingEvent

MotionSensingEvent nunchukMotionSensingEvent

nunchukJoystickEvent

JoystickEvent nunchukJoystickEvent
Constructor Detail

NunchukEvent

public NunchukEvent(int id,
                    short buttonsJustPressed,
                    short buttonsJustReleased,
                    short buttonsHeld,
                    float orientationThreshold,
                    int accelerationThreshold,
                    boolean smoothingState,
                    float alphaSmooth,
                    float r,
                    float p,
                    float ya,
                    float ar,
                    float ap,
                    float x,
                    float y,
                    float z,
                    short xx,
                    short yy,
                    short zz,
                    float angle,
                    float magnitude,
                    short max1,
                    short max2,
                    short min1,
                    short min2,
                    short center1,
                    short center2)
Constructor of NunchukEvent.

Parameters:
id - id of the wiimote.
buttonsJustPressed - buttons just pressed.
buttonsJustReleased - buttons just released.
buttonsHeld - buttons just pressed.
orientationThreshold - value of the minimum angle between two events with the accelerometer.
accelerationThreshold - value of the value variation between two events with the accelerometer.
smoothingState - true if smoothing flag is activated.
alphaSmooth - value of the alpha smoothing parameter.
r - roll.
p - pitch.
ya - yaw.
ar - absolute roll.
ap - absolute pitch.
x - gravity force on x axis.
y - gravity force on y axis.
z - gravity force on z axis.
xx - raw acceleration on x axis.
yy - raw acceleration on y axis.
zz - raw acceleration on z axis.
angle - angle the joystick is being held.
magnitude - magnitude of the joystick (range 0-1).
max1 - maximum joystick value 1.
max2 - maximum joystick value 2.
min1 - minimum joystick value 1.
min2 - minimum joystick value 2.
center1 - center joystick value 1.
center2 - center joystick value 2.
Method Detail

isThereMotionSensingEvent

public boolean isThereMotionSensingEvent()
Tell if there is a nunchuk motion sensing Event.

Returns:
TRUE if there is a nunchuk motion sensing event, false otherwise.

isThereNunchukJoystickEvent

public boolean isThereNunchukJoystickEvent()
Tell if there is a nunchuk joystick event.

Returns:
TRUE if there is a nunchuk joystick event, false otherwise.

getButtonsEvent

public NunchukButtonsEvent getButtonsEvent()
Get joystick buttons event.

Returns:
the joystick buttons event if there is one or null.

getNunchukMotionSensingEvent

public MotionSensingEvent getNunchukMotionSensingEvent()
Get the nunchuk motion sensing event.

Returns:
the nunchuk motion sensing event if there is one or null.

getNunchukJoystickEvent

public JoystickEvent getNunchukJoystickEvent()
Get the nunchuk joystick event.

Returns:
the nunchuk Joystick Event if there is one or null.

toString

public java.lang.String toString()
Specified by:
toString in class ExpansionEvent