public class Vector3f extends Vector implements java.io.Serializable, ReadableVector3f, WritableVector3f
Constructor and Description |
---|
Vector3f()
Constructor for Vector3f.
|
Vector3f(float x,
float y,
float z)
Constructor
|
Vector3f(ReadableVector3f src)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static Vector3f |
add(Vector3f left,
Vector3f right,
Vector3f dest)
Add a vector to another vector and place the result in a destination
vector.
|
static float |
angle(Vector3f a,
Vector3f b)
Calculate the angle between two vectors, in radians
|
static Vector3f |
cross(Vector3f left,
Vector3f right,
Vector3f dest)
The cross product of two vectors.
|
static float |
dot(Vector3f left,
Vector3f right)
The dot product of two vectors is calculated as
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
|
boolean |
equals(java.lang.Object obj) |
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
|
Vector3f |
negate(Vector3f dest)
Negate a vector and place the result in a destination vector.
|
Vector3f |
normalise(Vector3f 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
|
Vector3f |
set(ReadableVector3f src)
Load from another Vector3f
|
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 Vector3f |
sub(Vector3f left,
Vector3f right,
Vector3f dest)
Subtract a vector from another vector and place the result in a destination
vector.
|
java.lang.String |
toString() |
Vector3f |
translate(float x,
float y,
float z)
Translate a vector
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
length
public Vector3f()
public Vector3f(ReadableVector3f src)
public Vector3f(float x, float y, float z)
public void set(float x, float y)
WritableVector2f
set
in interface WritableVector2f
public void set(float x, float y, float z)
WritableVector3f
set
in interface WritableVector3f
public Vector3f set(ReadableVector3f src)
src
- The source vectorpublic float lengthSquared()
lengthSquared
in interface ReadableVector
lengthSquared
in class Vector
public Vector3f translate(float x, float y, float z)
x
- The translation in xy
- the translation in ypublic static Vector3f add(Vector3f left, Vector3f right, Vector3f dest)
left
- The LHS vectorright
- The RHS vectordest
- The destination vector, or null if a new vector is to be createdpublic static Vector3f sub(Vector3f left, Vector3f right, Vector3f dest)
left
- The LHS vectorright
- The RHS vectordest
- The destination vector, or null if a new vector is to be createdpublic static Vector3f cross(Vector3f left, Vector3f right, Vector3f dest)
left
- The LHS vectorright
- The RHS vectordest
- The destination result, or null if a new vector is to be createdpublic Vector3f negate(Vector3f dest)
dest
- The destination vector or null if a new vector is to be createdpublic Vector3f normalise(Vector3f dest)
dest
- The destination vector, or null if a new vector is to be createdpublic static float dot(Vector3f left, Vector3f right)
left
- The LHS vectorright
- The RHS vectorpublic static float angle(Vector3f a, Vector3f b)
a
- A vectorb
- The other vectorpublic Vector load(java.nio.FloatBuffer buf)
Vector
public Vector store(java.nio.FloatBuffer buf)
Vector
store
in interface ReadableVector
store
in class Vector
buf
- The buffer to store it in, at the current positionpublic java.lang.String toString()
toString
in class java.lang.Object
public final float getX()
getX
in interface ReadableVector2f
public final float getY()
getY
in interface ReadableVector2f
public final void setX(float x)
setX
in interface WritableVector2f
x
- public final void setY(float y)
setY
in interface WritableVector2f
y
- public void setZ(float z)
setZ
in interface WritableVector3f
z
- public float getZ()
getZ
in interface ReadableVector3f
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.