Class Vector4f
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.Vector4f
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Vector4f>
public class Vector4f extends java.lang.Object implements java.lang.Comparable<Vector4f>, java.io.Serializable
3D Vector object (X,Y,Z,W).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Vector4f
ONE
One vector: (1,1,1,1)private static long
serialVersionUID
static Vector4f
UNIT_W
Unit-W vector: (0,0,0,1)static Vector4f
UNIT_X
Unit-X vector: (1,0,0,0)static Vector4f
UNIT_Y
Unit-Y vector: (0,1,0,0)static Vector4f
UNIT_Z
Unit-Z vector: (0,0,1,0)float
W
float
X
Vector data:float
Y
float
Z
static Vector4f
ZERO
Zero vector: (0,0,0,0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Vector4f
add(Vector4f rkV)
Add the input vector to this: this = this + rkVstatic Vector4f
add(Vector4f rkV1, Vector4f rkV2)
Add the two input vectors, setting this: this = rkV1 + rkV2int
compare(Vector4f arg0, Vector4f arg1)
Sorting a list of Vector3f in order, where each element is a column when two Vector3f have equal X then the sort is by Y, then by Z.int
compareTo(Vector4f v)
Vector4f
copy(Vector4f rkV)
Set the values of this vector.void
Copy(Vector4f rkV)
Deprecated.float
dot(Vector4f rkV)
Compute dot-product of this vector with input vector:float
Dot(Vector4f rkV)
Deprecated.boolean
equals(java.lang.Object kObject)
Vector3f
getVector3()
int
hashCode()
boolean
isEqual(Vector4f rkV)
Return true if the input Vector4f is equal to this.boolean
IsEqual(Vector4f rkV)
Deprecated.float
length()
Compute length this vector:float
Length()
Deprecated.Vector4f
neg(Vector4f kV)
Negate this vector: this = - this.void
Neg(Vector4f kV)
Deprecated.float
normalize()
Normalize this vector, return original length:float
Normalize()
Deprecated.Vector4f
scale(float fScalar)
Scale this vector by input: this = this * fScalar.static Vector4f
scale(float fScalar, Vector4f rkV)
void
Scale(float fScalar)
Deprecated.Vector4f
set(float fX, float fY, float fZ, float fW)
Set the values of this vector.void
Set(float fX, float fY, float fZ, float fW)
Deprecated.float
squaredLength()
Compute squared-length this vector:float
SquaredLength()
Deprecated.float
sum()
Sum the elements of the vector.float
Sum()
Deprecated.java.lang.String
toString()
Returns a string representation of the vector values.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ZERO
public static final Vector4f ZERO
Zero vector: (0,0,0,0)
-
UNIT_X
public static final Vector4f UNIT_X
Unit-X vector: (1,0,0,0)
-
UNIT_Y
public static final Vector4f UNIT_Y
Unit-Y vector: (0,1,0,0)
-
UNIT_Z
public static final Vector4f UNIT_Z
Unit-Z vector: (0,0,1,0)
-
UNIT_W
public static final Vector4f UNIT_W
Unit-W vector: (0,0,0,1)
-
ONE
public static final Vector4f ONE
One vector: (1,1,1,1)
-
X
public float X
Vector data:
-
Y
public float Y
-
Z
public float Z
-
W
public float W
-
-
Constructor Detail
-
Vector4f
public Vector4f()
construction, initialized to 0,0,0,0
-
Vector4f
public Vector4f(float fX, float fY, float fZ, float fW)
construction- Parameters:
fX
- x-valuefY
- y-valuefZ
- z-valuefW
- w-value
-
Vector4f
public Vector4f(float[] afTuple)
construction- Parameters:
afTuple
- x,y,z,w values
-
Vector4f
public Vector4f(Vector4f rkV)
copy construction- Parameters:
rkV
- vector to copy.
-
-
Method Detail
-
Copy
public void Copy(Vector4f rkV)
Deprecated.Set the values of this vector.- Parameters:
rkV
- vector to copy.
-
copy
public Vector4f copy(Vector4f rkV)
Set the values of this vector.- Parameters:
rkV
- vector to copy.
-
Dot
public float Dot(Vector4f rkV)
Deprecated.Compute dot-product of this vector with input vector:- Returns:
- dot-product of this vector with input vector:
-
dot
public float dot(Vector4f rkV)
Compute dot-product of this vector with input vector:- Returns:
- dot-product of this vector with input vector:
-
equals
public boolean equals(java.lang.Object kObject)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
IsEqual
public boolean IsEqual(Vector4f rkV)
Deprecated.Return true if the input Vector4f is equal to this.- Parameters:
rkV
- input vector to compare to this- Returns:
- true if the input Vector4f is equal to this, false otherwise.
-
isEqual
public boolean isEqual(Vector4f rkV)
Return true if the input Vector4f is equal to this.- Parameters:
rkV
- input vector to compare to this- Returns:
- true if the input Vector4f is equal to this, false otherwise.
-
Length
public float Length()
Deprecated.Compute length this vector:- Returns:
- length this vector
-
length
public float length()
Compute length this vector:- Returns:
- length this vector
-
Neg
public void Neg(Vector4f kV)
Deprecated.Negate this vector: this = - this.
-
Normalize
public float Normalize()
Deprecated.Normalize this vector, return original length:- Returns:
- original length:
-
normalize
public float normalize()
Normalize this vector, return original length:- Returns:
- original length:
-
Scale
public void Scale(float fScalar)
Deprecated.Scale this vector by input: this = this * fScalar.- Parameters:
fScalar
- scale value
-
scale
public Vector4f scale(float fScalar)
Scale this vector by input: this = this * fScalar.- Parameters:
fScalar
- scale value
-
Set
public void Set(float fX, float fY, float fZ, float fW)
Deprecated.Set the values of this vector.- Parameters:
fX
- x-valuefY
- y-valuefZ
- z-valuefW
- w-value
-
set
public Vector4f set(float fX, float fY, float fZ, float fW)
Set the values of this vector.- Parameters:
fX
- x-valuefY
- y-valuefZ
- z-valuefW
- w-value
-
SquaredLength
public float SquaredLength()
Deprecated.Compute squared-length this vector:- Returns:
- squared-length this vector
-
squaredLength
public float squaredLength()
Compute squared-length this vector:- Returns:
- squared-length this vector
-
Sum
public float Sum()
Deprecated.Sum the elements of the vector.- Returns:
- vector sum
-
sum
public float sum()
Sum the elements of the vector.- Returns:
- vector sum
-
toString
public java.lang.String toString()
Returns a string representation of the vector values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- string representation of the vector values.
-
getVector3
public Vector3f getVector3()
-
add
public Vector4f add(Vector4f rkV)
Add the input vector to this: this = this + rkV- Parameters:
rkV
-- Returns:
- this
-
add
public static Vector4f add(Vector4f rkV1, Vector4f rkV2)
Add the two input vectors, setting this: this = rkV1 + rkV2- Parameters:
rkV1
- first input vectorrkV2
- second input vector
-
compare
public int compare(Vector4f arg0, Vector4f arg1)
Sorting a list of Vector3f in order, where each element is a column when two Vector3f have equal X then the sort is by Y, then by Z.- Parameters:
arg0
-arg1
-- Returns:
-
-