IOrientation, IOrientation2D, java.io.Serializablepublic class Orientation2D extends java.lang.Object implements IOrientation2D, java.io.Serializable
| Modifier and Type | Field | Description |
|---|---|---|
protected double |
angle |
|
protected Vector |
direction |
| Constructor | Description |
|---|---|
Orientation2D() |
Default constructor sets orientation angle to zero.
|
Orientation2D(Vector direction) |
Constructs with orientation as specified by the given angle theta.
|
| 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 within plus or minus tStep
from the current value.
|
void |
rotateBy(double dt) |
Rotates orientation around the given axis by the given value.
|
void |
setDirection(Vector newDirection) |
Sets this orientation to point in the given direction.
|
protected double angle
protected Vector direction
public Orientation2D()
public Orientation2D(Vector direction)
java.lang.Exception - if vector has 0 lengthpublic void E(IOrientation o)
IOrientationE in interface IOrientationo - the new orientationpublic Vector getDirection()
getDirection in interface IOrientationpublic void setDirection(Vector newDirection)
IOrientationsetDirection in interface IOrientationnewDirection - the new direction for this orientationpublic void rotateBy(double dt)
rotateBy in interface IOrientation2Dpublic 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