MaxstARSDK
|
Public Member Functions | |
Vector3f (float x, float y, float z) | |
Vector3f (float value) | |
Vector3f () | |
Vector3f (Vector3f vector) | |
Vector3f (Vector4f vector) | |
float[] | toArray () |
void | add (Vector3f summand) |
void | add (float summand) |
void | subtract (Vector3f subtrahend) |
void | multiplyByScalar (float scalar) |
void | normalize () |
float | getX () |
float | getY () |
float | getZ () |
void | setX (float x) |
void | setY (float y) |
void | setZ (float z) |
float | x () |
float | y () |
float | z () |
void | x (float x) |
void | y (float y) |
void | z (float z) |
void | setXYZ (float x, float y, float z) |
float | dotProduct (Vector3f inputVec) |
void | crossProduct (Vector3f inputVec, Vector3f outputVec) |
float | getLength () |
String | toString () |
void | set (Vector3f source) |
void | set (float[] source) |
Protected Attributes | |
float[] | points = new float[3] |
3-dimensional vector with conventient getters and setters. Additionally this class is serializable and
com.maxst.ar.Vector3f.Vector3f | ( | float | x, |
float | y, | ||
float | z | ||
) |
Initialises the vector with the given values
x | the x-component |
y | the y-component |
z | the z-component |
com.maxst.ar.Vector3f.Vector3f | ( | float | value | ) |
Initialises all components of this vector with the given same value.
value | Initialisation value for all components |
com.maxst.ar.Vector3f.Vector3f | ( | ) |
Instantiates a new vector3f.
com.maxst.ar.Vector3f.Vector3f | ( | Vector3f | vector | ) |
Copy constructor
com.maxst.ar.Vector3f.Vector3f | ( | Vector4f | vector | ) |
Initialises this vector from a 4-dimensional vector. If the fourth component is not zero, a normalisation of all components will be performed.
vector | The 4-dimensional vector that should be used for initialisation |
void com.maxst.ar.Vector3f.add | ( | float | summand | ) |
Adds the value to all components of this vector
summand | The value that should be added to all components |
void com.maxst.ar.Vector3f.add | ( | Vector3f | summand | ) |
Adds a vector to this vector
summand | the vector that should be added component-wise |
Get the cross product of this vector and another vector. The result will be stored in the output vector.
inputVec | The vector you want to get the dot product of against this vector. |
outputVec | The vector to store the result in. |
float com.maxst.ar.Vector3f.dotProduct | ( | Vector3f | inputVec | ) |
Return the dot product of this vector with the input vector
inputVec | The vector you want to do the dot product with against this vector. |
float com.maxst.ar.Vector3f.getLength | ( | ) |
If you need to get the length of a vector then use this function.
float com.maxst.ar.Vector3f.getX | ( | ) |
Gets the x.
float com.maxst.ar.Vector3f.getY | ( | ) |
Gets the y.
float com.maxst.ar.Vector3f.getZ | ( | ) |
Gets the z.
void com.maxst.ar.Vector3f.multiplyByScalar | ( | float | scalar | ) |
Multiply by scalar.
scalar | the scalar |
void com.maxst.ar.Vector3f.normalize | ( | ) |
Normalize.
void com.maxst.ar.Vector3f.set | ( | float[] | source | ) |
Clone the input vector so that this vector has the same values.
source | The vector you want to clone. |
void com.maxst.ar.Vector3f.set | ( | Vector3f | source | ) |
Clone the input vector so that this vector has the same values.
source | The vector you want to clone. |
void com.maxst.ar.Vector3f.setX | ( | float | x | ) |
Sets the x.
x | the new x |
void com.maxst.ar.Vector3f.setXYZ | ( | float | x, |
float | y, | ||
float | z | ||
) |
void com.maxst.ar.Vector3f.setY | ( | float | y | ) |
Sets the y.
y | the new y |
void com.maxst.ar.Vector3f.setZ | ( | float | z | ) |
Sets the z.
z | the new z |
void com.maxst.ar.Vector3f.subtract | ( | Vector3f | subtrahend | ) |
subtrahend |
float [] com.maxst.ar.Vector3f.toArray | ( | ) |
Returns this vector as float-array.
String com.maxst.ar.Vector3f.toString | ( | ) |
float com.maxst.ar.Vector3f.x | ( | ) |
Functions for convenience
void com.maxst.ar.Vector3f.x | ( | float | x | ) |
float com.maxst.ar.Vector3f.y | ( | ) |
void com.maxst.ar.Vector3f.y | ( | float | y | ) |
float com.maxst.ar.Vector3f.z | ( | ) |
void com.maxst.ar.Vector3f.z | ( | float | z | ) |
|
protected |
A float array was chosen instead of individual variables due to performance concerns. Converting the points into an array at run time can cause slowness so instead we use one array and extract the individual variables with get methods.