|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiusej.wiiusejevents.utils.EventsGatherer
public class EventsGatherer
This class is used to gather events during a call to the Wiiuse API.
Field Summary | |
---|---|
private WiiUseApiEvent[] |
events
|
private WiimoteEvent |
genericEvent
|
private int |
index
|
Constructor Summary | |
---|---|
EventsGatherer(int nbWiimotes)
Create EventsGatherer. |
Method Summary | |
---|---|
void |
addDisconnectionEvent(int id)
Add a DisconnectionEvent to the gatherer. |
private void |
addEvent(WiiUseApiEvent e)
Add an event to the array. |
void |
addIRPointToPreparedWiiMoteEvent(int x,
int y,
short rx,
short ry,
short size)
Add an IR point to the WiiMoteEvent prepared. |
void |
addMotionSensingValues(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)
Set orientation and gravity force of the prepared event. |
void |
addNunchukInsertedEvent(int id)
Add a NunchukInsertedEvent to the gatherer. |
void |
addNunchukRemovedEvent(int id)
Add a NunchukRemovedEvent to the gatherer. |
void |
addNunchunkEventToPreparedWiimoteEvent(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)
Set a NunchukEvent to the prepared . |
void |
addStatusEvent(int id,
boolean connect,
float batt,
short led,
boolean speak,
int attach,
boolean rumbleState,
boolean continuousState,
boolean irState,
boolean motionSensingState)
Add a StatusEvent to the gatherer. |
void |
addWiimoteEvent()
Add the prepared WiimoteEvent to the gatherer. |
void |
clearEvents()
Clear the gatherer and remove objects. |
WiiUseApiEvent[] |
getEvents()
Return an array containing the events. |
void |
prepareIRevent(int x,
int y,
float z,
int ax,
int ay,
int xVRes,
int yVRes,
int xOffset,
int yOffset,
short sensorBarPostion,
short screenAsPectRatio,
short irSensitivity,
float distance)
Prepare an IR event to populate. |
void |
prepareWiiMoteEvent(int id,
short buttonsJustPressed,
short buttonsJustReleased,
short buttonsHeld)
Prepare a wiimote event to add. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private WiiUseApiEvent[] events
private int index
private WiimoteEvent genericEvent
Constructor Detail |
---|
public EventsGatherer(int nbWiimotes)
nbWiimotes
- nb wiimotes (nb a of events possible in a call to Wiiuse API).Method Detail |
---|
private void addEvent(WiiUseApiEvent e)
e
- the event to add.public void prepareWiiMoteEvent(int id, short buttonsJustPressed, short buttonsJustReleased, short buttonsHeld)
id
- id of the wiimote.buttonsJustPressed
- buttons just pressed.buttonsJustReleased
- buttons just released.buttonsHeld
- buttons held.public void prepareIRevent(int x, int y, float z, int ax, int ay, int xVRes, int yVRes, int xOffset, int yOffset, short sensorBarPostion, short screenAsPectRatio, short irSensitivity, float distance)
x
- calculated X coordinate.y
- calculated Y coordinate.z
- calculated distance.ax
- absolute X coordinate.ay
- absolute Y coordinate.xVRes
- IR virtual screen x resolution.yVRes
- IR virtual screen y resolution.xOffset
- IR X correction offset.yOffset
- IR Y correction offset.sensorBarPostion
- aspect ratio of the screen.screenAsPectRatio
- IR sensor bar position.irSensitivity
- Sensitivity of the infrared camera.distance
- Pixel Distance between first two dots.public void addIRPointToPreparedWiiMoteEvent(int x, int y, short rx, short ry, short size)
x
- x coordinates.y
- y coordinates.rx
- raw X coordinate (0-1023).ry
- raw Y coordinate (0-1023).size
- size of the IR dot (0-15).public void addMotionSensingValues(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)
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.public void addNunchunkEventToPreparedWiimoteEvent(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)
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.public void addWiimoteEvent()
public void addStatusEvent(int id, boolean connect, float batt, short led, boolean speak, int attach, boolean rumbleState, boolean continuousState, boolean irState, boolean motionSensingState)
id
- id of the wiimote.connect
- true if the wiimote is connected.batt
- battery level.led
- status of leds.speak
- speakers status.attach
- attachment status.rumbleState
- true if rumble is active.continuousState
- true if continuous flag is activated.irState
- true if ir is active.motionSensingState
- true if accelerometer is active.public void addDisconnectionEvent(int id)
id
- id of the wiimote.public void addNunchukInsertedEvent(int id)
id
- id of the wiimote.public void addNunchukRemovedEvent(int id)
id
- id of the wiimote.public WiiUseApiEvent[] getEvents()
public void clearEvents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |