|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFacemorph.Vector3
public class Vector3
Simple 3D vector class
Field Summary | |
---|---|
float |
x
x coord |
float |
y
y coord |
float |
z
z coord |
Constructor Summary | |
---|---|
Vector3()
Construct a zero Vector3D |
|
Vector3(float a,
float b,
float c)
Construct a full Vector 3D |
|
Vector3(Vector3 p)
Construct a zero Vector3D |
Method Summary | |
---|---|
void |
add(Vector3 p)
|
Vector3 |
crossProduct(Vector3 v1)
Returns the cross (vector) product of this vector with v1 |
float |
distance(Vector3 p)
|
float |
distanceSquared(Vector3 p)
|
float |
magnitude()
returns the magnitude of this vector |
boolean |
normalise()
Normalises this vector to have magnitude 1 |
float |
scalarProduct(Vector3 v1)
returns the scalar (dot) product of this vector with v1 |
void |
scale(float s)
|
void |
set(float i,
float j,
float k)
Set the value of this Vector3D |
void |
sub(Vector3 p)
|
Vector3 |
transform(Matrix3 mat)
Transform this vector using the matrix given |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float x
public float y
public float z
Constructor Detail |
---|
public Vector3()
public Vector3(Vector3 p)
public Vector3(float a, float b, float c)
a
- x coordb
- y coordc
- z coordMethod Detail |
---|
public void set(float i, float j, float k)
i
- the new x valuej
- the new y valuek
- the new z valuepublic Vector3 transform(Matrix3 mat)
mat
- The matrix to transform this with
public void add(Vector3 p)
public void scale(float s)
public float distanceSquared(Vector3 p)
public float distance(Vector3 p)
public void sub(Vector3 p)
public Vector3 crossProduct(Vector3 v1)
v1
- The vector to cross with
public boolean normalise()
public float magnitude()
public float scalarProduct(Vector3 v1)
v1
- The vector to dot with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |