public class Vector4f extends Vector implements java.io.Serializable, ReadableVector4f, WritableVector4f
| Constructor and Description |
|---|
Vector4f()
Constructor for Vector4f.
|
Vector4f(float x,
float y,
float z,
float w)
Constructor
|
Vector4f(ReadableVector4f src)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static Vector4f |
add(Vector4f left,
Vector4f right,
Vector4f dest)
Add a vector to another vector and place the result in a destination
vector.
|
static float |
angle(Vector4f a,
Vector4f b)
Calculate the angle between two vectors, in radians
|
static float |
dot(Vector4f left,
Vector4f right)
The dot product of two vectors is calculated as
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w
|
boolean |
equals(java.lang.Object obj) |
float |
getW() |
float |
getX() |
float |
getY() |
float |
getZ() |
float |
lengthSquared() |
Vector |
load(java.nio.FloatBuffer buf)
Load this vector from a FloatBuffer
|
Vector |
negate()
Negate a vector
|
Vector4f |
negate(Vector4f dest)
Negate a vector and place the result in a destination vector.
|
Vector4f |
normalise(Vector4f dest)
Normalise this vector and place the result in another vector.
|
Vector |
scale(float scale)
Scale this vector
|
void |
set(float x,
float y)
Set the X,Y values
|
void |
set(float x,
float y,
float z)
Set the X,Y,Z values
|
void |
set(float x,
float y,
float z,
float w)
Set the X,Y,Z,W values
|
Vector4f |
set(ReadableVector4f src)
Load from another Vector4f
|
void |
setW(float w)
Set W
|
void |
setX(float x)
Set X
|
void |
setY(float y)
Set Y
|
void |
setZ(float z)
Set Z
|
Vector |
store(java.nio.FloatBuffer buf)
Store this vector in a FloatBuffer
|
static Vector4f |
sub(Vector4f left,
Vector4f right,
Vector4f dest)
Subtract a vector from another vector and place the result in a destination
vector.
|
java.lang.String |
toString() |
Vector4f |
translate(float x,
float y,
float z,
float w)
Translate a vector
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlengthpublic Vector4f()
public Vector4f(ReadableVector4f src)
public Vector4f(float x,
float y,
float z,
float w)
public void set(float x,
float y)
WritableVector2fset in interface WritableVector2fpublic void set(float x,
float y,
float z)
WritableVector3fset in interface WritableVector3fpublic void set(float x,
float y,
float z,
float w)
WritableVector4fset in interface WritableVector4fpublic Vector4f set(ReadableVector4f src)
src - The source vectorpublic float lengthSquared()
lengthSquared in interface ReadableVectorlengthSquared in class Vectorpublic Vector4f translate(float x, float y, float z, float w)
x - The translation in xy - the translation in ypublic static Vector4f add(Vector4f left, Vector4f right, Vector4f dest)
left - The LHS vectorright - The RHS vectordest - The destination vector, or null if a new vector is to be createdpublic static Vector4f sub(Vector4f left, Vector4f right, Vector4f dest)
left - The LHS vectorright - The RHS vectordest - The destination vector, or null if a new vector is to be createdpublic Vector4f negate(Vector4f dest)
dest - The destination vector or null if a new vector is to be createdpublic Vector4f normalise(Vector4f dest)
dest - The destination vector, or null if a new vector is to be createdpublic static float dot(Vector4f left, Vector4f right)
left - The LHS vectorright - The RHS vectorpublic static float angle(Vector4f a, Vector4f b)
a - A vectorb - The other vectorpublic Vector load(java.nio.FloatBuffer buf)
Vectorpublic Vector store(java.nio.FloatBuffer buf)
Vectorstore in interface ReadableVectorstore in class Vectorbuf - The buffer to store it in, at the current positionpublic java.lang.String toString()
toString in class java.lang.Objectpublic final float getX()
getX in interface ReadableVector2fpublic final float getY()
getY in interface ReadableVector2fpublic final void setX(float x)
setX in interface WritableVector2fx - public final void setY(float y)
setY in interface WritableVector2fy - public void setZ(float z)
setZ in interface WritableVector3fz - public float getZ()
getZ in interface ReadableVector3fpublic void setW(float w)
setW in interface WritableVector4fw - public float getW()
getW in interface ReadableVector4fpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2002-2009 lwjgl.org. All Rights Reserved.