kanzi::Vector4 Class Reference

Vector with 4 floating point components: (x, y, z, w). More...

#include <kanzi/core/math/vector4.hpp>

Public Member Functions

 Vector4 ()
 Default constructor, initializes the vector to (0.0, 0.0, 0.0, 0.0). More...
 
 Vector4 (float x, float y, float z, float w)
 Constructor, initializes the vector to (x, y, z, w). More...
 
const float & operator[] (size_t index) const
 Access to individual elements of the vector. More...
 
float & operator[] (size_t index)
 Access to individual elements of the vector. More...
 
Vector4operator*= (float scalar)
 Multiplies each vector element with a scalar. More...
 
Vector4operator/= (float scalar)
 Divides each vector element with a scalar. More...
 
Vector4operator+= (const Vector4 &v)
 Modifies this vector by adding another vector. More...
 
Vector4operator-= (const Vector4 &v)
 Modifies this vector by subtracting another vector from this vector. More...
 
float getX () const
 Returns the x element of the vector. More...
 
float getY () const
 Returns the y element of the vector. More...
 
float getZ () const
 Returns the z element of the vector. More...
 
float getW () const
 Returns the w element of the vector. More...
 
void setX (float value)
 Sets the x element of the vector. More...
 
void setY (float value)
 Sets the y element of the vector. More...
 
void setZ (float value)
 Sets the z element of the vector. More...
 
void setW (float value)
 Sets the w element of the vector. More...
 
bool isNaN () const
 Returns true if and only if at least one of the vector values is NaN. More...
 

Static Public Member Functions

static Vector4 lowestValue ()
 Returns the vector with each element having the most negative float value. More...
 
static Vector4 highestValue ()
 Returns the vector with each element having the most positive float value. More...
 
static Vector4 nan ()
 Returns the vector with each element being NaN. More...
 
static Vector4 positiveInfinity ()
 Returns the vector with each element being the positive infinity. More...
 
static Vector4 negativeInfinity ()
 Returns the vector with each element being the negative infinity. More...
 

Detailed Description

Vector with 4 floating point components: (x, y, z, w).

Constructor & Destructor Documentation

kanzi::Vector4::Vector4 ( )
inlineexplicit

Default constructor, initializes the vector to (0.0, 0.0, 0.0, 0.0).

kanzi::Vector4::Vector4 ( float  x,
float  y,
float  z,
float  w 
)
inlineexplicit

Constructor, initializes the vector to (x, y, z, w).

Parameters
xx component of the vector.
yy component of the vector.
zz component of the vector.
ww component of the vector.

Member Function Documentation

const float& kanzi::Vector4::operator[] ( size_t  index) const
inline

Access to individual elements of the vector.

Parameters
indexIndex of the accessed element. Should be either 0, 1, 2, or 3.
Returns
If index is 0, x element. If index is 1, y element. If index is 2, z element. If index is 3, w element.
float& kanzi::Vector4::operator[] ( size_t  index)
inline

Access to individual elements of the vector.

Parameters
indexIndex of the accessed element. Should be either 0, 1, 2, or 3.
Returns
If index is 0, x element. If index is 1, y element. If index is 2, z element. If index is 3, w element.
Vector4& kanzi::Vector4::operator*= ( float  scalar)
inline

Multiplies each vector element with a scalar.

Parameters
scalarMultiplier for each vector element.
Returns
This vector.
Vector4& kanzi::Vector4::operator/= ( float  scalar)
inline

Divides each vector element with a scalar.

Parameters
scalarDivider for each vector element.
Returns
This vector.
Vector4& kanzi::Vector4::operator+= ( const Vector4 v)
inline

Modifies this vector by adding another vector.

Parameters
vAnother vector.
Returns
This vector.
Vector4& kanzi::Vector4::operator-= ( const Vector4 v)
inline

Modifies this vector by subtracting another vector from this vector.

Parameters
vAnother vector.
Returns
This vector.
float kanzi::Vector4::getX ( ) const
inline

Returns the x element of the vector.

Returns
The x element.
float kanzi::Vector4::getY ( ) const
inline

Returns the y element of the vector.

Returns
The y element.
float kanzi::Vector4::getZ ( ) const
inline

Returns the z element of the vector.

Returns
The z element.
float kanzi::Vector4::getW ( ) const
inline

Returns the w element of the vector.

Returns
The w element.
void kanzi::Vector4::setX ( float  value)
inline

Sets the x element of the vector.

Parameters
valueThe new value of the x element.
void kanzi::Vector4::setY ( float  value)
inline

Sets the y element of the vector.

Parameters
valueThe new value of the y element.
void kanzi::Vector4::setZ ( float  value)
inline

Sets the z element of the vector.

Parameters
valueThe new value of the z element.
void kanzi::Vector4::setW ( float  value)
inline

Sets the w element of the vector.

Parameters
valueThe new value of the w element.
Vector4 kanzi::Vector4::lowestValue ( )
inlinestatic

Returns the vector with each element having the most negative float value.

Returns
Vector with the lowest possible value.
Vector4 kanzi::Vector4::highestValue ( )
inlinestatic

Returns the vector with each element having the most positive float value.

Returns
Vector with the highest possible value.
Vector4 kanzi::Vector4::nan ( )
inlinestatic

Returns the vector with each element being NaN.

Returns
Vector with NaN elements.
bool kanzi::Vector4::isNaN ( ) const
inline

Returns true if and only if at least one of the vector values is NaN.

Vector4 kanzi::Vector4::positiveInfinity ( )
inlinestatic

Returns the vector with each element being the positive infinity.

Returns
Vector with positive infinity elements.
Vector4 kanzi::Vector4::negativeInfinity ( )
inlinestatic

Returns the vector with each element being the negative infinity.

Returns
Vector with negative infinity elements.

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