IOrientation, IOrientation3D, IOrientationFull3D, java.io.Serializablepublic class OrientationFull3D extends java.lang.Object implements IOrientationFull3D, java.io.Serializable
| Modifier and Type | Field | Description |
|---|---|---|
protected Vector |
direction |
|
protected Tensor3D |
rotationTensor |
|
protected Vector |
secondaryDirection |
|
protected Vector |
v2 |
|
protected Vector |
v3 |
| Constructor | Description |
|---|---|
OrientationFull3D(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() |
|
Vector |
getSecondaryDirection() |
Returns a unit vector pointing in the orientation's secondary direction.
|
void |
randomRotation(IRandom random,
double tStep) |
Applies a random rotation of angle selected uniformly from 0 to tStep.
|
void |
relax() |
Normalizes both direction and secondaryDirection
|
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.
|
void |
setDirections(Vector newPrimaryDirection,
Vector newSecondaryDirection) |
Sets the orientation's primary and secondary direction to be the given
directions.
|
protected final Vector direction
protected final Vector secondaryDirection
protected final Vector v2
protected final Vector v3
protected final Tensor3D rotationTensor
public OrientationFull3D(Space space)
public void E(IOrientation o)
IOrientationE in interface IOrientationo - the new orientationpublic Vector getDirection()
getDirection in interface IOrientationpublic Vector getSecondaryDirection()
IOrientationFull3DgetSecondaryDirection in interface IOrientationFull3Dpublic void setDirection(Vector newDirection)
setDirection in interface IOrientationnewDirection - the new direction for this orientationjava.lang.Exception - if vector has 0 lengthpublic void setDirections(Vector newPrimaryDirection, Vector newSecondaryDirection)
IOrientationFull3DsetDirections in interface IOrientationFull3Dpublic 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 rotationpublic void relax()