|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmathematik.Vector3f
public class Vector3f
| Field Summary | |
|---|---|
static int |
COMPARE_TYPE
|
static int |
LENGTH
|
float |
x
The x coordinate of the vector |
static int |
X
|
float |
y
The y coordinate of the vector |
static int |
Y
|
float |
z
The z coordinate of the vector |
static int |
Z
|
| Constructor Summary | |
|---|---|
Vector3f()
Initializes a new vector. |
|
Vector3f(double[] theVector)
|
|
Vector3f(double theX,
double theY)
|
|
Vector3f(double theX,
double theY,
double theZ)
|
|
Vector3f(float[] theVector)
|
|
Vector3f(float theX,
float theY)
|
|
Vector3f(float theX,
float theY,
float theZ)
Creates a new vector with the given coordinates. |
|
Vector3f(int[] theVector)
|
|
Vector3f(java.lang.String theVector)
|
|
Vector3f(Vector2f theVector)
|
|
Vector3f(Vector2i theVector)
|
|
Vector3f(Vector3f theVector)
|
|
Vector3f(Vector3i theVector)
|
|
| Method Summary | |
|---|---|
void |
add(float theX,
float theY)
|
void |
add(float theX,
float theY,
float theZ)
|
void |
add(Vector3f theVector)
|
void |
add(Vector3f theVectorA,
Vector3f theVectorB)
|
boolean |
almost(Vector3f theVector)
|
float |
angle(Vector3f theVector)
|
java.lang.Object |
clone()
|
int |
compareTo(Vector3f theVector3f)
|
Vector3f |
cross(Vector3f theVector)
Returns the cross product of two vectors. |
void |
cross(Vector3f theVectorA,
Vector3f theVectorB)
Sets this vector to the cross product of two given vectors. |
float |
distance(Vector3f thePoint)
|
float |
distanceL1(Vector3f thePoint)
|
float |
distanceSquared(Vector3f thePoint)
|
void |
divide(float theDivisor)
Dividing is nearly the the same as scaling, except |
void |
divide(Vector3f theVector)
|
float |
dot(Vector3f theVector)
Returns the dot product of two vectors. |
boolean |
equals(java.lang.Object theVector)
|
boolean |
equals(Vector3f theVector)
|
void |
interpolate(float blend,
Vector3f i_vector)
Interpolates between this vector and the given vector by a given blend value. |
boolean |
isNaN()
|
float |
length()
Use this method to calculate the length of a vector, the length of a vector is also known as its magnitude. |
float |
lengthSquared()
|
float |
magnitude()
|
void |
max(float theX,
float theY,
float theZ)
|
void |
max(Vector3f theMax)
|
void |
min(float theX,
float theY,
float theZ)
|
void |
min(Vector3f theMin)
|
void |
negate()
Use this method to negate a vector. |
void |
normalize()
Norms the vector to the length of 1 |
void |
normalize(Vector3f theVector)
Sets the vector to the given one and norms it to the length of 1 |
void |
randomize()
Sets a position randomly distributed inside a sphere of unit radius centered at the origin. |
void |
scale(float theScalar)
Use this method to scale a vector. |
void |
scale(float theX,
float theY,
float theZ)
|
void |
scale(float theScalar,
Vector3f theVector)
|
void |
scale(Vector3f theVector)
|
void |
set(double[] theVector)
|
void |
set(double theX,
double theY)
|
void |
set(double theX,
double theY,
double theZ)
|
void |
set(float[] theVector)
|
void |
set(float theX,
float theY)
|
void |
set(float theX,
float theY,
float theZ)
|
void |
set(int[] theVector)
|
void |
set(java.lang.String theVectorString)
|
void |
set(Vector2f theVector)
|
void |
set(Vector2i theVector)
|
void |
set(Vector3f theVector)
|
void |
set(Vector3i theVector)
|
void |
sub(Vector3f theVector)
|
void |
sub(Vector3f theVectorA,
Vector3f theVectorB)
|
float[] |
toArray()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public float x
public float y
public float z
public static final int X
public static final int Y
public static final int Z
public static final int LENGTH
public static int COMPARE_TYPE
| Constructor Detail |
|---|
public Vector3f()
public Vector3f(float theX,
float theY,
float theZ)
theX - int, float or double: x coord of the new vectortheY - int, float or double: y coord of the new vectortheZ - int, float or double: z coord of the new vector
public Vector3f(double theX,
double theY,
double theZ)
public Vector3f(float theX,
float theY)
public Vector3f(double theX,
double theY)
public Vector3f(float[] theVector)
public Vector3f(double[] theVector)
public Vector3f(int[] theVector)
public Vector3f(Vector3f theVector)
public Vector3f(Vector2f theVector)
public Vector3f(Vector3i theVector)
public Vector3f(Vector2i theVector)
public Vector3f(java.lang.String theVector)
| Method Detail |
|---|
public final void set(float theX,
float theY,
float theZ)
public final void set(double theX,
double theY,
double theZ)
public final void set(float theX,
float theY)
public final void set(double theX,
double theY)
public final void set(float[] theVector)
public final void set(double[] theVector)
public final void set(int[] theVector)
public final void set(Vector3f theVector)
public final void set(Vector2f theVector)
public final void set(Vector3i theVector)
public final void set(Vector2i theVector)
public final void set(java.lang.String theVectorString)
public final void add(Vector3f theVectorA,
Vector3f theVectorB)
public final void add(Vector3f theVector)
public final void add(float theX,
float theY)
public final void add(float theX,
float theY,
float theZ)
public final void sub(Vector3f theVectorA,
Vector3f theVectorB)
public final void sub(Vector3f theVector)
public final void negate()
public final void scale(float theScalar)
theScalar - float or int: the value the vector is scaled withpublic final void scale(Vector3f theVector)
theVector - Vector3f: vector with the value each coord is scaled with
public final void scale(float theX,
float theY,
float theZ)
theX - floattheY - floattheZ - float
public final void scale(float theScalar,
Vector3f theVector)
theScalar - float or int: value the given vector is scaled withtheVector - Vector3f: vector the vector is set topublic final void divide(float theDivisor)
theDivisor - public final void divide(Vector3f theVector)
public final float lengthSquared()
public final float length()
public final float magnitude()
public final void cross(Vector3f theVectorA,
Vector3f theVectorB)
theVectorA - theVectorB - public Vector3f cross(Vector3f theVector)
i_vector - the other vector
public final float dot(Vector3f theVector)
theVector, - the other vector
public final void normalize(Vector3f theVector)
public final void normalize()
public void interpolate(float blend,
Vector3f i_vector)
blend - float, blend value for interpolationi_vector - Vector3f, other vector for interpolationpublic void randomize()
public final float angle(Vector3f theVector)
public final float distanceSquared(Vector3f thePoint)
public final float distance(Vector3f thePoint)
public final float distanceL1(Vector3f thePoint)
public final void min(Vector3f theMin)
public final void min(float theX,
float theY,
float theZ)
public final void max(Vector3f theMax)
public final void max(float theX,
float theY,
float theZ)
public final float[] toArray()
public final boolean isNaN()
public final boolean equals(Vector3f theVector)
public final boolean equals(java.lang.Object theVector)
equals in class java.lang.Objectpublic final boolean almost(Vector3f theVector)
public java.lang.Object clone()
clone in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(Vector3f theVector3f)
compareTo in interface java.lang.Comparable<Vector3f>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||