public class Vector4f
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
float |
w |
float |
x |
float |
y |
float |
z |
static Vector4f |
ZERO |
Constructor and Description |
---|
Vector4f()
Constructor for Vector4f.
|
Vector4f(float x,
float y,
float z,
float w)
Constructor
|
Vector4f(net.minecraft.util.math.vector.Vector3f src) |
Vector4f(Vector4f 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
|
Vector4f |
copy() |
static Vector4f |
cross(Vector4f left,
Vector4f right,
Vector4f dest) |
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 |
length() |
float |
lengthSquared() |
Vector4f |
load(java.nio.FloatBuffer buf) |
void |
mul(float m) |
Vector4f |
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.
|
Vector4f |
scale(float scale) |
void |
set(float x,
float y) |
void |
set(float x,
float y,
float z) |
void |
set(float x,
float y,
float z,
float w) |
Vector4f |
set(Vector4f 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
|
Vector4f |
store(java.nio.FloatBuffer buf) |
static Vector4f |
sub(Vector4f left,
Vector4f right,
Vector4f dest)
Subtract a vector from another vector and place the result in a destination
vector.
|
net.minecraft.util.math.vector.Vector3f |
to3f() |
java.lang.String |
toString() |
Vector4f |
translate(float x,
float y,
float z,
float w)
Translate a vector
|
public static final Vector4f ZERO
public float x
public float y
public float z
public float w
public Vector4f()
public Vector4f(Vector4f src)
public Vector4f(net.minecraft.util.math.vector.Vector3f src)
public Vector4f(float x, float y, float z, float w)
public void set(float x, float y)
public void set(float x, float y, float z)
public void set(float x, float y, float z, float w)
public Vector4f set(Vector4f src)
src
- The source vectorpublic float lengthSquared()
public float length()
public 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()
public 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 Vector4f load(java.nio.FloatBuffer buf)
public Vector4f scale(float scale)
public Vector4f store(java.nio.FloatBuffer buf)
public java.lang.String toString()
toString
in class java.lang.Object
public final float getX()
public final float getY()
public final void setX(float x)
x
- public final void setY(float y)
y
- public void setZ(float z)
z
- public float getZ()
public void setW(float w)
w
- public float getW()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Vector4f copy()
public net.minecraft.util.math.vector.Vector3f to3f()
public void mul(float m)