IOrientation, IOrientation3D, java.io.Serializablepublic class Orientation3D extends java.lang.Object implements IOrientation3D, java.io.Serializable
| Modifier and Type | Field | Description |
|---|---|---|
protected Vector |
direction |
|
protected Vector |
temp |
|
protected Vector |
temp2 |
| Constructor | Description |
|---|---|
Orientation3D(Space space) |
Default constructor sets orientation to point in the X direction.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
E(IOrientation o) |
Copies the given orientation to this one.
|
Vector |
getDirection() |
|
void |
randomRotation(IRandom random,
double tStep) |
Applies a random rotation of angle selected uniformly from 0 to tStep.
|
void |
rotateBy(double dt,
Vector axis) |
Rotates orientation by the given value about the given axis.
|
void |
setDirection(Vector newDirection) |
Sets this orientation to point in the given direction.
|
protected final Vector direction
protected final Vector temp
protected final Vector temp2
public Orientation3D(Space space)
public void E(IOrientation o)
IOrientationE in interface IOrientationo - the new orientationpublic Vector getDirection()
getDirection in interface IOrientationpublic void setDirection(Vector newDirection)
setDirection in interface IOrientationnewDirection - the new direction for this orientationjava.lang.Exception - if vector has 0 lengthpublic void rotateBy(double dt,
Vector axis)
rotateBy in interface IOrientation3Dpublic void randomRotation(IRandom random, double tStep)
randomRotation in interface IOrientationrandom - random number generator used to select the angletStep - the maximum angle (in radians) for random rotation