|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.silentlycrashing.gestures.GestureAnalyzer
net.silentlycrashing.gestures.WiimoteGestureAnalyzer
public class WiimoteGestureAnalyzer
Records gestures made using a Wii Remote for analysis.
Works using Andreas Schlegel's oscP5 and darwiinosc libraries.
| Field Summary | |
|---|---|
static int |
A_BUTTON
|
static int |
B_BUTTON
|
private boolean |
buttonPressed
|
private Point |
currPoint
|
static int |
MAX_SIZE
|
private oscP5.OscP5 |
oscClient
|
| Fields inherited from class net.silentlycrashing.gestures.GestureAnalyzer |
|---|
DOWN, KEY_SIZE, LEFT, p, RIGHT, UP |
| Constructor Summary | |
|---|---|
WiimoteGestureAnalyzer(PApplet parent)
Builds a WiimoteGestureAnalyzer with default button, incoming port, and minimum offset. |
|
WiimoteGestureAnalyzer(PApplet parent,
int button)
Builds a WiimoteGestureAnalyzer with default incoming port and minimum offset. |
|
WiimoteGestureAnalyzer(PApplet parent,
int button,
int port)
Builds a WiimoteGestureAnalyzer with default minimum offset. |
|
WiimoteGestureAnalyzer(PApplet parent,
int button,
int port,
int min)
Builds a WiimoteGestureAnalyzer. |
|
| Method Summary | |
|---|---|
void |
buttonEvent(int val)
Handles a button event. |
void |
connectEvent(int val)
Handles a connect event. |
void |
draw()
Draws the current pointer position to the canvas. |
void |
drawPointer(boolean d)
Sets whether the Wiimote pointer should be drawn or not. |
void |
irEvent(float x1,
float y1,
float s1,
float x2,
float y2,
float s2,
float x3,
float y3,
float s3,
float x4,
float y4,
float s4)
Handles an IR event. |
| Methods inherited from class net.silentlycrashing.gestures.GestureAnalyzer |
|---|
getGesture, getMinOffset, invokeStartActions, invokeStopActions, invokeUpdateActions, isDebug, isRecognized, isVerbose, matches, registerStartAction, registerStopAction, registerUpdateAction, setDebug, setMinOffset, setVerbose, start, stop, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int A_BUTTON
public static final int B_BUTTON
public static final int MAX_SIZE
private oscP5.OscP5 oscClient
private Point currPoint
private boolean buttonPressed
| Constructor Detail |
|---|
public WiimoteGestureAnalyzer(PApplet parent)
parent - the parent PApplet
public WiimoteGestureAnalyzer(PApplet parent,
int button)
parent - the parent PAppletbutton - the Wiimote button to check
public WiimoteGestureAnalyzer(PApplet parent,
int button,
int port)
parent - the parent PAppletbutton - the Wiimote button to checkport - the incoming port for OSC messages
public WiimoteGestureAnalyzer(PApplet parent,
int button,
int port,
int min)
parent - the parent PAppletbutton - the Wiimote button to checkport - the incoming port for OSC messagesmin - the minimum offset| Method Detail |
|---|
public void connectEvent(int val)
val - whether or not the Wiimote is connectedpublic void buttonEvent(int val)
val - whether or not the button is pressed
public void irEvent(float x1,
float y1,
float s1,
float x2,
float y2,
float s2,
float x3,
float y3,
float s3,
float x4,
float y4,
float s4)
x1 - x-value of IR spot 1y1 - y-value of IR spot 1s1 - size of IR spot 1x2 - x-value of IR spot 2y2 - y-value of IR spot 2s2 - size of IR spot 2x3 - x-value of IR spot 3y3 - y-value of IR spot 3s3 - size of IR spot 3x4 - x-value of IR spot 4y4 - y-value of IR spot 4s4 - size of IR spot 4public void draw()
Can be registered for automatic drawing using drawPointer().
public void drawPointer(boolean d)
d - whether or not to draw the pointer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||