| 
|   | Vector ()=default | 
|   | Default constructor.  More...
  | 
|   | 
|   | Vector (T val) | 
|   | Constructor that fills the vector with a value.  More...
  | 
|   | 
|   | Vector (T *array) | 
|   | Constructor that takes an array.  More...
  | 
|   | 
| constexpr  | Vector (T x, T y, T z, T w) | 
|   | Constructor that takes 4 components.  More...
  | 
|   | 
|   | Vector (const Vector &other)=default | 
|   | Default copy constructor.  More...
  | 
|   | 
| template<typename U >  | 
|   | Vector (const Vector< U, 4 > &other) | 
|   | Converting copy constructor.  More...
  | 
|   | 
| T  | operator[] (std::size_t i) const  | 
|   | Access to the \( i \)-th coordinate.  More...
  | 
|   | 
| T &  | operator[] (std::size_t i) | 
|   | Access to the \( i \)-th coordinate.  More...
  | 
|   | 
| T *  | begin (void) | 
|   | Iterator.to the first element.  More...
  | 
|   | 
| T *  | end (void) | 
|   | Iterator to the element after the last one.  More...
  | 
|   | 
| T const *  | begin (void) const  | 
|   | Iterator.to the first element (const version).  More...
  | 
|   | 
| T const *  | end (void) const  | 
|   | Iterator on the element after the last one (const version).  More...
  | 
|   | 
| T const *  | cbegin (void) const  | 
|   | Iterator.on the first element (const version).  More...
  | 
|   | 
| T const *  | cend (void) const  | 
|   | Iterator on the element after the last one (const version).  More...
  | 
|   | 
 | 
| union gf::Vector< T, 4 >:: { ... }   |  | 
|   | 
| T  | data [4] | 
|   | Generic representation.  More...
  | 
|   | 
| T  | x | 
|   | First coordinate in the (x,y,z,w) representation.  More...
  | 
|   | 
| T  | y | 
|   | Second coordinate in the (x,y,z,w) representation.  More...
  | 
|   | 
| T  | z | 
|   | Third coordinate in the (x,y,z,w) representation.  More...
  | 
|   | 
| T  | w | 
|   | Fourth coordinate in the (x,y,z,w) representation.  More...
  | 
|   | 
| T  | r | 
|   | First coordinate in the (r,g,b,a) representation.  More...
  | 
|   | 
| T  | g | 
|   | Second coordinate in the (r,g,b,a) representation.  More...
  | 
|   | 
| T  | b | 
|   | Third coordinate in the (r,g,b,a) representation.  More...
  | 
|   | 
| T  | a | 
|   | Fourth coordinate in the (r,g,b,a) representation.  More...
  | 
|   | 
| Vector< T, 2 >  | xy | 
|   | Swizzle to get the first two coordinates as a 2D vector.  More...
  | 
|   | 
| Vector< T, 3 >  | xyz | 
|   | Swizzle to get the first three coordinates as a 3D vector.  More...
  | 
|   | 
| Vector< T, 3 >  | rgb | 
|   | Swizzle to get the first three coordinates as a RGB color.  More...
  | 
|   | 
template<typename T>
struct gf::Vector< T, 4 >
A 4D vector. 
This specialization of gf::Vector handles the 4-dimension spaces. It can be accessed with various representations:
- the generic representation with the 
data member 
- the 
(x,y,z,w) representation, used for generic coordinates in the 4D space 
- the 
(r,g,b,a) representation, used for RGBA colors 
Several common typedef are defined:
For colors, some additional typedef are defined:
Usage example: