|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiremotej.WiiRemoteMouse
wiiremotej.IRAccelerometerMouse
public class IRAccelerometerMouse
An interface for implementing mouse functionality using the Wii Remote through the IR sensor and accelerometer. Maps the IR camera's 1024X768 resolution to the screen. The mouse takes the average of all of the light points it sees on the screen (1, 2, 3, or 4) and uses the center point. This mouse will take into account the orientation of the remote when determining coordinates. Note that because this mouse uses absolute positioning, if sensitivity is set to be less than 1, the mouse will not be able to cover the whole screen.
Field Summary |
---|
Fields inherited from class wiiremotej.WiiRemoteMouse |
---|
xSensitivity, ySensitivity |
Constructor Summary | |
---|---|
IRAccelerometerMouse(double xSensitivity,
double ySensitivity,
double xThreshold,
double yThreshold,
double rollSensitivity)
Constructs a new IRAccelerometerMouse. |
Method Summary | |
---|---|
static IRAccelerometerMouse |
getDefault()
Returns a basic IR + accelerometer mouse. |
double |
getRollSensitivity()
Returns the pitch sensitivity of this "mouse." Pitch sensitivity is precision to which pitch will be rounded to when determining remote orientation. |
void |
processMouseEvent(WRIREvent evt,
WRAccelerationEvent evt2)
Processes the given WRIREvent and moves the mouse if necessary based on user settings and input. |
void |
setRollSensitivity(double rollSensitivity)
Sets the pitch sensitivity of this "mouse" to the given value. |
Methods inherited from class wiiremotej.WiiRemoteMouse |
---|
getXSensitivity, getYSensitivity, moveMouse, setXSensitivity, setYSensitivity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IRAccelerometerMouse(double xSensitivity, double ySensitivity, double xThreshold, double yThreshold, double rollSensitivity) throws java.awt.AWTException, java.lang.SecurityException, java.lang.IllegalArgumentException
xSensitivity
- the modifier to multiply the X offset (from the center of the screen) by. A negative modifier will move the mouse the opposite way.ySensitivity
- the modifier to multiply the Y offset (from the center of the screen) by. A negative modifier will move the mouse the opposite way.xThreshold
- the percent (0 to 1 scale) different the X coordinate must be to be counted as a change (and thus trigger mouse movement).yThreshold
- the percent (0 to 1 scale) different the Y coordinate must be to be counted as a change (and thus trigger mouse movement).rollSensitivity
- the precision to which roll will be rounded to when determining remote orientation. Used to reduce jumpiness.
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.
java.lang.IllegalArgumentException
- if xThreshold or yThreshold or rollSensitivity is less than 0.Method Detail |
---|
public static IRAccelerometerMouse getDefault() throws java.awt.AWTException, java.lang.SecurityException
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.public void processMouseEvent(WRIREvent evt, WRAccelerationEvent evt2)
evt
- the IR event to use when calculating mouse movement.evt2
- the acceleration event to use when calculating mouse movement.public double getRollSensitivity()
public void setRollSensitivity(double rollSensitivity)
rollSensitivity
- the new pitch sensitivity value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |