public class OrientationFull3D extends java.lang.Object implements IOrientationFull3D, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected IVectorMutable |
direction |
protected Tensor3D |
rotationTensor |
protected IVectorMutable |
secondaryDirection |
protected IVectorMutable |
v2 |
protected IVectorMutable |
v3 |
Constructor and Description |
---|
OrientationFull3D(ISpace space)
Default constructor sets orientation to point in the X direction.
|
Modifier and Type | Method and Description |
---|---|
void |
E(IOrientation o)
Copies the given orientation to this one.
|
IVector |
getDirection()
Returns a unit vector pointing in the orientation's direction.
|
IVector |
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,
IVector axis)
Rotates orientation by the given value about the given axis.
|
void |
setDirection(IVector newDirection)
Sets this orientation to point in the given direction.
|
void |
setDirections(IVector newPrimaryDirection,
IVector newSecondaryDirection)
Sets the orientation's primary and secondary direction to be the given
directions.
|
protected final IVectorMutable direction
protected final IVectorMutable secondaryDirection
protected final IVectorMutable v2
protected final IVectorMutable v3
protected final Tensor3D rotationTensor
public OrientationFull3D(ISpace space)
public void E(IOrientation o)
IOrientation
E
in interface IOrientation
public IVector getDirection()
IOrientation
getDirection
in interface IOrientation
public IVector getSecondaryDirection()
IOrientationFull3D
getSecondaryDirection
in interface IOrientationFull3D
public void setDirection(IVector newDirection)
setDirection
in interface IOrientation
an
- exception if vector has 0 lengthpublic void setDirections(IVector newPrimaryDirection, IVector newSecondaryDirection)
IOrientationFull3D
setDirections
in interface IOrientationFull3D
public void rotateBy(double dt, IVector axis)
rotateBy
in interface IOrientation3D
public void randomRotation(IRandom random, double tStep)
randomRotation
in interface IOrientation
public void relax()