|
| | Vector4 () |
| | Creates an uninitialized vector. More...
|
| |
| | Vector4 (int i) |
| | Creates a vector initialized to [ 0 0 0 1 ]. More...
|
| |
| | Vector4 (T x, T y, T z, T s) |
| | Creates a vector with the specified values. More...
|
| |
| | Vector4 (const float *va) |
| | Copies a float array vector. More...
|
| |
| template<class T2 , class M2 > |
| | Vector4 (const Vector4< T2, M2 > &x) |
| | Copies the specified vector. More...
|
| |
| template<class T2 , class M2 > |
| | Vector4 (const Vector3< T2, M2 > &x) |
| | Casts from non-homogeneous coordinates. More...
|
| |
| Vector4< T, M > & | operator= (const Vector4< T, M > &o) |
| | Copy operator. More...
|
| |
| template<class T2 , class M2 > |
| Vector4< T, M > & | operator= (const Vector4< T2, M2 > &o) |
| | Copy operator. More...
|
| |
| Vector4< T, M > & | operator= (const float *va) |
| | Copies a float array vector. More...
|
| |
| Vector4< T, M > | operator- () const |
| | Negates the vector. More...
|
| |
| Vector4< T, M > | hsv2rgb () const |
| | This function treats this vector as a HSVA space color vector and returns it transformed to RGBA color space. More...
|
| |
| Vector4< T, M > | rgb2hsv () const |
| | This function treats this vector as a RGBA space color vector and returns it transformed to HSVA color space. More...
|
| |
| T | length () const |
| | Returns the length of this vector. More...
|
| |
| T | length2 () const |
| | Returns the square length of this vector. More...
|
| |
| | operator const T * () const |
| | Casts this vector to an array representation. More...
|
| |
| | operator T * () |
| | Casts this vector to an array representation. More...
|
| |
| const T & | operator() (int i) const |
| | Index operator. More...
|
| |
| const T & | operator[] (int i) const |
| | Index operator. More...
|
| |
| T & | operator() (int i) |
| | Index operator. More...
|
| |
| T & | operator[] (int i) |
| | Index operator. More...
|
| |
template<class T, class M = Math<T>>
struct a3d::Vector4< T, M >
A vector of four values for 3d calculations in homogeneous coordinates.
template<class T, class M = Math<T>>
Casts this vector to an array representation.
This makes it possible to provide for example a float vector as an array argument in for example OpenGL.
Use like this:
Vector4f c = Vector4f::hsv2rgb( 0.5, 0.5, 0.5, 0.7 );
glColor4fv( (float*)c );
References a3d::Vector4< T, M >::v.
template<class T, class M = Math<T>>
Casts this vector to an array representation.
This makes it possible to provide for example a float vector as an array argument in for example OpenGL. Anything written in the returned array will end up in the vector.
Use like this:
Vector4f c = Vector4f::hsv2rgb( 0.5, 0.5, 0.5, 0.7 );
glColor4fv( (float*)c );
References a3d::Vector4< T, M >::v.