wiiuseJ 0.12 work in progress. Added method to force stack type and fixed IR.z value and nunchuk thresholds.

git-svn-id: http://wiiusej.googlecode.com/svn/trunk@144 ae48ae66-6a45-0410-b38e-211266189506
This commit is contained in:
guilhem.duche
2008-05-24 09:43:49 +00:00
parent de3e5d1bbf
commit 0b143596dd
7 changed files with 180 additions and 52 deletions

View File

@@ -31,7 +31,7 @@ public class IREvent extends GenericEvent {
private short indexPoints = 0;
private int x;
private int y;
private int z;// distance from the sensor bar
private float z;// distance from the sensor bar
private int ax;
private int ay;
private int xVRes;
@@ -82,7 +82,7 @@ public class IREvent extends GenericEvent {
* @param distance
* Pixel Distance between first two dots
*/
public IREvent(int id, int x, int y, int z, int ax, int ay, int xVRes,
public IREvent(int id, 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) {
super(id);
@@ -154,7 +154,7 @@ public class IREvent extends GenericEvent {
*
* @return the z
*/
public int getZ() {
public float getZ() {
return z;
}

View File

@@ -103,7 +103,7 @@ public class EventsGatherer {
* @param distance
* Pixel Distance between first two dots.
*/
public void prepareIRevent(int x, int y, int z, int ax, int ay, int xVRes,
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) {
genericEvent.prepareIRevent(x, y, z, ax, ay, xVRes, yVRes, xOffset,

View File

@@ -16,7 +16,6 @@
*/
package wiiusej.wiiusejevents.wiiuseapievents;
/**
* Class used to represent a status event. This class is used to know what are
* the settings of the wiimote.
@@ -131,10 +130,12 @@ public class StatusEvent extends WiiUseApiEvent {
public short getLeds() {
return leds;
}
/**
* Tells if the given led is turned on according to the leds status int.
* @param led the int encoding a led.
*
* @param led
* the int encoding a led.
* @return true if the led is turned on false otherwise.
*/
private boolean ledStatusCheck(short led) {
@@ -235,6 +236,42 @@ public class StatusEvent extends WiiUseApiEvent {
return isMotionSensingActive;
}
/**
* Tells if an attachment is connected.
*
* @return true if anything is connected to the wiimote false otherwise.
*/
public boolean isAttachmentConnected() {
return attachment != EXP_NONE;
}
/**
* Tells if a nunchuk is connected.
*
* @return true if a nunchuk is connected to the wiimote false otherwise.
*/
public boolean isNunchukConnected() {
return attachment != EXP_NUNCHUK;
}
/**
* Tells if a classic controller is connected.
*
* @return true if a classic controller is connected to the wiimote false otherwise.
*/
public boolean isClassicControllerConnected() {
return attachment != EXP_CLASSIC;
}
/**
* Tells if a guitar hero controller is connected.
*
* @return true if a guitar hero controllerr is connected to the wiimote false otherwise.
*/
public boolean isGuitarHeroConnected() {
return attachment != EXP_GUITAR_HERO_3;
}
@Override
public String toString() {
String out = "";

View File

@@ -157,7 +157,7 @@ public class WiimoteEvent extends WiiUseApiEvent {
* @param distance
* Pixel Distance between first two dots
*/
public void prepareIRevent(int x, int y, int z, int ax, int ay, int xVRes,
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) {
if (infraredEvent == null) {