Rasterfarm-SDK
Loading...
Searching...
No Matches
Vector< T, LENGTH > Class Template Reference

#include <vector.h>

Public Member Functions

 Vector (const Vector< T, LENGTH > &other)
 
template<typename U >
 operator Vector< U, LENGTH > ()
 
template<typename U >
 Vector (const Vector< U, LENGTH > &other)
 
 Vector (const Vector< T, LENGTH+1 > &other)
 
 Vector (const Vector< T, LENGTH+2 > &other)
 
 Vector (const Vector< T, LENGTH - 1 > &other, T last=T(0))
 
 Vector (const Vector< T, LENGTH - 2 > &other, T lastA=T(0), T lastB=T(0))
 
 Vector (const T array[])
 
template<typename U >
 Vector (const Initializer< U > &list)
 
 Vector (const Initializer< T > &list)
 
 Vector ()
 
 operator T* ()
 
void operator= (T array[])
 
template<typename OTHER_T >
void operator= (const Vector< OTHER_T, LENGTH > &other)
 
void operator= (const T &scalar)
 
Toperator[] (const size_t index)
 
const Toperator[] (const size_t index) const
 
bool operator== (const Vector< T, LENGTH > &other) const
 
bool operator!= (const Vector< T, LENGTH > &other) const
 
void operator+= (const Vector< T, LENGTH > &other)
 
void operator-= (const Vector< T, LENGTH > &other)
 
Vector< T, LENGTH > operator* (const T &scalar) const
 
void operator*= (T scalar)
 
void operator/= (T scalar)
 
T operator| (const Vector< T, LENGTH > &rhs) const
 
Vector< T, LENGTH > operator% (const Vector< T, LENGTH > &rhs) const
 
const Vector< T, LENGTH > operator- () const
 
template<typename... ARGS>
void set (ARGS...argList)
 
void set (const Vector< T, LENGTH > &vec)
 
const Vector< T, LENGTH > normal () const
 
const T squaredLength () const
 
const T magnitude () const
 
const T length () const
 
Vector< T, LENGTH > getScale ()
 
void scale (const Vector< T, LENGTH > &vec)
 
void translate (const Vector< T, LENGTH > &vec)
 
void rotate (T angle, const Vector< T, 3 > &vec)
 
Vector< T, LENGTH > & normalize ()
 
void print () const
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

T m [LENGTH]
 

Constructor & Destructor Documentation

◆ Vector() [1/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Vector< T, LENGTH > & other)
inline

◆ Vector() [2/10]

template<typename T , uint LENGTH>
template<typename U >
Vector< T, LENGTH >::Vector ( const Vector< U, LENGTH > & other)
inline

◆ Vector() [3/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Vector< T, LENGTH+1 > & other)
inline

◆ Vector() [4/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Vector< T, LENGTH+2 > & other)
inline

◆ Vector() [5/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Vector< T, LENGTH - 1 > & other,
T last = T( 0 ) )
inlineexplicit

◆ Vector() [6/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Vector< T, LENGTH - 2 > & other,
T lastA = T( 0 ),
T lastB = T( 0 ) )
inlineexplicit

◆ Vector() [7/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const T array[])
inline

◆ Vector() [8/10]

template<typename T , uint LENGTH>
template<typename U >
Vector< T, LENGTH >::Vector ( const Initializer< U > & list)
inline

◆ Vector() [9/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( const Initializer< T > & list)
inline

◆ Vector() [10/10]

template<typename T , uint LENGTH>
Vector< T, LENGTH >::Vector ( )
inline

Member Function Documentation

◆ getScale()

template<typename T , uint LENGTH>
Vector< T, LENGTH > Vector< T, LENGTH >::getScale ( )
inline

◆ length()

template<typename T , uint LENGTH>
const T Vector< T, LENGTH >::length ( ) const
inline

◆ magnitude()

template<typename T , uint LENGTH>
const T Vector< T, LENGTH >::magnitude ( ) const
inline

◆ normal()

template<typename T , uint LENGTH>
const Vector< T, LENGTH > Vector< T, LENGTH >::normal ( ) const
inline

◆ normalize()

template<typename T , uint LENGTH>
Vector< T, LENGTH > & Vector< T, LENGTH >::normalize ( )
inline

◆ operator T*()

template<typename T , uint LENGTH>
Vector< T, LENGTH >::operator T* ( )
inlineexplicit

◆ operator Vector< U, LENGTH >()

template<typename T , uint LENGTH>
template<typename U >
Vector< T, LENGTH >::operator Vector< U, LENGTH > ( )
inline

◆ operator!=()

template<typename T , uint LENGTH>
bool Vector< T, LENGTH >::operator!= ( const Vector< T, LENGTH > & other) const
inline

◆ operator%()

template<typename T , uint LENGTH>
Vector< T, LENGTH > Vector< T, LENGTH >::operator% ( const Vector< T, LENGTH > & rhs) const
inline

◆ operator*()

template<typename T , uint LENGTH>
Vector< T, LENGTH > Vector< T, LENGTH >::operator* ( const T & scalar) const
inline

◆ operator*=()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator*= ( T scalar)
inline

◆ operator+=()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator+= ( const Vector< T, LENGTH > & other)
inline

◆ operator-()

template<typename T , uint LENGTH>
const Vector< T, LENGTH > Vector< T, LENGTH >::operator- ( ) const
inline

◆ operator-=()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator-= ( const Vector< T, LENGTH > & other)
inline

◆ operator/=()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator/= ( T scalar)
inline

◆ operator=() [1/3]

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator= ( const T & scalar)
inline

This is a fill method, good for clearing too..

◆ operator=() [2/3]

template<typename T , uint LENGTH>
template<typename OTHER_T >
void Vector< T, LENGTH >::operator= ( const Vector< OTHER_T, LENGTH > & other)
inline

◆ operator=() [3/3]

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::operator= ( T array[])
inline

◆ operator==()

template<typename T , uint LENGTH>
bool Vector< T, LENGTH >::operator== ( const Vector< T, LENGTH > & other) const
inline

◆ operator[]() [1/2]

template<typename T , uint LENGTH>
T & Vector< T, LENGTH >::operator[] ( const size_t index)
inline

◆ operator[]() [2/2]

template<typename T , uint LENGTH>
const T & Vector< T, LENGTH >::operator[] ( const size_t index) const
inline

◆ operator|()

template<typename T , uint LENGTH>
T Vector< T, LENGTH >::operator| ( const Vector< T, LENGTH > & rhs) const
inline

◆ print()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::print ( ) const
inline

◆ rotate()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::rotate ( T angle,
const Vector< T, 3 > & vec )

◆ scale()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::scale ( const Vector< T, LENGTH > & vec)
inline

◆ set() [1/2]

template<typename T , uint LENGTH>
template<typename... ARGS>
void Vector< T, LENGTH >::set ( ARGS... argList)
inline

◆ set() [2/2]

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::set ( const Vector< T, LENGTH > & vec)
inline

◆ size()

template<typename T , uint LENGTH>
static size_t Vector< T, LENGTH >::size ( )
inlinestatic

◆ squaredLength()

template<typename T , uint LENGTH>
const T Vector< T, LENGTH >::squaredLength ( ) const
inline

◆ translate()

template<typename T , uint LENGTH>
void Vector< T, LENGTH >::translate ( const Vector< T, LENGTH > & vec)
inline

Member Data Documentation

◆ m

template<typename T , uint LENGTH>
T Vector< T, LENGTH >::m[LENGTH]

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