|
||||||||||
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.SphericalDirection
public class SphericalDirection
The Class SphericalDirection. Similar to PolarDirection, a SphericalDirection
is encoded by two rotations:
1) Degrees from (1, 0) rotated towards (0, 1).
2) Degrees towards (0, 0, 1) (device needs to have 3 FF axes).
Example: A direction of 27000 for the first angle and 4500 for the
second would be directly away from the user (270 degrees
clockwise from east) and angling toward the floor (45 degrees
downward from the tabletop). To counteract a force with this
direction, the user would have to push forward and down.
The degree values are encoded by hundredths of a
degree. The cardinal directions would be:
- East: {0, 0}
- South: {9000, 0}
- West: {18000, 0}
- North: {27000, 0}
Field Summary | |
---|---|
static int[] |
EAST
The constant EAST ({0, 0}): force comes from right, 3rd axis not used. |
static int[] |
NORTH
The constant NORTH ({27000, 0}): force comes from top, 3rd axis not used. |
static int[] |
NORTHEAST
The constant NORTHEAST ({31500, 0}): force comes from top-right, 3rd axis not used. |
static int[] |
NORTHWEST
The constant NORTHWEST ({22500, 0}): force comes from top-left, 3rd axis not used. |
static int[] |
SOUTH
The constant SOUTH ({9000, 0}): force comes from bottom, 3rd axis not used. |
static int[] |
SOUTHEAST
The constant SOUTHEAST ({4500, 0}): force comes from bottom-right, 3rd axis not used. |
static int[] |
SOUTHWEST
The constant SOUTHWEST ({13500, 0}): force comes from bottom-left, 3rd axis not used. |
static int[] |
WEST
The constant WEST ({18000, 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 | |
---|---|
SphericalDirection()
Instantiates a new spherical direction with the default direction (NORTHWEST), 3rd axis not used. |
|
SphericalDirection(int[] sphericalCoordinates)
Instantiates a new spherical direction with the specified coordinate values. |
Method Summary | |
---|---|
java.lang.String |
getName()
Gets the direction type as a String. |
int[] |
getSphericalCoordinates()
Gets the spherical coordinate values. |
void |
setSphericalCoordinates(int[] sphericalCoordinates)
Sets the spherical coordinate values. |
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 SphericalDirection(int[] sphericalCoordinates)
sphericalCoordinates
- the spherical coordinates (an int array of size 2, values from 0 to 35999)public SphericalDirection()
Method Detail |
---|
public int[] getSphericalCoordinates()
public void setSphericalCoordinates(int[] sphericalCoordinates)
sphericalCoordinates
- the new spherical coordinates (an int array of size 2, values from 0 to 35999)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)
this
(not a copy, but really this object)
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 |