MaxstARSDK
com.maxst.ar.Vector3f Class Reference
Collaboration diagram for com.maxst.ar.Vector3f:
Collaboration graph

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 
)

Initialises the vector with the given values

Parameters
xthe x-component
ythe y-component
zthe z-component
Here is the call graph for this function:

◆ Vector3f() [2/5]

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

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 ( )

Instantiates a new vector3f.

◆ Vector3f() [4/5]

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

Copy constructor

◆ Vector3f() [5/5]

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.

Parameters
vectorThe 4-dimensional vector that should be used for initialisation
Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

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

Adds the value to all components of this vector

Parameters
summandThe value that should be added to all components

◆ add() [2/2]

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

Adds a vector to this vector

Parameters
summandthe vector that should be added component-wise

◆ crossProduct()

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

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.
Here is the call graph for this function:

◆ dotProduct()

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

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 ( )

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 ( )

Gets the x.

Returns
the x

◆ getY()

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

Gets the y.

Returns
the y

◆ getZ()

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

Gets the z.

Returns
the z

◆ multiplyByScalar()

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

Multiply by scalar.

Parameters
scalarthe scalar

◆ normalize()

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

Normalize.

◆ set() [1/2]

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

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 ( Vector3f  source)

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)

Sets the x.

Parameters
xthe new x
Here is the call graph for this function:

◆ setXYZ()

void com.maxst.ar.Vector3f.setXYZ ( float  x,
float  y,
float  z 
)
Here is the call graph for this function:

◆ setY()

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

Sets the y.

Parameters
ythe new y
Here is the call graph for this function:

◆ setZ()

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

Sets the z.

Parameters
zthe new z
Here is the call graph for this function:

◆ subtract()

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

◆ toArray()

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

Returns this vector as float-array.

Returns
the float[]

◆ toString()

String com.maxst.ar.Vector3f.toString ( )

◆ x() [1/2]

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

Functions for convenience

◆ x() [2/2]

void com.maxst.ar.Vector3f.x ( float  x)
Here is the call graph for this function:

◆ y() [1/2]

float com.maxst.ar.Vector3f.y ( )

◆ y() [2/2]

void com.maxst.ar.Vector3f.y ( float  y)
Here is the call graph for this function:

◆ z() [1/2]

float com.maxst.ar.Vector3f.z ( )

◆ z() [2/2]

void com.maxst.ar.Vector3f.z ( float  z)
Here is the call graph for this function:

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: