public class Vector4
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
float |
w
W coordinate of the vector.
|
float |
x
X coordinate of the vector.
|
float |
y
Y coordinate of the vector.
|
float |
z
Z coordinate of the vector.
|
| Constructor and Description |
|---|
Vector4()
Initialize a new instance of the Vector4 class.
|
Vector4(float value)
Initialize a new instance of the Vector4 class.
|
Vector4(float x,
float y,
float z,
float w)
Initialize a new instance of the Vector4 class.
|
| Modifier and Type | Method and Description |
|---|---|
Vector4 |
Abs()
Calculate absolute values of the vector.
|
static Vector4 |
Add(Vector4 vector1,
float value)
Adds a value to all coordinates of the specified vector.
|
static Vector4 |
Add(Vector4 vector1,
Vector4 vector2)
Adds corresponding coordinates of two vectors.
|
static Vector4 |
Divide(Vector4 vector,
float factor)
Divides coordinates of the specified vector by the specified factor.
|
static Vector4 |
Divide(Vector4 vector1,
Vector4 vector2)
Divides corresponding coordinates of two vectors.
|
static float |
Dot(Vector4 vector1,
Vector4 vector2)
Calculates dot product of two vectors.
|
boolean |
equals(java.lang.Object obj) |
float |
getMax()
Get maximum value of the vector.
|
int |
getMaxIndex()
Get index of the coordinate with maximum value.
|
float |
getMin()
Get minimum value of the vector.
|
int |
getMinIndex()
Get index of the coordinate with minimum value.
|
Vector4 |
Inverse()
Inverse the vector.
|
static Vector4 |
Multiply(Vector4 vector,
float factor)
Multiplies coordinates of the specified vector by the specified factor.
|
static Vector4 |
Multiply(Vector4 vector1,
Vector4 vector2)
Multiplies corresponding coordinates of two vectors.
|
float |
Norm()
Returns vector's normalization.
|
float |
Normalize()
Normalizes the vector by dividing it’s all coordinates with the vector's norm.
|
float |
Square()
Returns square of the vector's norm.
|
static Vector4 |
Subtract(Vector4 vector1,
float value)
Subtracts a value from all coordinates of the specified vector.
|
static Vector4 |
Subtract(Vector4 vector1,
Vector4 vector2)
Subtracts corresponding coordinates of two vectors.
|
float[] |
toArray()
Returns array representation of the vector.
|
Vector3 |
toVector3()
Converts the vector to a 3D vector.
|
public float x
public float y
public float z
public float w
public Vector4()
public Vector4(float x,
float y,
float z,
float w)
x - X coordinate of the vector.y - Y coordinate of the vector.z - Z coordinate of the vector.w - W coordinate of the vector.public Vector4(float value)
value - Value, which is set to all 4 coordinates of the vector.public float getMax()
public float getMin()
public int getMaxIndex()
public int getMinIndex()
public float Norm()
public float Square()
public float[] toArray()
public static Vector4 Add(Vector4 vector1, Vector4 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public static Vector4 Add(Vector4 vector1, float value)
vector - Vector to add the specified value to.value - Value to add to all coordinates of the vector.public static Vector4 Subtract(Vector4 vector1, Vector4 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public static Vector4 Subtract(Vector4 vector1, float value)
vector - Vector to subtract the specified value from.value - Value to subtract from all coordinates of the vector.public static Vector4 Multiply(Vector4 vector1, Vector4 vector2)
vector1 - The first vector to multiply.vector2 - The second vector to multiply.public static Vector4 Multiply(Vector4 vector, float factor)
vector - Vector to multiply coordinates of.factor - Factor to multiple coordinates of the specified vector by.public static Vector4 Divide(Vector4 vector1, Vector4 vector2)
vector1 - The first vector to divide.vector2 - The second vector to divide.public static Vector4 Divide(Vector4 vector, float factor)
vector - Vector to divide coordinates of.factor - Factor to divide coordinates of the specified vector by.public float Normalize()
public Vector4 Inverse()
public Vector4 Abs()
public static float Dot(Vector4 vector1, Vector4 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public Vector3 toVector3()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Object