|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectEigenMeat.EigenMaze.Vect3d
XYZ Vector class.
| Field Summary | |
float |
x
|
float |
y
|
float |
z
|
| Constructor Summary | |
Vect3d()
Default constructor for Vect3d. |
|
Vect3d(double x,
double y,
double z)
Constructor. |
|
Vect3d(float x,
float y,
float z)
Constructor. |
|
Vect3d(Vect3d v)
Copy constructor that allows you to copy another Vect3d object. |
|
| Method Summary | |
void |
add(Vect3d add)
Add a vector. |
void |
addm(Vect3d vector,
float scalar)
Helper function that multiplies a vector by a scalar before using it for addition. |
Vect3d |
cross(Vect3d v)
Performs a cross product operation. |
void |
div(float scalar)
Divide vector by a scalar. |
float |
dot(Vect3d v)
Performs a dot product operation on the vector. |
boolean |
equals(Vect3d rhs)
|
float |
getAngle(Vect3d v)
Gets the angle between 2 vectors. |
float[] |
getArray()
|
static void |
getBounceVect(Vect3d vel,
Vect3d normal,
Vect3d result)
Get the resulting vector after a bounce against a plane. |
static Vect3d |
getClosestPointOnLine(Vect3d a,
Vect3d b,
Vect3d p)
Get the closest point on the line between it and another point. |
float |
getDistance(Vect3d point)
|
static float |
getDistanceBetweenPoints(Vect3d a,
Vect3d b)
Get the distance between two points. |
float |
getX()
Accessor method for X coordinate. |
float |
getY()
Accessor method for Y coordinate. |
float |
getZ()
Accessor method for Z coordinate. |
void |
invert()
Inverts the vector. |
float |
length()
Returns the vector length. |
void |
mult(float scalar)
Multiply vector by a scalar. |
void |
mult(float scalar,
Vect3d result)
Multiply vector by a scalar and store the result in another vector. |
void |
normalize()
Normalize the vector. |
void |
rotateY(float angle)
Rotate vector around the Y Axis by an angle. |
void |
set(float x,
float y,
float z)
Set method for XYZ coordinate. |
void |
set(Vect3d v)
Sets XYZ coordinates using another Vect3d object. |
void |
sub(Vect3d s)
Subtract the vector by another vector |
void |
sub(Vect3d s,
Vect3d result)
Subtract by a vector and store the results in another vector. |
void |
subm(Vect3d vector,
float scalar)
Helper function that multiplies a vector by a scalar before using it for subtraction |
java.lang.String |
toString()
Method used to print the vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public float x
public float y
public float z
| Constructor Detail |
public Vect3d()
public Vect3d(float x,
float y,
float z)
x - x coordinatey - y coordinatez - z coordinate
public Vect3d(double x,
double y,
double z)
x - x coordinatey - y coordinatez - z coordinatepublic Vect3d(Vect3d v)
v - Vect3d object to copy.| Method Detail |
public float getX()
public float getY()
public float getZ()
public void set(float x,
float y,
float z)
x - x coordinatey - y coordinatez - z coordinatepublic void set(Vect3d v)
v - Vect3d object to copypublic void invert()
public float length()
public void normalize()
public float dot(Vect3d v)
v - The second vector to use for dot product operation
public Vect3d cross(Vect3d v)
v - The second Vect3d object to use for the cross product.
public float getAngle(Vect3d v)
v - The second vector
public void mult(float scalar)
scalar - The number to multiply the vector with.public void div(float scalar)
scalar - The number to divide the vector with.
public void mult(float scalar,
Vect3d result)
scalar - The number to multiply the vector with.result - The vector the result is stored in.public void sub(Vect3d s)
s - The vector used to subtract with.
public void sub(Vect3d s,
Vect3d result)
s - The vector used to subtract with.result - The vector the results are stored in.public void add(Vect3d add)
add - The vector used for addition.
public void addm(Vect3d vector,
float scalar)
vector - the Vector used for additionscalar - scalar number to multiply vector before adding with it
public void subm(Vect3d vector,
float scalar)
vector - vector to use for subtractionscalar - the number to multiply the vectorpublic void rotateY(float angle)
angle - The angle to rotate the vectorpublic boolean equals(Vect3d rhs)
public float getDistance(Vect3d point)
public float[] getArray()
public java.lang.String toString()
public static void getBounceVect(Vect3d vel,
Vect3d normal,
Vect3d result)
vel - the initial vector before the bouncenormal - the normal of the surface to bounce the vector aroundresult - the resulting bounced vector
public static Vect3d getClosestPointOnLine(Vect3d a,
Vect3d b,
Vect3d p)
a - starting point of a lineb - end point of a linep - a point
public static float getDistanceBetweenPoints(Vect3d a,
Vect3d b)
a - first pointb - second point
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||