|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.speckled.specksim.SpeckPosition
public class SpeckPosition
Encapsulates the position and orientation of a speck.
| Nested Class Summary | |
|---|---|
static class |
SpeckPosition.Configurator
A useful configurator for manipulating a SpeckPosition. |
| Field Summary | |
|---|---|
com.ryanm.util.geom.Orientation |
orientation
The orientation of the speck |
Point3d |
position
The position of the speck |
| Constructor Summary | |
|---|---|
SpeckPosition()
Standard constructor |
|
SpeckPosition(java.io.DataInputStream dis)
Constructs a new SpeckPosition from the values read from
the stream |
|
SpeckPosition(SpeckPosition sp)
Copies the supplied SpeckPosition |
|
| Method Summary | |
|---|---|
static SpeckPosition |
add(SpeckPosition so1,
SpeckPosition so2)
Adds two SpeckOrientations. |
void |
encode(java.io.DataOutputStream dos)
Encodes the values of the SpeckPosition to the supplied
stream |
boolean |
epsilonEquals(SpeckPosition p,
double delta)
Determines if this SpeckPosition is the same as another,
within a defined tolerance |
boolean |
equals(java.lang.Object o)
|
Matrix4d |
getTransform()
Calculates the transform that will take us from the origin, facing down the z-axis, to the orientation of this object |
boolean |
isZero()
Determines if this SpeckPosition has the zero vector for
position and zero as all rotation angles. |
static void |
main(java.lang.String[] args)
Tests addition and subtraction |
void |
set(SpeckPosition sp)
Sets the values of this SpeckPosition to copy those of the supplied SpeckPosition |
static SpeckPosition |
subtract(SpeckPosition a,
SpeckPosition b)
Subtracts two SpeckOrientations. |
java.lang.String |
toString()
|
void |
transform(Matrix4d m)
Transforms this SpeckPosition by the supplied matrix |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Point3d position
public com.ryanm.util.geom.Orientation orientation
| Constructor Detail |
|---|
public SpeckPosition()
public SpeckPosition(SpeckPosition sp)
sp - The speckPosition to copy
public SpeckPosition(java.io.DataInputStream dis)
throws java.io.IOException
SpeckPosition from the values read from
the stream
dis - the stream to read from
java.io.IOException| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - public Matrix4d getTransform()
public void transform(Matrix4d m)
SpeckPosition by the supplied matrix
m - The transformation matrix
public static SpeckPosition add(SpeckPosition so1,
SpeckPosition so2)
so1 - The first orientationso2 - The second orientation
public static SpeckPosition subtract(SpeckPosition a,
SpeckPosition b)
a - The first orientationb - The second orientation
public void set(SpeckPosition sp)
sp - The values to copy.public boolean isZero()
SpeckPosition has the zero vector for
position and zero as all rotation angles. Can help avoid doing
costly transforms.
true if every component of the position
is zero and every rotation angle is zero,
false otherwise.public java.lang.String toString()
toString in class java.lang.Object
public void encode(java.io.DataOutputStream dos)
throws java.io.IOException
SpeckPosition to the supplied
stream
dos - the stream to write to
java.io.IOException - If something goes wrongpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
public boolean epsilonEquals(SpeckPosition p,
double delta)
SpeckPosition is the same as another,
within a defined tolerance
p - The SpeckPosition to test againstdelta - The maximum distance between the two
SpeckPosition's positions, up and forward
vectors
true if sufficiently similar,
false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||