Flair
Framework Libre Air
flair::core::Vector3D< T > Class Template Reference

Class defining a 3D vector. More...

#include <Vector3D.h>

+ Inheritance diagram for flair::core::Vector3D< T >:

Public Member Functions

 Vector3D (T x=0, T y=0, T z=0)
 Constructor. More...
 
 ~Vector3D ()
 Destructor. More...
 
void RotateX (float value)
 x axis rotation More...
 
void RotateXDeg (float value)
 x axis rotation More...
 
void RotateY (float value)
 y axis rotation More...
 
void RotateYDeg (float value)
 y axis rotation More...
 
void RotateZ (float value)
 z axis rotation More...
 
void RotateZDeg (float value)
 z axis rotation More...
 
void Rotate (const RotationMatrix &matrix)
 rotation More...
 
void Rotate (const Quaternion &quaternion)
 rotation More...
 
void To2Dxy (Vector2D< T > &vector) const
 Convert to a Vector2D. More...
 
Vector2D< T > To2Dxy (void) const
 Convert to a Vector2D. More...
 
float GetNorm (void) const
 Norm. More...
 
void Normalize (void)
 Normalize. More...
 
void Saturate (const Vector3D< T > &min, const Vector3D< T > &max)
 Saturate. More...
 
void Saturate (float min, float max)
 Saturate. More...
 
void Saturate (const Vector3D< T > &value)
 Saturate. More...
 
void Saturate (float value)
 Saturate. More...
 
T & operator[] (size_t idx)
 
const T & operator[] (size_t idx) const
 
template<typename S >
Vector3D< T > & operator= (const Vector3D< S > &vector)
 
Vector3D< T > & operator+= (const Vector3D< T > &vector)
 
Vector3D< T > & operator-= (const Vector3D< T > &vector)
 

Public Attributes

x
 x More...
 
y
 y More...
 
z
 z More...
 

Detailed Description

template<typename T>
class flair::core::Vector3D< T >

Class defining a 3D vector.

Constructor & Destructor Documentation

template<typename T>
flair::core::Vector3D< T >::Vector3D ( x = 0,
y = 0,
z = 0 
)

Constructor.

Construct a Vector3D using specified values.

Parameters
x
y
z
template<typename T>
flair::core::Vector3D< T >::~Vector3D ( )

Destructor.

Member Function Documentation

template<typename T>
void flair::core::Vector3D< T >::RotateX ( float  value)

x axis rotation

Parameters
valuerotation value in radians
template<typename T>
void flair::core::Vector3D< T >::RotateXDeg ( float  value)

x axis rotation

Parameters
valuerotation value in degrees
template<typename T>
void flair::core::Vector3D< T >::RotateY ( float  value)

y axis rotation

Parameters
valuerotation value in radians
template<typename T>
void flair::core::Vector3D< T >::RotateYDeg ( float  value)

y axis rotation

Parameters
valuerotation value in degrees
template<typename T>
void flair::core::Vector3D< T >::RotateZ ( float  value)

z axis rotation

Parameters
valuerotation value in radians
template<typename T>
void flair::core::Vector3D< T >::RotateZDeg ( float  value)

z axis rotation

Parameters
valuerotation value in degrees
template<typename T>
void flair::core::Vector3D< T >::Rotate ( const RotationMatrix matrix)

rotation

Parameters
matrixrotation matrix
template<typename T>
void flair::core::Vector3D< T >::Rotate ( const Quaternion quaternion)

rotation

Compute a rotation from a quaternion. This method uses a rotation matrix internaly.

Parameters
quaternionquaternion
template<typename T>
void flair::core::Vector3D< T >::To2Dxy ( Vector2D< T > &  vector) const

Convert to a Vector2D.

Uses x and y coordinates.

Parameters
vectordestination
template<typename T>
Vector2D<T> flair::core::Vector3D< T >::To2Dxy ( void  ) const

Convert to a Vector2D.

Uses x and y coordinates.

Returns
destination
template<typename T>
float flair::core::Vector3D< T >::GetNorm ( void  ) const

Norm.

Returns
value
template<typename T>
void flair::core::Vector3D< T >::Normalize ( void  )

Normalize.

template<typename T>
void flair::core::Vector3D< T >::Saturate ( const Vector3D< T > &  min,
const Vector3D< T > &  max 
)

Saturate.

Saturate between min and max

Parameters
minminimum value
maxmaximum value
template<typename T>
void flair::core::Vector3D< T >::Saturate ( float  min,
float  max 
)

Saturate.

Saturate between min and max

Parameters
minminimum Vector3D(min,min,min) value
maxmaximum Vector3D(max,max,max) value
template<typename T>
void flair::core::Vector3D< T >::Saturate ( const Vector3D< T > &  value)

Saturate.

Saturate between -abs(value) and abs(value)

Parameters
valuesaturation Vector3D value
template<typename T>
void flair::core::Vector3D< T >::Saturate ( float  value)

Saturate.

Saturate between -abs(Vector3D(value,value,value)) and abs(Vector3D(value,value,value))

Parameters
valuesaturation Vector3D(value,value,value)

Member Data Documentation

template<typename T>
T flair::core::Vector3D< T >::x

x

template<typename T>
T flair::core::Vector3D< T >::y

y

template<typename T>
T flair::core::Vector3D< T >::z

z