git-svn-id: http://wiiusej.googlecode.com/svn/trunk@108 ae48ae66-6a45-0410-b38e-211266189506
This commit is contained in:
75
WiiUseJ_0.1/src/wiiusej/values/GForce.java
Normal file
75
WiiUseJ_0.1/src/wiiusej/values/GForce.java
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* This file is part of WiiuseJ.
|
||||
*
|
||||
* WiiuseJ is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* WiiuseJ is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WiiuseJ. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package wiiusej.values;
|
||||
|
||||
/**
|
||||
* Represents gravity force on each axis.
|
||||
* @author guiguito
|
||||
*/
|
||||
public class GForce {
|
||||
|
||||
private float x;
|
||||
private float y;
|
||||
private float z;
|
||||
|
||||
/**
|
||||
* Default constructor;
|
||||
*/
|
||||
public GForce(){
|
||||
x = 0;
|
||||
y = 0;
|
||||
z = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor with gravity force on each axis.
|
||||
* @param xx x value
|
||||
* @param yy x value
|
||||
* @param zz x value
|
||||
*/
|
||||
public GForce(float xx, float yy, float zz){
|
||||
x = xx;
|
||||
y = yy;
|
||||
z = zz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the x
|
||||
*/
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the y
|
||||
*/
|
||||
public float getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the z
|
||||
*/
|
||||
public float getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Gravity force : ("+x+", "+y+","+z+")";
|
||||
}
|
||||
}
|
||||
109
WiiUseJ_0.1/src/wiiusej/values/IRSource.java
Normal file
109
WiiUseJ_0.1/src/wiiusej/values/IRSource.java
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* This file is part of WiiuseJ.
|
||||
*
|
||||
* WiiuseJ is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* WiiuseJ is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WiiuseJ. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package wiiusej.values;
|
||||
|
||||
/**
|
||||
* Class used for IR sources.
|
||||
* @author guiguito
|
||||
*/
|
||||
public class IRSource{
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private short rx;
|
||||
private short ry;
|
||||
private short size;
|
||||
|
||||
/**
|
||||
* Build an IR source with all details.
|
||||
*
|
||||
* @param xx
|
||||
* xx interpolated coordinates.
|
||||
* @param yy
|
||||
* yy interpolated coordinates.
|
||||
* @param rxx
|
||||
* raw X coordinate (0-1023).
|
||||
* @param ryy
|
||||
* raw Y coordinate (0-1023).
|
||||
* @param si
|
||||
* size of the IR dot (0-15).
|
||||
*/
|
||||
public IRSource(int xx, int yy, short rxx, short ryy, short si) {
|
||||
x = xx;
|
||||
y = yy;
|
||||
rx = rxx;
|
||||
ry = ryy;
|
||||
size = si;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return x interpolated coordinates.
|
||||
* @return the x
|
||||
*/
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return y interpolated coordinates.
|
||||
* @return the y
|
||||
*/
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return raw X coordinate (0-1023).
|
||||
* @return the rx
|
||||
*/
|
||||
public short getRx() {
|
||||
return rx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return raw Y coordinate (0-1023).
|
||||
* @return the ry
|
||||
*/
|
||||
public short getRy() {
|
||||
return ry;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return size of the IR dot (0-15).
|
||||
* @return the size
|
||||
*/
|
||||
public short getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Interpolated coordinates ("+x+","+y+"), Raw coordinates("+rx+","+ry+"), source size : "+size+")";
|
||||
}
|
||||
|
||||
}
|
||||
76
WiiUseJ_0.1/src/wiiusej/values/Orientation.java
Normal file
76
WiiUseJ_0.1/src/wiiusej/values/Orientation.java
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* This file is part of WiiuseJ.
|
||||
*
|
||||
* WiiuseJ is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* WiiuseJ is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WiiuseJ. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package wiiusej.values;
|
||||
|
||||
/**
|
||||
* Class that represents the orientation of the wiimote.
|
||||
* @author guiguito
|
||||
*/
|
||||
public class Orientation {
|
||||
|
||||
private float roll;
|
||||
private float pitch;
|
||||
private float yaw;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Orientation(){
|
||||
roll = 0;
|
||||
pitch = 0;
|
||||
yaw = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contructor with raw, pitch , yaw.
|
||||
* @param r raw
|
||||
* @param p pitch
|
||||
* @param y yaw
|
||||
*/
|
||||
public Orientation(float r, float p, float y){
|
||||
roll = r;
|
||||
pitch = p;
|
||||
yaw = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the roll
|
||||
*/
|
||||
public float getRoll() {
|
||||
return roll;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pitch
|
||||
*/
|
||||
public float getPitch() {
|
||||
return pitch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the yaw
|
||||
*/
|
||||
public float getYaw() {
|
||||
return yaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Orientation : (roll: "+roll+", pitch: "+pitch+", yaw: "+yaw+")";
|
||||
}
|
||||
|
||||
}
|
||||
75
WiiUseJ_0.1/src/wiiusej/values/RawAcceleration.java
Normal file
75
WiiUseJ_0.1/src/wiiusej/values/RawAcceleration.java
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* This file is part of WiiuseJ.
|
||||
*
|
||||
* WiiuseJ is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* WiiuseJ is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WiiuseJ. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package wiiusej.values;
|
||||
|
||||
/**
|
||||
* Represents raw acceleration on each axis.
|
||||
* @author guiguito
|
||||
*/
|
||||
public class RawAcceleration {
|
||||
|
||||
private short x;
|
||||
private short y;
|
||||
private short z;
|
||||
|
||||
/**
|
||||
* Default constructor;
|
||||
*/
|
||||
public RawAcceleration() {
|
||||
x = 0;
|
||||
y = 0;
|
||||
z = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor with raw acceleration on each axis.
|
||||
* @param xx x value
|
||||
* @param yy x value
|
||||
* @param zz x value
|
||||
*/
|
||||
public RawAcceleration(short xx, short yy, short zz) {
|
||||
x = xx;
|
||||
y = yy;
|
||||
z = zz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the x
|
||||
*/
|
||||
public short getX() {
|
||||
return x;
|
||||
}
|
||||
/**
|
||||
* @return the y
|
||||
*/
|
||||
public short getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the z
|
||||
*/
|
||||
public short getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Raw acceleration : ("+x+", "+y+","+z+")";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user