public class Vector3f extends Object implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
locked |
static Vector3f |
ONE
Unit Vector (1/1/1)
|
static Vector3f |
UNIT_X
Unit Vector of X (1/0/0)
|
static Vector3f |
UNIT_Y
Unit Vector of Y (0/1/0)
|
static Vector3f |
UNIT_Z
Unit Vector of Z (0/0/1)
|
static Vector3f |
ZERO
Zero Vector (0/0/0)
|
| Constructor and Description |
|---|
Vector3f(float x,
float y,
float z)
Construct a new Vector
|
Vector3f(Vector3f v)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
abs()
Returns the absolute version of this Vector
|
Vector3f |
add(float v)
Add constant to Vector
|
Vector3f |
add(Vector3f v)
Add two Vectors
|
Vector3f |
addLocal(float v)
Add constant to THIS Vector
|
Vector3f |
addLocal(Vector3f v)
Add Vector to THIS Vector
|
Vector3f |
clamp(float c)
Returns clamped version of this vector
|
Vector3f |
clampLocal(float c)
Clamp all components to the constant c.
|
Vector3f |
clone() |
Vector3f |
cross(Vector3f v)
Cross Product
|
static float |
distance(Vector3f p,
Vector3f q)
Calculates the euclidean distance.
|
Vector3f |
div(float v) |
Vector3f |
div(Vector3f v) |
float |
dot(Vector3f v)
Dot Product
|
boolean |
equals(Object obj) |
boolean |
equals(Vector3f v) |
float |
euclidean(Vector3f v)
Calculates the euclidean distance.
|
Vector3f |
get()
Copy components into new Vector object
|
Vector2f |
getXY() |
Vector2f |
getXZ() |
Vector2f |
getYX() |
Vector2f |
getYZ() |
Vector2f |
getZX() |
Vector2f |
getZY() |
boolean |
isLocked() |
boolean |
isNullVector()
Returns true when all 3 components are 0
|
float |
length()
Calculates length a.k.a. magnitude
|
Vector3f |
lerp(Vector3f dest,
float factor)
Linearly interpolates between two Vectors.
|
static Vector3f |
lerp(Vector3f p,
Vector3f q,
float factor)
Linearly interpolates between two Vectors.
|
Vector3f |
lock() |
float |
max()
Returns the largest component of this Vector
|
Vector3f |
mul(float v) |
Vector3f |
mul(Vector3f v) |
Vector3f |
multLocal(float v) |
Vector3f |
multLocal(Vector3f v) |
void |
normalize()
Normalizes this object
|
Vector3f |
normalized()
Returns normalized version of this
Vector.
|
Vector3f |
rotate(Quaternion q)
Returns Vector of this rotated by using thw Quaternion
|
Vector3f |
rotate(Vector3f axis,
float angle)
Returns Vector of this rotated around the given axis by angle amount.
|
Vector3f |
set(float x,
float y,
float z) |
Vector3f |
set(Vector3f v) |
void |
setX(float x) |
void |
setY(float y) |
void |
setZ(float z) |
Vector3f |
sub(float v)
Subtract constant from Vector
|
Vector3f |
sub(Vector3f v)
Subtract two Vectors
|
Vector3f |
subLocal(float v)
Subtract constant from THIS Vector
|
Vector3f |
subLocal(Vector3f v)
Subtract Vector from THIS Vector
|
String |
toString() |
Vector3f |
unlock() |
public static final Vector3f ZERO
public static final Vector3f UNIT_X
public static final Vector3f UNIT_Y
public static final Vector3f UNIT_Z
public static final Vector3f ONE
protected boolean locked
public Vector3f(float x,
float y,
float z)
x - X-Componenty - Y-Componentz - Z-Componentpublic Vector3f(Vector3f v)
v - copypublic static float distance(Vector3f p, Vector3f q)
p.euclidean(q);p - First Vectorq - Second Vectorpublic static Vector3f lerp(Vector3f p, Vector3f q, float factor)
p.lerp(q, factor);p - First Vectorq - Second Vectorfactor - Interpolation factorpublic Vector3f lock()
public Vector3f unlock()
public boolean isLocked()
public float euclidean(Vector3f v)
v - destinationpublic float length()
public float dot(Vector3f v)
v - otherpublic void normalize()
public Vector3f normalized()
normalize() for this!public Vector3f lerp(Vector3f dest, float factor)
dest - Destination Vectorfactor - Interpolation factorpublic Vector3f rotate(Vector3f axis, float angle)
axis - Rotation Axisangle - angle in radians!public Vector3f rotate(Quaternion q)
q - Quaternion to rotate.public float max()
public Vector3f add(Vector3f v)
v - otherpublic Vector3f add(float v)
v - constantpublic Vector3f addLocal(Vector3f v)
v - otherpublic Vector3f addLocal(float v)
v - constantpublic Vector3f sub(Vector3f v)
v - otherpublic Vector3f sub(float v)
v - constantpublic Vector3f subLocal(Vector3f v)
v - otherpublic Vector3f subLocal(float v)
v - constantpublic Vector3f mul(float v)
public Vector3f multLocal(float v)
public Vector3f div(float v)
public Vector3f abs()
public Vector3f clamp(float c)
c - constantclampLocal(float)public Vector3f clampLocal(float c)
COMPONENT > c
-4 will stay the same if clamped to 3!c - constantpublic Vector2f getXY()
public Vector2f getYZ()
public Vector2f getXZ()
public Vector2f getYX()
public Vector2f getZY()
public Vector2f getZX()
public Vector3f set(float x, float y, float z)
public void setX(float x)
public void setY(float y)
public void setZ(float z)
public boolean equals(Vector3f v)
public boolean isNullVector()
public Vector3f get()
public Vector3f clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2014. All rights reserved.