Maxst AR SDK 4.0.0  4.0.0
Public Member Functions | Protected Attributes | List of all members
com.maxst.ar.Vector3f Class Reference

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]
 

Detailed Description

3-dimensional vector with conventient getters and setters. Additionally this class is serializable and

Constructor & Destructor Documentation

◆ Vector3f() [1/5]

com.maxst.ar.Vector3f.Vector3f ( float  x,
float  y,
float  z 
)
inline

Initialises the vector with the given values

Parameters
xthe x-component
ythe y-component
zthe z-component

◆ Vector3f() [2/5]

com.maxst.ar.Vector3f.Vector3f ( float  value)
inline

Initialises all components of this vector with the given same value.

Parameters
valueInitialisation value for all components

◆ Vector3f() [3/5]

com.maxst.ar.Vector3f.Vector3f ( )
inline

Instantiates a new vector3f.

◆ Vector3f() [4/5]

com.maxst.ar.Vector3f.Vector3f ( Vector3f  vector)
inline

Copy constructor

◆ Vector3f() [5/5]

com.maxst.ar.Vector3f.Vector3f ( Vector4f  vector)
inline

Initialises this vector from a 4-dimensional vector. If the fourth component is not zero, a normalisation of all components will be performed.

Parameters
vectorThe 4-dimensional vector that should be used for initialisation

Member Function Documentation

◆ add() [1/2]

void com.maxst.ar.Vector3f.add ( Vector3f  summand)
inline

Adds a vector to this vector

Parameters
summandthe vector that should be added component-wise

◆ add() [2/2]

void com.maxst.ar.Vector3f.add ( float  summand)
inline

Adds the value to all components of this vector

Parameters
summandThe value that should be added to all components

◆ crossProduct()

void com.maxst.ar.Vector3f.crossProduct ( Vector3f  inputVec,
Vector3f  outputVec 
)
inline

Get the cross product of this vector and another vector. The result will be stored in the output vector.

Parameters
inputVecThe vector you want to get the dot product of against this vector.
outputVecThe vector to store the result in.

◆ dotProduct()

float com.maxst.ar.Vector3f.dotProduct ( Vector3f  inputVec)
inline

Return the dot product of this vector with the input vector

Parameters
inputVecThe vector you want to do the dot product with against this vector.
Returns
Float value representing the scalar of the dot product operation

◆ getLength()

float com.maxst.ar.Vector3f.getLength ( )
inline

If you need to get the length of a vector then use this function.

Returns
The length of the vector

◆ getX()

float com.maxst.ar.Vector3f.getX ( )
inline

Gets the x.

Returns
the x

◆ getY()

float com.maxst.ar.Vector3f.getY ( )
inline

Gets the y.

Returns
the y

◆ getZ()

float com.maxst.ar.Vector3f.getZ ( )
inline

Gets the z.

Returns
the z

◆ multiplyByScalar()

void com.maxst.ar.Vector3f.multiplyByScalar ( float  scalar)
inline

Multiply by scalar.

Parameters
scalarthe scalar

◆ normalize()

void com.maxst.ar.Vector3f.normalize ( )
inline

Normalize.

◆ set() [1/2]

void com.maxst.ar.Vector3f.set ( Vector3f  source)
inline

Clone the input vector so that this vector has the same values.

Parameters
sourceThe vector you want to clone.

◆ set() [2/2]

void com.maxst.ar.Vector3f.set ( float []  source)
inline

Clone the input vector so that this vector has the same values.

Parameters
sourceThe vector you want to clone.

◆ setX()

void com.maxst.ar.Vector3f.setX ( float  x)
inline

Sets the x.

Parameters
xthe new x

◆ setY()

void com.maxst.ar.Vector3f.setY ( float  y)
inline

Sets the y.

Parameters
ythe new y

◆ setZ()

void com.maxst.ar.Vector3f.setZ ( float  z)
inline

Sets the z.

Parameters
zthe new z

◆ subtract()

void com.maxst.ar.Vector3f.subtract ( Vector3f  subtrahend)
inline
Parameters
subtrahend

◆ toArray()

float [] com.maxst.ar.Vector3f.toArray ( )
inline

Returns this vector as float-array.

Returns
the float[]

◆ x()

float com.maxst.ar.Vector3f.x ( )
inline

Functions for convenience

Member Data Documentation

◆ points

float [] com.maxst.ar.Vector3f.points = new float[3]
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.


The documentation for this class was generated from the following file: