| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/vec.h>
Public Types | |
| typedef T | value_type |
| STL style value_type declaration. | |
Public Member Functions | |
| Vec (T all=T(0)) | |
| Initialize all components to the given value. | |
| template<unsigned int DIM2, typename S> | |
| Vec (Vec< DIM2, S > const &other) | |
| Copy constructor with type conversion from type S to type T and possible component truncation, i.e., DIM2 must be equal or larger than DIM. | |
| Vec (T x, T y, T z, T w) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (Vec< 3, T > const &xyz, T w) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (T x, Vec< 3, T > const &yzw) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (Vec< 2, T > const &xy, T z, T w) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (Vec< 2, T > const &xy, Vec< 2, T > const &zw) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (T x, T y, Vec< 2, T > const &zw) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (T x, Vec< 2, T > const &yz, T w) | |
| Initialize all 4 components with individual values (only for Vec<4, T>). | |
| Vec (T x, T y, T z) | |
| Initialize all 3 components with individual values (only for Vec<3, T>). | |
| Vec (Vec< 2, T > const &xy, T z) | |
| Initialize all 3 components with individual values (only for Vec<3, T>). | |
| Vec (T x, Vec< 2, T > const &yz) | |
| Initialize all 3 components with individual values (only for Vec<3, T>). | |
| Vec (T x, T y) | |
| Initialize all 2 components with individual values (only for Vec<2, T>). | |
| T const & | operator[] (size_t index) const |
| Gives direct read access to the index-th element of the vector. | |
| T & | operator[] (size_t index) |
| Gives direct read/write access to the index-th element of the vector. | |
| T const & | x () const |
| Gives direct read access to the x component of the vector. | |
| T & | x () |
| Gives direct read/write access to the x component of the vector. | |
| T const & | y () const |
| Gives direct read access to the y component of the vector. | |
| T & | y () |
| Gives direct read/write access to the y component of the vector. | |
| T const & | z () const |
| Gives direct read access to the z component of the vector. | |
| T & | z () |
| Gives direct read/write access to the z component of the vector. | |
| T const & | w () const |
| Gives direct read access to the w component of the vector. | |
| T & | w () |
| Gives direct read/write access to the w component of the vector. | |
| Vec< 2, T > | xy () const |
| Gives read access to the xy components of the vector. | |
| Vec< 3, T > | xyz () const |
| Gives read access to the xyz components of the vector. | |
| Vec< 4, T > | xyzw () const |
| Gives read access to the xyz components of the vector. | |
| bool | operator== (Vec< DIM, T > const &other) const |
| Operator ==. | |
| bool | operator< (Vec< DIM, T > const &other) const |
| Operator < (lexicographic ordering of the components). | |
| Vec< DIM, T > & | operator+= (Vec< DIM, T > const &other) |
| Operator +=. | |
| Vec< DIM, T > & | operator-= (Vec< DIM, T > const &other) |
| Operator -=. | |
| Vec< DIM, T > & | operator*= (Vec< DIM, T > const &other) |
| Operator *=. | |
| Vec< DIM, T > & | operator/= (Vec< DIM, T > const &other) |
| Operator /=. | |
| Vec< DIM, T > & | operator+= (T s) |
| Operator +=. | |
| Vec< DIM, T > & | operator-= (T s) |
| Operator -=. | |
| Vec< DIM, T > & | operator*= (T s) |
| Operator *=. | |
| Vec< DIM, T > & | operator/= (T s) |
| Operator /=. | |
Implementation is based on GLSL found here: http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf
| typedef T VRS::Vec< DIM, T >::value_type |
STL style value_type declaration.
Initialize all components to the given value.
| VRS::Vec< DIM, T >::Vec | ( | Vec< DIM2, S > const & | other | ) | [inline, explicit] |
Copy constructor with type conversion from type S to type T and possible component truncation, i.e., DIM2 must be equal or larger than DIM.
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | Vec< 3, T > const & | xyz, | |
| T | w | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | T | x, | |
| Vec< 3, T > const & | yzw | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | Vec< 2, T > const & | xy, | |
| T | z, | |||
| T | w | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | Vec< 2, T > const & | xy, | |
| Vec< 2, T > const & | zw | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | T | x, | |
| T | y, | |||
| Vec< 2, T > const & | zw | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
| VRS::Vec< DIM, T >::Vec | ( | T | x, | |
| Vec< 2, T > const & | yz, | |||
| T | w | |||
| ) | [inline] |
Initialize all 4 components with individual values (only for Vec<4, T>).
Initialize all 3 components with individual values (only for Vec<3, T>).
| VRS::Vec< DIM, T >::Vec | ( | Vec< 2, T > const & | xy, | |
| T | z | |||
| ) | [inline] |
Initialize all 3 components with individual values (only for Vec<3, T>).
| VRS::Vec< DIM, T >::Vec | ( | T | x, | |
| Vec< 2, T > const & | yz | |||
| ) | [inline] |
Initialize all 3 components with individual values (only for Vec<3, T>).
Initialize all 2 components with individual values (only for Vec<2, T>).
| T const& VRS::Vec< DIM, T >::operator[] | ( | size_t | index | ) | const [inline] |
Gives direct read access to the index-th element of the vector.
| T& VRS::Vec< DIM, T >::operator[] | ( | size_t | index | ) | [inline] |
Gives direct read/write access to the index-th element of the vector.
| T const& VRS::Vec< DIM, T >::x | ( | ) | const [inline] |
Gives direct read access to the x component of the vector.
| T& VRS::Vec< DIM, T >::x | ( | ) | [inline] |
Gives direct read/write access to the x component of the vector.
| T const& VRS::Vec< DIM, T >::y | ( | ) | const [inline] |
Gives direct read access to the y component of the vector.
| T& VRS::Vec< DIM, T >::y | ( | ) | [inline] |
Gives direct read/write access to the y component of the vector.
| T const& VRS::Vec< DIM, T >::z | ( | ) | const [inline] |
Gives direct read access to the z component of the vector.
| T& VRS::Vec< DIM, T >::z | ( | ) | [inline] |
Gives direct read/write access to the z component of the vector.
| T const& VRS::Vec< DIM, T >::w | ( | ) | const [inline] |
Gives direct read access to the w component of the vector.
| T& VRS::Vec< DIM, T >::w | ( | ) | [inline] |
Gives direct read/write access to the w component of the vector.
Gives read access to the xy components of the vector.
Gives read access to the xyz components of the vector.
Gives read access to the xyz components of the vector.
| bool VRS::Vec< DIM, T >::operator== | ( | Vec< DIM, T > const & | other | ) | const [inline] |
Operator ==.
| bool VRS::Vec< DIM, T >::operator< | ( | Vec< DIM, T > const & | other | ) | const [inline] |
Operator < (lexicographic ordering of the components).
| Vec<DIM, T>& VRS::Vec< DIM, T >::operator+= | ( | Vec< DIM, T > const & | other | ) | [inline] |
Operator +=.
| Vec<DIM, T>& VRS::Vec< DIM, T >::operator-= | ( | Vec< DIM, T > const & | other | ) | [inline] |
Operator -=.
| Vec<DIM, T>& VRS::Vec< DIM, T >::operator*= | ( | Vec< DIM, T > const & | other | ) | [inline] |
Operator *=.
| Vec<DIM, T>& VRS::Vec< DIM, T >::operator/= | ( | Vec< DIM, T > const & | other | ) | [inline] |
Operator /=.
Operator +=.
Operator -=.
Operator *=.
Operator /=.