java.lang.ObjectDirection
public class Direction
An immutable class that describes a returned axis direction from the joypad. This includes the direction and it's strength.
The user should never need to create these themselves, instead they will be created and returned for you by the GamePad class.
Constructor Summary | |
---|---|
Direction(int angle,
float strength)
Creates a new direction. |
Method Summary | |
---|---|
int |
getAngle()
Angles are in degrees from 0 to 359, with 0 pointing to the east. |
double |
getAngleRadians()
Returns the same value as the getAngle method, however this is in radians instead of degrees. |
float |
getStrength()
Strength represents how far the axis is pushed in the given direction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Direction(int angle, float strength)
The
- angle for this direction in degrees.How
- strong the direction is moving in the given angle.Method Detail |
---|
public int getAngle()
public double getAngleRadians()
Returns the same value as the getAngle method, however this is in radians instead of degrees.
This is useful for when you are using the static trigonomic methods in the Math class, like Math.cos() and Math.sin().
public float getStrength()