|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.util.Real
net.java.dev.joode.util.Vector3
public class Vector3
| Field Summary |
|---|
| Fields inherited from class net.java.dev.joode.util.Real |
|---|
m |
| Constructor Summary | |
|---|---|
Vector3()
creates a new Vector3 at (0|0|0); use aquire instance instead for reduced garbage (and return the instance afterwards) |
|
Vector3(float x,
float y,
float z)
creates a new Vector3 at (i|j|k) |
|
Vector3(Real r)
creates a new Vector3 by copying all the values from r. |
|
Vector3(Vector3 v)
creates a new Vector3 by copying all the values from v. |
|
| Method Summary | |
|---|---|
void |
add(float x,
float y,
float z)
|
Vector3 |
add(Vector3 v,
Vector3 result)
|
static Vector3 |
aquireDirtyInstance()
returns a Vector3. |
static Vector3 |
aquireInstance()
returns a zeroed Vector3. |
static Vector3 |
aquireInstance(float x,
float y,
float z)
returns an initialized Vector3. |
static Vector3 |
aquireInstance(Real values)
returns a Vector3 initialized to the first three parameters of the passed in Real. |
static Vector3 |
aquireInstance(Vector3 values)
returns a Vector3 initialized to the first three parameters of the passed in vector3. |
void |
bar(Matrix3 result)
if this is a returns abar such that abar * b = a cross b
abar = [0 -a3 a2
a3 0 -a1
-a2 a1 0 ]
as refered to in the ODE joint documentation
"A cross product between two vectors in 3d space can be
rewritten in terms of pure matrix multiplication
as the product of a Skew-symmetric matrix and a vector" from Wikipedia |
void |
constructPlaneSpace(Vector3 p,
Vector3 q)
given a unit length "normal" vector n, generate vectors p and q vectors that are an orthonormal basis for the plane space perpendicular to n. |
float |
cosAngle(Vector3 other)
this = a other = b computes the cos of the angle between the two vectors: cos(theta) = a.dot(b)/(|a||b|) |
Vector3 |
cross(Vector3 v)
does not modify this, creates a new vector and returns it |
void |
cross(Vector3 v,
RealPointer result)
|
Vector3 |
cross(Vector3 v,
Vector3 result)
garbageless cross product of this X v = result result is overwitten |
float |
dist(Vector3 o)
calculates the distance of this Vector and o. |
float |
dist2D(Vector3 o)
Calculates a distance without using the z information |
float |
distSquared(Vector3 o)
calculates the squared distance of this Vector and o. |
static boolean |
epsilonEquals(Vector3 a,
Vector3 b,
float e)
tests if two vectors are equal to within the given tolerance |
float |
getX()
|
float |
getY()
|
float |
getZ()
|
float |
max()
returns the maximum value among the components |
float |
mean()
|
float |
min()
returns the minumum value among the components |
float |
norm()
|
static float |
planePlaneAngle(Real normal1,
Real normal2)
returns the angle between a plane and another plane n1.n2=|n1||n2|cos(theta) note this function assumes the input normals ARE nomalized (works with hyperplanes) |
static float |
planePlaneCosAngle(Vector3 normal1,
Vector3 normal2)
|
static float |
planeVectorAngle(Vector3 planeNormal,
Vector3 line)
returns the angle between a plane and a line from:- n.b=|n||b|sin(theta) |
static Vector3 |
randomVector()
returns a random vector with components uniformly distruted between 0-1 |
static void |
releaseInstance(Vector3 instance)
releases the instance of the Vector3 back into an object pool. |
void |
set(float x,
float y,
float z)
|
void |
set(Vector3 v)
|
void |
setX(float x)
|
void |
setY(float y)
|
void |
setZ(float z)
|
void |
sub(float x,
float y,
float z)
|
java.lang.String |
toString()
|
float |
var()
|
| Methods inherited from class net.java.dev.joode.util.Real |
|---|
add, aquireDirtyInstance, aquireInstance, dot, dot, epsilonEquals, epsilonEquals, fill, get, length, lengthSquared, normalize, releaseInstance, scale, set, set, setZero, size, sub |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vector3()
public Vector3(float x,
float y,
float z)
x - the x coordinatey - the y coordinatez - the z coordinate
use aquire instance instead for reduced garbage (and return the instance afterwards)public Vector3(Vector3 v)
v - the Vector to clone.public Vector3(Real r)
r - the real to clone.
use aquire instance instead for reduced garbage (and return the instance afterwards)| Method Detail |
|---|
public static Vector3 aquireInstance(float x,
float y,
float z)
public static Vector3 aquireDirtyInstance()
public static Vector3 aquireInstance()
public static Vector3 aquireInstance(Vector3 values)
public static Vector3 aquireInstance(Real values)
public static void releaseInstance(Vector3 instance)
instance - public float getX()
public float getY()
public float getZ()
public void set(float x,
float y,
float z)
public void set(Vector3 v)
public void setX(float x)
public void setY(float y)
public void setZ(float z)
public void add(float x,
float y,
float z)
public Vector3 add(Vector3 v,
Vector3 result)
public void sub(float x,
float y,
float z)
public Vector3 cross(Vector3 v)
v -
public Vector3 cross(Vector3 v,
Vector3 result)
v - result -
public void cross(Vector3 v,
RealPointer result)
public float cosAngle(Vector3 other)
public void bar(Matrix3 result)
abar = [0 -a3 a2
a3 0 -a1
-a2 a1 0 ]
as refered to in the ODE joint documentation
"A cross product between two vectors in 3d space can be
rewritten in terms of pure matrix multiplication
as the product of a Skew-symmetric matrix and a vector" from Wikipedia
result - public float dist(Vector3 o)
o - the Vector3, to calculate the distance to.
public float dist2D(Vector3 o)
public float distSquared(Vector3 o)
dist(Vector3), so it should be used,
if distances get only compared.
o - the Vector3, to calculate the distance to.
public float norm()
norm in class Realpublic float min()
min in class Realpublic float max()
max in class Realpublic float mean()
public float var()
public void constructPlaneSpace(Vector3 p,
Vector3 q)
public static float planeVectorAngle(Vector3 planeNormal,
Vector3 line)
planeNormal - line -
public static float planePlaneAngle(Real normal1,
Real normal2)
public static float planePlaneCosAngle(Vector3 normal1,
Vector3 normal2)
public java.lang.String toString()
toString in class Realpublic static Vector3 randomVector()
public static boolean epsilonEquals(Vector3 a,
Vector3 b,
float e)
e - tolerance in equality
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||