Renamed package namespaces to assure a better usability with other libraries.
git-svn-id: svn://svn.code.sf.net/p/wiigee/code/trunk@81 c7eff9ee-dd40-0410-8832-91a4d88773cf
This commit is contained in:
85
src/org/wiigee/event/AccelerationEvent.java
Executable file
85
src/org/wiigee/event/AccelerationEvent.java
Executable file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* wiigee - accelerometerbased gesture recognition
|
||||
* Copyright (C) 2007, 2008 Benjamin Poppinga
|
||||
*
|
||||
* Developed at University of Oldenburg
|
||||
* Contact: benjamin.poppinga@informatik.uni-oldenburg.de
|
||||
*
|
||||
* This file is part of wiigee.
|
||||
*
|
||||
* wiigee is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
package org.wiigee.event;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
import org.wiigee.device.*;
|
||||
|
||||
/**
|
||||
* This Event would be generated if an acceleration has been detected.
|
||||
* It contains information about the force applied to the device in each
|
||||
* direction (x, y, z). Further it contains the absolute value of this
|
||||
* vector and the source which generated this event (wiimote).
|
||||
*
|
||||
* @author Benjamin 'BePo' Poppinga
|
||||
*
|
||||
*/
|
||||
public class AccelerationEvent extends EventObject {
|
||||
|
||||
double X, Y, Z;
|
||||
double absvalue;
|
||||
Device source;
|
||||
|
||||
/**
|
||||
* Create a WiimoteAccelerationEvent with a specific source,
|
||||
* all the three acceleration values and the calculated absolute
|
||||
* value.
|
||||
*
|
||||
* @param source The source which has been accelerated (Wiimote).
|
||||
* @param X The value of acceleration in the x direction.
|
||||
* @param Y The value of acceleration in the y direction.
|
||||
* @param Z The value of acceleration in the z direction.
|
||||
* @param absvalue The absolute value of this acceleration vector.
|
||||
*/
|
||||
public AccelerationEvent(Device source, double X, double Y, double Z, double absvalue) {
|
||||
super(source);
|
||||
this.source=source;
|
||||
this.X=X;
|
||||
this.Y=Y;
|
||||
this.Z=Z;
|
||||
this.absvalue=absvalue;
|
||||
}
|
||||
|
||||
public Device getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return X;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return Y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return Z;
|
||||
}
|
||||
|
||||
public double getAbsValue() {
|
||||
return absvalue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user