|
CGVIS Utils
|
3D vector template with arithmetic, geometry helpers, and RNG utilities. More...
#include <ostream>#include <sstream>#include <string>#include <array>#include <cmath>#include <optional>#include "Rand.h"#include "Vec2.h"Go to the source code of this file.
Classes | |
| union | Vec3t< T > |
Typedefs | |
| typedef Vec3t< float > | Vec3 |
| 3D float vector (x,y,z). | |
| typedef Vec3t< int32_t > | Vec3i |
| 3D 32-bit signed integer vector (x,y,z). | |
| typedef Vec3t< uint32_t > | Vec3ui |
| 3D 32-bit unsigned integer vector (x,y,z). | |
Functions | |
| template<typename T> | |
| std::ostream & | operator<< (std::ostream &os, const Vec3t< T > &v) |
| Stream insertion for string representation of a vector. | |
| template<typename T> | |
| Vec3t< T > | operator* (float scalar, const Vec3t< T > &vec) |
| Scalar multiplication with scalar on the left. | |
3D vector template with arithmetic, geometry helpers, and RNG utilities.
This header defines a compact 3D vector type template, Vec3t<T>, that stores three components and exposes multiple alias views (x/y/z and r/g/b as well as an xy sub-vector). It provides arithmetic operators, length helpers, and common geometric operations (dot, cross, reflect, refract) useful in graphics and simulation code.
union with multiple member layouts (an std::array, two structs for aliases, and a 2D sub-vector). This is intentional for ergonomic access. 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 Vec3t< T > & | v ) |
Stream insertion for string representation of a vector.
| T | Component type. |
| os | Output stream. |
| v | Vector to print. |