|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--Renderer.Position
Defines a position (x, y, and z) and provides a rich set of methods to manipulate it.
| Field Summary | |
static int |
NORMALIZE_CLAMP
|
int |
normalize_mode
|
static int |
NORMALIZE_NONE
|
static int |
NORMALIZE_WRAP
|
float |
x
|
float |
x_max
|
float |
x_min
|
float |
x_nominal
|
float |
x_step
|
float |
y
|
float |
y_max
|
float |
y_min
|
float |
y_nominal
|
float |
y_step
|
float |
z
|
float |
z_max
|
float |
z_min
|
float |
z_nominal
|
float |
z_step
|
| Constructor Summary | |
Position()
Creates a position with all nominal values. |
|
Position(float x,
float y,
float z)
Creates a position with both nominal values and the given values. |
|
Position(float x_min,
float x_max,
float x_nominal,
float x_step,
float y_min,
float y_max,
float y_nominal,
float y_step,
float z_min,
float z_max,
float z_nominal,
float z_step)
Creates a position with the given values. |
|
Position(Position position)
Creates a position with both nominal values and the given values. |
|
| Method Summary | |
void |
add(Position position)
Adds two positions and normalizes the result according to normalize_mode. |
void |
clamp()
Limits x, y, and z to the range specified in their *_min and *_max values. |
Position |
divide(int divisor)
Returns a position with x, y, and z divided. |
Position |
getClone()
Returns a clone of this object. |
float |
getDistance(Position position)
Returns the Euclidean distance between two positions. |
javax.vecmath.Vector3d |
getVector()
Returns a Vector3d representation of the position ordered as (x,y,z). |
boolean |
isEqual(Position position,
float tolerance)
Returns whether two positions are equal within a tolerance. |
void |
moveBackward()
Adjusts z backward according to z_step and normalizes it according to normalize_mode. |
void |
moveDown()
Adjusts y downward according to y_step and normalizes it according to normalize_mode. |
void |
moveForward()
Adjusts z forward according to z_step and normalizes it according to normalize_mode. |
void |
moveLeft()
Adjusts x leftward according to x_step and normalizes it according to normalize_mode. |
void |
moveRight()
Adjusts x rightward according to x_step and normalizes it according to normalize_mode. |
void |
moveUp()
Adjusts y upward according to y_step and normalizes it according to normalize_mode. |
void |
normalize()
Normalizes x, y, and z according to normalize_mode. |
void |
reset()
Resets x, y, and z to their nominal values x_nominal, y_nominal, and z_nominal, respectively, and normalizes them according to normalize_mode. |
void |
set(float x,
float y,
float z)
Sets the position and normalizes it according to normalize_mode. |
void |
set(Position position)
Sets the position and normalizes it according to normalize_mode. |
void |
subtract(Position position)
Subtracts two positions and normalizes the result according to normalize_mode. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
wrap()
Wraps x, y, and z around the range specified in their *_min and *_max values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NORMALIZE_NONE
public static final int NORMALIZE_WRAP
public static final int NORMALIZE_CLAMP
public int normalize_mode
public float x
public float x_min
public float x_max
public float x_nominal
public float x_step
public float y
public float y_min
public float y_max
public float y_nominal
public float y_step
public float z
public float z_min
public float z_max
public float z_nominal
public float z_step
| Constructor Detail |
public Position()
public Position(float x,
float y,
float z)
x - - the x componenty - - the y componentz - - the z componentpublic Position(Position position)
position - - the position
public Position(float x_min,
float x_max,
float x_nominal,
float x_step,
float y_min,
float y_max,
float y_nominal,
float y_step,
float z_min,
float z_max,
float z_nominal,
float z_step)
x_min - - the minimum xx_max - - the maximum xx_nominal - - the nominal xx_step - - the change in x induced by moveLeft() and moveRight()y_min - - the minimum yy_max - - the maximum yy_nominal - - the nominal yy_step - - the change in y induced by moveUp() and moveDown()z_min - - the minimum zz_max - - the maximum zz_nominal - - the nominal zz_step - - the change in z induced by moveForward() and moveBackward()| Method Detail |
public void add(Position position)
position - - the addendpublic void clamp()
public Position divide(int divisor)
divisor - - the divisor
public Position getClone()
public float getDistance(Position position)
position - - the position
public javax.vecmath.Vector3d getVector()
public boolean isEqual(Position position,
float tolerance)
position - - the position to checktolerance - - the proximity tolerance for comparison
public void moveBackward()
public void moveDown()
public void moveForward()
public void moveLeft()
public void moveRight()
public void moveUp()
public void normalize()
public void reset()
public void set(Position position)
position - - the position
public void set(float x,
float y,
float z)
x - - the x componenty - - the y componentz - - the z componentpublic void subtract(Position position)
position - - the subtrahendpublic void wrap()
public java.lang.String toString()
toString in class java.lang.ObjectSupport.toPrettyString(java.lang.String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||