public final class Vector3f extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
float |
x
The vector's X coordinate.
|
float |
y
The vector's Y coordinate.
|
float |
z
The vector's Z coordinate.
|
static Vector3f |
ZERO
The zero vector.
|
| Constructor and Description |
|---|
Vector3f(float x,
float y,
float z)
Constructs a new vector with the given coordinates.
|
Vector3f(Vector3i v)
Constructs a new vector by converting an integral vector.
|
| Modifier and Type | Method and Description |
|---|---|
static Vector3f |
add(Vector3f a,
Vector3f b)
Adds two vectors.
|
static Vector3f |
componentwiseDiv(Vector3f a,
Vector3f b)
Performs a component-wise division of two vectors.
|
static Vector3f |
componentwiseMul(Vector3f a,
Vector3f b)
Performs a component-wise multiplication of two vectors.
|
static Vector3f |
div(Vector3f a,
float s)
Multiplies a vector by the inverse of a scalar.
|
boolean |
equals(Object o) |
int |
hashCode() |
static Vector3f |
mul(Vector3f a,
float s)
Multiplies a vector by a scalar.
|
static Vector3f |
neg(Vector3f v)
Computes the negation of a vector.
|
static Vector3f |
sub(Vector3f a,
Vector3f b)
Subtracts two vectors.
|
String |
toString() |
public static final Vector3f ZERO
public final float x
public final float y
public final float z
public Vector3f(float x,
float y,
float z)
x - the X coordinate.y - the Y coordinate.z - the Z coordinate.public Vector3f(Vector3i v)
v - the vector to convert.public static Vector3f add(Vector3f a, Vector3f b)
a - the first vector.b - the second vector.public static Vector3f sub(Vector3f a, Vector3f b)
a - the first vector.b - the second vector.public static Vector3f componentwiseMul(Vector3f a, Vector3f b)
a - the first vector.b - the second vector.public static Vector3f componentwiseDiv(Vector3f a, Vector3f b)
a - the first vector.b - the second vector.public static Vector3f mul(Vector3f a, float s)
a - the vector.s - the scalar to multiply by.public static Vector3f div(Vector3f a, float s)
a - the vector.s - the scalar to divide by.public static Vector3f neg(Vector3f v)
v - the vector.