|
CGVIS Utils
|
4D vector template with arithmetic, length helpers, and utilities. More...
Go to the source code of this file.
Classes | |
| union | Vec4t< T > |
Typedefs | |
| typedef Vec4t< float > | Vec4 |
| 4D float vector (x,y,z,w). | |
| typedef Vec4t< int32_t > | Vec4i |
| 4D 32-bit signed integer vector (x,y,z,w). | |
| typedef Vec4t< uint32_t > | Vec4ui |
| 4D 32-bit unsigned integer vector (x,y,z,w). | |
Functions | |
| template<typename T> | |
| std::ostream & | operator<< (std::ostream &os, const Vec4t< T > &v) |
| Stream insertion for string representation of a vector. | |
| template<typename T> | |
| Vec4t< T > | operator* (float scalar, const Vec4t< T > &vec) |
| Scalar multiplication with scalar on the left. | |
4D vector template with arithmetic, length helpers, and utilities.
Defines a compact 4D vector type template, Vec4t<T>, storing four components with multiple alias views (x/y/z/w and r/g/b/a) and sub-vectors (xy, xyz). Provides component-wise and scalar arithmetic, length helpers, dot product, normalization, clamping, and random generation.
union with several member layouts to allow ergonomic access (e.g., v.x vs. v.e[0]). Access only one active view at a time. Scalar multiplication with scalar on the left.
| T | Component type of vector. |
| scalar | Scalar factor. |
| vec | Vector to multiply. |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Vec4t< T > & | v ) |
Stream insertion for string representation of a vector.
| T | Component type. |
| os | Output stream. |
| v | Vector to print. |