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:
@@ -309,7 +309,8 @@ public class WiiUseApi {
|
|||||||
synchronized native void setIrSensitivity(int id, int level);
|
synchronized native void setIrSensitivity(int id, int level);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set how many degrees an angle must change to generate an event for the nunchuk.
|
* Set how many degrees an angle must change to generate an event for the
|
||||||
|
* nunchuk.
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote concerned.
|
* id of the wiimote concerned.
|
||||||
@@ -319,7 +320,8 @@ public class WiiUseApi {
|
|||||||
synchronized native void setNunchukOrientationThreshold(int id, float angle);
|
synchronized native void setNunchukOrientationThreshold(int id, float angle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set how much acceleration must change to generate an event for the nunchuk.
|
* Set how much acceleration must change to generate an event for the
|
||||||
|
* nunchuk.
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote concerned.
|
* id of the wiimote concerned.
|
||||||
@@ -328,6 +330,14 @@ public class WiiUseApi {
|
|||||||
*/
|
*/
|
||||||
synchronized native void setNunchukAccelerationThreshold(int id, int value);
|
synchronized native void setNunchukAccelerationThreshold(int id, int value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force the bluetooth stack type.(useful only for windows)
|
||||||
|
*
|
||||||
|
* @param bluetoothStackType
|
||||||
|
* must be WiiUseApi.WIIUSE_STACK_UNKNOWN or WiiUseApi.WIIUSE_STACK_MS or
|
||||||
|
* WiiUseApi.WIIUSE_STACK_BLUESOLEIL.
|
||||||
|
*/
|
||||||
|
native void windowsSetBluetoothStack(int bluetoothStackType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for new Events and Get it.
|
* Check for new Events and Get it.
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ public class WiiUseApiManager extends Thread {
|
|||||||
|
|
||||||
private AtomicBoolean running = new AtomicBoolean(false);
|
private AtomicBoolean running = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
public static int WIIUSE_STACK_UNKNOWN = 0;
|
||||||
|
public static int WIIUSE_STACK_MS = 1;
|
||||||
|
public static int WIIUSE_STACK_BLUESOLEIL = 2;
|
||||||
|
|
||||||
public static WiiUseApiManager getInstance() {
|
public static WiiUseApiManager getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@@ -57,12 +61,56 @@ public class WiiUseApiManager extends Thread {
|
|||||||
* try to connect nb wiimotes.
|
* try to connect nb wiimotes.
|
||||||
* @param rumble
|
* @param rumble
|
||||||
* make the connected wiimotes rumble.
|
* make the connected wiimotes rumble.
|
||||||
|
*
|
||||||
* @return an array with connected wiimotes or NULL.
|
* @return an array with connected wiimotes or NULL.
|
||||||
*/
|
*/
|
||||||
public synchronized static Wiimote[] getWiimotes(int nb, boolean rumble) {
|
public static Wiimote[] getWiimotes(int nb, boolean rumble){
|
||||||
|
return getWiimotesPrivate(nb, rumble, false, WIIUSE_STACK_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get wiimotes. Load library if necessary. Connect to wiimotes if
|
||||||
|
* necessary. Start polling if necessary. Return an array with the connected
|
||||||
|
* wiimotes.
|
||||||
|
*
|
||||||
|
* @param nb
|
||||||
|
* try to connect nb wiimotes.
|
||||||
|
* @param rumble
|
||||||
|
* make the connected wiimotes rumble.*
|
||||||
|
* @param stackType
|
||||||
|
* the stack type : WiiUseApiManager.WIIUSE_STACK_UNKNOWN or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_MS or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_BLUESOLEIL
|
||||||
|
*
|
||||||
|
* @return an array with connected wiimotes or NULL.
|
||||||
|
*/
|
||||||
|
public static Wiimote[] getWiimotes(int nb, boolean rumble, int stackType){
|
||||||
|
return getWiimotesPrivate(nb, rumble, true, stackType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get wiimotes. Load library if necessary. Connect to wiimotes if
|
||||||
|
* necessary. Start polling if necessary. Return an array with the connected
|
||||||
|
* wiimotes.
|
||||||
|
*
|
||||||
|
* @param nb
|
||||||
|
* try to connect nb wiimotes.
|
||||||
|
* @param rumble
|
||||||
|
* make the connected wiimotes rumble.*
|
||||||
|
* @param forceStackType
|
||||||
|
* true if we want to force the stack type.
|
||||||
|
* @param stackType
|
||||||
|
* the stack type : WiiUseApiManager.WIIUSE_STACK_UNKNOWN or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_MS or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_BLUESOLEIL
|
||||||
|
*
|
||||||
|
* @return an array with connected wiimotes or NULL.
|
||||||
|
*/
|
||||||
|
private synchronized static Wiimote[] getWiimotesPrivate(int nb, boolean rumble,
|
||||||
|
boolean forceStackType, int stackType) {
|
||||||
WiiUseApiManager manager = getInstance();
|
WiiUseApiManager manager = getInstance();
|
||||||
if (manager.connected <= 0 && !manager.running.get()) {
|
if (manager.connected <= 0 && !manager.running.get()) {
|
||||||
int nbWiimotes = manager.connectWiimotes(nb, rumble);
|
int nbWiimotes = manager.connectWiimotes(nb, rumble, forceStackType, stackType);
|
||||||
manager.wiimotes = new Wiimote[nbWiimotes];
|
manager.wiimotes = new Wiimote[nbWiimotes];
|
||||||
for (int i = 0; i < nbWiimotes; i++) {
|
for (int i = 0; i < nbWiimotes; i++) {
|
||||||
Wiimote wim = new Wiimote(WiiUseApi.getInstance().getUnId(i),
|
Wiimote wim = new Wiimote(WiiUseApi.getInstance().getUnId(i),
|
||||||
@@ -70,21 +118,21 @@ public class WiiUseApiManager extends Thread {
|
|||||||
manager.wiimotes[i] = wim;
|
manager.wiimotes[i] = wim;
|
||||||
manager.addWiiUseApiListener(wim);
|
manager.addWiiUseApiListener(wim);
|
||||||
}
|
}
|
||||||
//Set leds on wiimote
|
// Set leds on wiimote
|
||||||
for (Wiimote wiimote : manager.wiimotes) {
|
for (Wiimote wiimote : manager.wiimotes) {
|
||||||
int id = wiimote.getId();
|
int id = wiimote.getId();
|
||||||
short leds = 0;
|
short leds = 0;
|
||||||
if (id%4==0){
|
if (id % 4 == 0) {
|
||||||
wiimote.setLeds(true, true, true, true);
|
wiimote.setLeds(true, true, true, true);
|
||||||
}else if (id%4==1){
|
} else if (id % 4 == 1) {
|
||||||
wiimote.setLeds(true, false, false, false);
|
wiimote.setLeds(true, false, false, false);
|
||||||
}else if (id%4==2){
|
} else if (id % 4 == 2) {
|
||||||
wiimote.setLeds(true, true, false, false);
|
wiimote.setLeds(true, true, false, false);
|
||||||
}else if (id%4==3){
|
} else if (id % 4 == 3) {
|
||||||
wiimote.setLeds(true, true, true, false);
|
wiimote.setLeds(true, true, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//make the connected wiimotes rumble
|
// make the connected wiimotes rumble
|
||||||
if (rumble) {
|
if (rumble) {
|
||||||
for (Wiimote wiimote : manager.wiimotes) {
|
for (Wiimote wiimote : manager.wiimotes) {
|
||||||
wiimote.activateRumble();
|
wiimote.activateRumble();
|
||||||
@@ -117,12 +165,20 @@ public class WiiUseApiManager extends Thread {
|
|||||||
* try to connect nb wiimotes
|
* try to connect nb wiimotes
|
||||||
* @param rumble
|
* @param rumble
|
||||||
* make the connected wiimotes rumble
|
* make the connected wiimotes rumble
|
||||||
|
* @param forceStackType
|
||||||
|
* true if we want to force the stack type.
|
||||||
|
* @param stackType
|
||||||
|
* the stack type : WiiUseApiManager.WIIUSE_STACK_UNKNOWN or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_MS or
|
||||||
|
* WiiUseApiManager.WIIUSE_STACK_BLUESOLEIL
|
||||||
* @return 0 if nothing connected or the number of wiimotes connected.
|
* @return 0 if nothing connected or the number of wiimotes connected.
|
||||||
*/
|
*/
|
||||||
private int connectWiimotes(int nb, boolean rumble) {
|
private int connectWiimotes(int nb, boolean rumble, boolean forceStackType, int stackType) {
|
||||||
if (connected <= 0) {
|
if (connected <= 0) {
|
||||||
int nbWiimotesFound;
|
int nbWiimotesFound;
|
||||||
wiiuse.init(nb);
|
wiiuse.init(nb);
|
||||||
|
//force bluetooth stack type ?
|
||||||
|
if (forceStackType) setBlueToothstackType(stackType);
|
||||||
nbWiimotesFound = wiiuse.find(nb, 3);
|
nbWiimotesFound = wiiuse.find(nb, 3);
|
||||||
connected = wiiuse.connect(nbWiimotesFound);
|
connected = wiiuse.connect(nbWiimotesFound);
|
||||||
return connected;
|
return connected;
|
||||||
@@ -302,8 +358,8 @@ public class WiiUseApiManager extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the orientation threshold for the given id.
|
* Set the orientation threshold for the given id. (minimum angle between
|
||||||
* (minimum angle between two events)
|
* two events)
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote.
|
* id of the wiimote.
|
||||||
@@ -315,8 +371,8 @@ public class WiiUseApiManager extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the acceleration threshold for the given id.
|
* Set the acceleration threshold for the given id. (minimum angle between
|
||||||
* (minimum angle between two events)
|
* two events)
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote.
|
* id of the wiimote.
|
||||||
@@ -445,31 +501,42 @@ public class WiiUseApiManager extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the nunchuk orientation threshold for the given id.
|
* Set the nunchuk orientation threshold for the given id. (minimum angle
|
||||||
* (minimum angle between two events)
|
* between two events)
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote.
|
* id of the wiimote.
|
||||||
* @param th
|
* @param th
|
||||||
* threshold in degrees.
|
* threshold in degrees.
|
||||||
*/
|
*/
|
||||||
public void setNunchukOrientationThreshold(int id, float th){
|
public void setNunchukOrientationThreshold(int id, float th) {
|
||||||
wiiuse.setNunchukOrientationThreshold(id, th);
|
wiiuse.setNunchukOrientationThreshold(id, th);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the nunchuk acceleration threshold for the given id.
|
* Set the nunchuk acceleration threshold for the given id. (minimum angle
|
||||||
* (minimum angle between two events)
|
* between two events)
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* id of the wiimote.
|
* id of the wiimote.
|
||||||
* @param th
|
* @param th
|
||||||
* threshold.
|
* threshold.
|
||||||
*/
|
*/
|
||||||
public void setNunchukAccelerationThreshold(int id, int th){
|
public void setNunchukAccelerationThreshold(int id, int th) {
|
||||||
wiiuse.setNunchukAccelerationThreshold(id, th);
|
wiiuse.setNunchukAccelerationThreshold(id, th);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force the bluetooth stack type.(useful only for windows)
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* must be WIIUSE_STACK_UNKNOWN or WIIUSE_STACK_MS or
|
||||||
|
* WIIUSE_STACK_BLUESOLEIL.
|
||||||
|
*/
|
||||||
|
private void setBlueToothstackType(int type) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
|||||||
@@ -233,24 +233,24 @@ public class Wiimote implements WiiUseApiListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the nunchuk orientation threshold for the given id.
|
* Set the nunchuk orientation threshold for the given id. (minimum angle
|
||||||
* (minimum angle between two events)
|
* between two events)
|
||||||
*
|
*
|
||||||
* @param th
|
* @param th
|
||||||
* threshold in degrees.
|
* threshold in degrees.
|
||||||
*/
|
*/
|
||||||
public void setNunchukOrientationThreshold(float th){
|
public void setNunchukOrientationThreshold(float th) {
|
||||||
manager.setNunchukOrientationThreshold(id, th);
|
manager.setNunchukOrientationThreshold(id, th);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the nunchuk acceleration threshold for the given id.
|
* Set the nunchuk acceleration threshold for the given id. (minimum angle
|
||||||
* (minimum angle between two events)
|
* between two events)
|
||||||
*
|
*
|
||||||
* @param th
|
* @param th
|
||||||
* threshold.
|
* threshold.
|
||||||
*/
|
*/
|
||||||
public void setNunchukAccelerationThreshold(int th){
|
public void setNunchukAccelerationThreshold(int th) {
|
||||||
manager.setNunchukAccelerationThreshold(id, th);
|
manager.setNunchukAccelerationThreshold(id, th);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,6 +270,21 @@ public class Wiimote implements WiiUseApiListener {
|
|||||||
manager.getStatus(id);
|
manager.getStatus(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the normal and expansion handshake timeouts for this wiimote. Normal
|
||||||
|
* time out is for classic polling. The expansion timeout is used when an
|
||||||
|
* expansion is detected until the expansion successfully handshakes.
|
||||||
|
*
|
||||||
|
* @param normalTimeout
|
||||||
|
* The timeout in milliseconds for a normal read.
|
||||||
|
* @param expansionTimeout
|
||||||
|
* The timeout in millisecondsd to wait for an expansion
|
||||||
|
* handshake.
|
||||||
|
*/
|
||||||
|
public void setTimeout(short normalTimeout, short expansionTimeout) {
|
||||||
|
manager.setTimeout(id, normalTimeout, expansionTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the IR sensitivity.
|
* Set the IR sensitivity.
|
||||||
*
|
*
|
||||||
@@ -297,13 +312,12 @@ public class Wiimote implements WiiUseApiListener {
|
|||||||
} else if (e.getEventType() == WiiUseApiEvent.DISCONNECTION_EVENT) {
|
} else if (e.getEventType() == WiiUseApiEvent.DISCONNECTION_EVENT) {
|
||||||
notifyDisconnectionEventListeners((DisconnectionEvent) e);
|
notifyDisconnectionEventListeners((DisconnectionEvent) e);
|
||||||
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_INSERTED) {
|
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_INSERTED) {
|
||||||
notifyNunchukInsertedEventListeners((NunchukInsertedEvent)e);
|
notifyNunchukInsertedEventListeners((NunchukInsertedEvent) e);
|
||||||
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_REMOVED) {
|
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_REMOVED) {
|
||||||
notifyNunchukRemovedEventListeners((NunchukRemovedEvent)e);
|
notifyNunchukRemovedEventListeners((NunchukRemovedEvent) e);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* events not managed yet
|
* events not managed yet || e.getEventType() == WIIUSE_READ_DATA
|
||||||
* || e.getEventType() == WIIUSE_READ_DATA
|
|
||||||
* WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_INSERTED || e.getEventType() ==
|
* WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_INSERTED || e.getEventType() ==
|
||||||
* WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_REMOVED || e.getEventType() ==
|
* WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_REMOVED || e.getEventType() ==
|
||||||
* WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_INSERTED ||
|
* WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_INSERTED ||
|
||||||
@@ -359,7 +373,7 @@ public class Wiimote implements WiiUseApiListener {
|
|||||||
if (evt.isThereMotionSensingEvent()) {
|
if (evt.isThereMotionSensingEvent()) {
|
||||||
listener.onMotionSensingEvent(evt.getMotionSensingEvent());
|
listener.onMotionSensingEvent(evt.getMotionSensingEvent());
|
||||||
}
|
}
|
||||||
if (evt.isThereExpansionEvent()){
|
if (evt.isThereExpansionEvent()) {
|
||||||
listener.onExpansionEvent(evt.getExpansionEvent());
|
listener.onExpansionEvent(evt.getExpansionEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class IREvent extends GenericEvent {
|
|||||||
private short indexPoints = 0;
|
private short indexPoints = 0;
|
||||||
private int x;
|
private int x;
|
||||||
private int y;
|
private int y;
|
||||||
private int z;// distance from the sensor bar
|
private float z;// distance from the sensor bar
|
||||||
private int ax;
|
private int ax;
|
||||||
private int ay;
|
private int ay;
|
||||||
private int xVRes;
|
private int xVRes;
|
||||||
@@ -82,7 +82,7 @@ public class IREvent extends GenericEvent {
|
|||||||
* @param distance
|
* @param distance
|
||||||
* Pixel Distance between first two dots
|
* 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,
|
int yVRes, int xOffset, int yOffset, short sensorBarPostion,
|
||||||
short screenAsPectRatio, short irSensitivity, float distance) {
|
short screenAsPectRatio, short irSensitivity, float distance) {
|
||||||
super(id);
|
super(id);
|
||||||
@@ -154,7 +154,7 @@ public class IREvent extends GenericEvent {
|
|||||||
*
|
*
|
||||||
* @return the z
|
* @return the z
|
||||||
*/
|
*/
|
||||||
public int getZ() {
|
public float getZ() {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class EventsGatherer {
|
|||||||
* @param distance
|
* @param distance
|
||||||
* Pixel Distance between first two dots.
|
* 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,
|
int yVRes, int xOffset, int yOffset, short sensorBarPostion,
|
||||||
short screenAsPectRatio, short irSensitivity, float distance) {
|
short screenAsPectRatio, short irSensitivity, float distance) {
|
||||||
genericEvent.prepareIRevent(x, y, z, ax, ay, xVRes, yVRes, xOffset,
|
genericEvent.prepareIRevent(x, y, z, ax, ay, xVRes, yVRes, xOffset,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package wiiusej.wiiusejevents.wiiuseapievents;
|
package wiiusej.wiiusejevents.wiiuseapievents;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to represent a status event. This class is used to know what are
|
* Class used to represent a status event. This class is used to know what are
|
||||||
* the settings of the wiimote.
|
* the settings of the wiimote.
|
||||||
@@ -134,7 +133,9 @@ public class StatusEvent extends WiiUseApiEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells if the given led is turned on according to the leds status int.
|
* 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.
|
* @return true if the led is turned on false otherwise.
|
||||||
*/
|
*/
|
||||||
private boolean ledStatusCheck(short led) {
|
private boolean ledStatusCheck(short led) {
|
||||||
@@ -235,6 +236,42 @@ public class StatusEvent extends WiiUseApiEvent {
|
|||||||
return isMotionSensingActive;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String out = "";
|
String out = "";
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public class WiimoteEvent extends WiiUseApiEvent {
|
|||||||
* @param distance
|
* @param distance
|
||||||
* Pixel Distance between first two dots
|
* 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,
|
int yVRes, int xOffset, int yOffset, short sensorBarPostion,
|
||||||
short screenAsPectRatio, short irSensitivity, float distance) {
|
short screenAsPectRatio, short irSensitivity, float distance) {
|
||||||
if (infraredEvent == null) {
|
if (infraredEvent == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user