Vector3< T > Class Template Reference

Represents a three dimensions vector for both CPU and GPU. More...

Functions

_FCT_CPU_GPU_ int size () const
 
_FCT_CPU_GPU_ Vector3 ()
 
_FCT_CPU_GPU_ Vector3 (const T &t)
 
_FCT_CPU_GPU_ Vector3 (const T *tp)
 
_FCT_CPU_GPU_ Vector3 (const T v0, const T v1, const T v2)
 
_FCT_CPU_GPU_ Vector3 (const Vector3< T > &v)
 
_FCT_CPU_GPU_ Vector3 (const Vector2< T > &v, const T d=0)
 
_FCT_CPU_GPU_ Vector3 (const Vector4< T > &v)
 
_FCT_CPU_GPU_ const T * ptr () const
 
_FCT_CPU_GPU_ Vector3< T > & setValues (const T *b)
 
_FCT_CPU_GPU_ Vector3< T > & operator= (const Vector4< T > &other)
 
_FCT_CPU_GPU_ T & operator[] (int i)
 
_FCT_CPU_GPU_ float norm ()
 returns the norm of the vector More...
 
_FCT_CPU_GPU_ float square ()
 returns the squared norm of the vector More...
 
_FCT_CPU_GPU_ float sum ()
 returns the sum of the vector More...
 

Static Functions

static _FCT_CPU_GPU_ float dot (const Vector3< T > &a, const Vector3< T > &b)
 returns the dot product of two vector More...
 
static _FCT_CPU_GPU_ float distance (const Vector3< T > &a, const Vector3< T > &b)
 returns the distance between two vector More...
 
static _FCT_CPU_GPU_ Vector3< T > cross (const Vector3< T > &a, const Vector3< T > &b)
 returns the cross product between two vector More...
 

Detailed Description

template<typename T>
class sl::Vector3< T >

Represents a three dimensions vector for both CPU and GPU.

Constructor and Destructor

◆ Vector3() [1/7]

_FCT_CPU_GPU_ Vector3 ( )
inline

◆ Vector3() [2/7]

_FCT_CPU_GPU_ Vector3 ( const T &  t)
inline

◆ Vector3() [3/7]

_FCT_CPU_GPU_ Vector3 ( const T *  tp)
inline

◆ Vector3() [4/7]

_FCT_CPU_GPU_ Vector3 ( const T  v0,
const T  v1,
const T  v2 
)
inline

◆ Vector3() [5/7]

_FCT_CPU_GPU_ Vector3 ( const Vector3< T > &  v)
inline

◆ Vector3() [6/7]

_FCT_CPU_GPU_ Vector3 ( const Vector2< T > &  v,
const T  d = 0 
)
inline

◆ Vector3() [7/7]

_FCT_CPU_GPU_ Vector3 ( const Vector4< T > &  v)
inline

Functions

◆ size()

_FCT_CPU_GPU_ int size ( ) const
inline

◆ ptr()

_FCT_CPU_GPU_ const T* ptr ( ) const
inline

◆ setValues()

_FCT_CPU_GPU_ Vector3<T>& setValues ( const T *  b)
inline

◆ operator=()

_FCT_CPU_GPU_ Vector3<T>& operator= ( const Vector4< T > &  other)
inline

◆ operator[]()

_FCT_CPU_GPU_ T& operator[] ( int  i)
inline

◆ norm()

_FCT_CPU_GPU_ float norm ( )
inline

returns the norm of the vector

◆ square()

_FCT_CPU_GPU_ float square ( )
inline

returns the squared norm of the vector

◆ sum()

_FCT_CPU_GPU_ float sum ( )
inline

returns the sum of the vector

◆ dot()

static _FCT_CPU_GPU_ float dot ( const Vector3< T > &  a,
const Vector3< T > &  b 
)
inlinestatic

returns the dot product of two vector

◆ distance()

static _FCT_CPU_GPU_ float distance ( const Vector3< T > &  a,
const Vector3< T > &  b 
)
inlinestatic

returns the distance between two vector

◆ cross()

static _FCT_CPU_GPU_ Vector3<T> cross ( const Vector3< T > &  a,
const Vector3< T > &  b 
)
inlinestatic

returns the cross product between two vector