|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.wisch.joystick.ffeffect.direction.Direction
at.wisch.joystick.ffeffect.direction.CartesianDirection
public class CartesianDirection
The Class CartesianDirection. The direction is encoded by three positions: X axis, Y axis and Z axis (with 3 FF axes).
The coordinate values can be any positive or negative int value. The cardinal directions would be:
- North: {0, -1, 0}
- East: {-1, 0, 0}
- South: {0, 1, 0}
- West: {1, 0, 0}
Some other examples:
- {1, -2, 0} would be North-North-East
- {1, 2, 0) would be the same as {2, 4, 0} (coordinates define only direction, not magnitude or distance)
Field Summary | |
---|---|
static int[] |
EAST
The constant EAST ({1, 0, 0}): force comes from right, 3rd axis not used. |
static int[] |
NORTH
The constant NORTH ({0, -1, 0}): force comes from top, 3rd axis not used. |
static int[] |
NORTHEAST
The constant NORTHEAST ({1, -1, 0}): force comes from top-right, 3rd axis not used. |
static int[] |
NORTHWEST
The constant NORTHWEST ({-1, -1, 0}): force comes from top-left, 3rd axis not used. |
static int[] |
SOUTH
The constant SOUTH ({0, 1, 0}): force comes from bottom, 3rd axis not used. |
static int[] |
SOUTHEAST
The constant SOUTHEAST ({1, 1, 0}): force comes from bottom-right, 3rd axis not used. |
static int[] |
SOUTHWEST
The constant SOUTHWEST ({-1, 1, 0}): force comes from bottom-left, 3rd axis not used. |
static int[] |
WEST
The constant WEST ({-1, 0, 0}): force comes from left, 3rd axis not used. |
Fields inherited from class at.wisch.joystick.ffeffect.direction.Direction |
---|
DIRECTION_CARTESIAN, DIRECTION_POLAR, DIRECTION_SPHERICAL |
Constructor Summary | |
---|---|
CartesianDirection()
Instantiates a new cartesian direction with the default direction (NORTHWEST), 3rd axis not used. |
|
CartesianDirection(int[] cartesianCoordinates)
Instantiates a new cartesian direction with the specified coordinate values. |
Method Summary | |
---|---|
int[] |
getCartesianCoordinates()
Gets the cartesian coordinates. |
int |
getCartesianXCoordinate()
Gets the cartesian X axis coordinate. |
int |
getCartesianYCoordinate()
Gets the cartesian Y axis coordinate. |
int |
getCartesianZCoordinate()
Gets the cartesian Z axis coordinate. |
java.lang.String |
getName()
Gets the direction type as a String. |
void |
setCartesianCoordinates(int[] cartesianCoordinates)
Sets the cartesian coordinates. |
void |
setCartesianXCoordinate(int cartesianCoordinate)
Sets the cartesian X axis coordinate. |
void |
setCartesianYCoordinate(int cartesianCoordinate)
Sets the cartesian Y axis coordinate. |
void |
setCartesianZCoordinate(int cartesianCoordinate)
Sets the cartesian Z axis coordinate. |
CartesianDirection |
toCartesianDirection(Direction direction)
Converts the Direction to CartesianDirection. |
PolarDirection |
toPolarDirection(Direction direction)
Converts the Direction to PolarDirection. |
SphericalDirection |
toSphericalDirection(Direction direction)
Converts the Direction to SphericalDirection. |
Methods inherited from class at.wisch.joystick.ffeffect.direction.Direction |
---|
getDirectionType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int[] NORTH
public static final int[] NORTHEAST
public static final int[] EAST
public static final int[] SOUTHEAST
public static final int[] SOUTH
public static final int[] SOUTHWEST
public static final int[] WEST
public static final int[] NORTHWEST
Constructor Detail |
---|
public CartesianDirection(int[] cartesianCoordinates)
cartesianCoordinates
- the cartesian coordinates for X, Y and Z axes (an int array of size 3, any int values)public CartesianDirection()
Method Detail |
---|
public void setCartesianCoordinates(int[] cartesianCoordinates)
cartesianCoordinates
- the new cartesian coordinates for X, Y and Z axes (an int array of size 3, any int values)public void setCartesianXCoordinate(int cartesianCoordinate)
cartesianCoordinate
- the new cartesian X axis coordinate (any int value)public void setCartesianYCoordinate(int cartesianCoordinate)
cartesianCoordinate
- the new cartesian Y axis coordinate (any int value)public void setCartesianZCoordinate(int cartesianCoordinate)
cartesianCoordinate
- the new cartesian Z axis coordinate (any int value)public int[] getCartesianCoordinates()
public int getCartesianXCoordinate()
public int getCartesianYCoordinate()
public int getCartesianZCoordinate()
public java.lang.String getName()
getName
in class Direction
Direction.getDirectionType()
public CartesianDirection toCartesianDirection(Direction direction)
Direction
toCartesianDirection
in class Direction
direction
- the Direction to be converted
public PolarDirection toPolarDirection(Direction direction)
toPolarDirection
in class Direction
direction
- the Direction to be converted
public SphericalDirection toSphericalDirection(Direction direction)
toSphericalDirection
in class Direction
direction
- the Direction to be converted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |