|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiusej.wiiuseapievents.EventsGatherer
public class EventsGatherer
This class is used to gather events during a call to the Wiiuse API.
Field Summary | |
---|---|
private WiiUseApiEvent[] |
events
|
private GenericEvent |
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 x,
float y,
float z,
short xx,
short yy,
short zz)
Set orientation and gravity force of the prepared event. |
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,
int z,
int ax,
int ay,
int xVRes,
int yVRes,
int xOffset,
int yOffset,
short sensorBarPostion,
short screenAsPectRatio)
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 GenericEvent 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 pressedbuttonsJustReleased
- buttons just releasedbuttonsHeld
- buttons heldpublic void prepareIRevent(int x, int y, int z, int ax, int ay, int xVRes, int yVRes, int xOffset, int yOffset, short sensorBarPostion, short screenAsPectRatio)
x
- calculated X coordinate.y
- calculated Y coordinate.z
- calculated distance.ax
- absolute X coordinate.ay
- absolute Y coordinatexVRes
- 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.public void addIRPointToPreparedWiiMoteEvent(int x, int y, short rx, short ry, short size)
x
- x coordinatesy
- y coordinatesrx
- 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 x, float y, float z, short xx, short yy, short zz)
orientationThreshold
- value of the minimum angle between two events with the
accelerometeraccelerationThreshold
- value of the value variation between two events with the
accelerometersmoothingState
- true if smoothing flag is activatedalphaSmooth
- value of the alpha smoothing parameterr
- rollp
- pitchya
- yawx
- gravity force on x axisy
- gravity force on y axisz
- gravity force on z axisxx
- raw acceleration on x axisyy
- raw acceleration on y axiszz
- raw acceleration on z axispublic 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 wiimoteconnect
- true if the wiimote is connectedbatt
- battery levelled
- status of ledsspeak
- speakers statusattach
- attachment statusrumbleState
- true if rumble is activecontinuousState
- true if continuous flag is activatedirState
- true if ir is activemotionSensingState
- true if accelerometer is activepublic void addDisconnectionEvent(int id)
id
- id of the wiimotepublic WiiUseApiEvent[] getEvents()
public void clearEvents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |