public class Vector3
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
float |
x
X coordinate of the vector.
|
float |
y
Y coordinate of the vector.
|
float |
z
Z coordinate of the vector.
|
| Constructor and Description |
|---|
Vector3()
Initialize a new instance of the Vector3 class.
|
Vector3(float value)
Initialize a new instance of the Vector3 class.
|
Vector3(float x,
float y,
float z)
Initialize a new instance of the Vector3 class.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3 |
Abs()
Calculate absolute values of the vector.
|
static Vector3 |
Add(Vector3 vector,
float value)
Adds a value to all coordinates of the specified vector.
|
static Vector3 |
Add(Vector3 vector1,
Vector3 vector2)
Adds corresponding coordinates of two vectors.
|
static Vector3 |
Cross(Vector3 vector1,
Vector3 vector2)
Calculates cross product of two vectors.
|
static Vector3 |
Divide(Vector3 vector,
float factor)
Divides coordinates of the specified vector by the specified factor.
|
static Vector3 |
Divide(Vector3 vector1,
Vector3 vector2)
Divides corresponding coordinates of two vectors.
|
static float |
Dot(Vector3 vector1,
Vector3 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.
|
Vector3 |
Inverse()
Inverse the vector.
|
static Vector3 |
Multiply(Vector3 vector,
float factor)
Multiplies coordinates of the specified vector by the specified factor.
|
static Vector3 |
Multiply(Vector3 vector1,
Vector3 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 Vector3 |
Subtract(Vector3 vector,
float value)
Subtracts a value from all coordinates of the specified vector.
|
static Vector3 |
Subtract(Vector3 vector1,
Vector3 vector2)
Subtracts corresponding coordinates of two vectors.
|
float[] |
toArray()
Returns array representation of the vector.
|
Vector4 |
toVector4()
Converts the vector to a 4D vector.
|
public float x
public float y
public float z
public Vector3()
public Vector3(float x,
float y,
float z)
x - X coordinate of the vector.y - Y coordinate of the vector.z - Z coordinate of the vector.public Vector3(float value)
value - Value, which is set to all 3 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 Vector3 Add(Vector3 vector1, Vector3 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public static Vector3 Add(Vector3 vector, float value)
vector - Vector to add the specified value to.value - Value to add to all coordinates of the vector.public static Vector3 Subtract(Vector3 vector1, Vector3 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public static Vector3 Subtract(Vector3 vector, float value)
vector - Vector to subtract the specified value from.value - Value to subtract from all coordinates of the vector.public static Vector3 Multiply(Vector3 vector1, Vector3 vector2)
vector1 - The first vector to multiply.vector2 - The second vector to multiply.public static Vector3 Multiply(Vector3 vector, float factor)
vector - Vector to multiply coordinates of.factor - Factor to multiple coordinates of the specified vector by.public static Vector3 Divide(Vector3 vector1, Vector3 vector2)
vector1 - The first vector to divide.vector2 - The second vector to divide.public static Vector3 Divide(Vector3 vector, float factor)
vector - Vector to divide coordinates of.factor - Factor to divide coordinates of the specified vector by.public float Normalize()
public Vector3 Inverse()
public Vector3 Abs()
public static Vector3 Cross(Vector3 vector1, Vector3 vector2)
vector1 - First vector to use for cross product calculation.vector2 - Second vector to use for cross product calculation.public static float Dot(Vector3 vector1, Vector3 vector2)
vector1 - First vector to use for dot product calculation.vector2 - Second vector to use for dot product calculation.public Vector4 toVector4()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Object