|
philsupertramp/game-math
|
#include <vec3.h>
Public Member Functions | |
| vec3 () | |
| vec3 (const T &_x, const T &_y, const T &_z) | |
| vec3 (const vec4< T > &a) | |
| vec3 (const vec2< T > &a, const T &z) | |
| template<typename U > | |
| vec3 (const U &_v) | |
| vec3 (const vec3< T > &v) | |
| template<typename U > | |
| vec3 (const vec3< U > &v) | |
| vec3 (const T *v) | |
| vec3< T > | cross (const vec3< T > &rhs) const |
| float | length () const |
| vec3< T > | normalize () const |
| vec3< T > & | operator+= (const vec3< T > &rhs) |
| vec3< T > & | operator-= (const vec3< T > &rhs) |
| vec3< T > & | operator*= (const T &rhs) |
| vec3< T > & | operator/= (const T &rhs) |
| constexpr vec3< T > & | operator= (vec3< T > const &V) |
| T & | operator[] (const int &index) |
| const T & | operator[] (const int &index) const |
| template<typename U > | |
| operator vec3< U > () | |
Public Attributes | ||
| union { | ||
| struct { | ||
| T x | ||
| T y | ||
| T z | ||
| } | ||
| }; | ||
| packed data representation | ||
| const size_t | dim = 3 | |
| dimension of object | ||
Friends | |
| vec3< T > | operator+ (vec3< T > lhs, const vec3< T > &rhs) |
| vec3< T > | operator- (vec3< T > lhs, const vec3< T > &rhs) |
| vec3< T > | operator* (vec3< T > lhs, const T &rhs) |
| vec3< T > | operator* (const T &lhs, vec3< T > rhs) |
| T | operator* (vec3< T > lhs, const vec3< T > &rhs) |
| vec3< T > | operator/ (vec3< T > lhs, const T &rhs) |
| vec3< T > | operator/ (vec3< T > lhs, const vec3< T > &rhs) |
| bool | operator== (const vec3< T > &lhs, const vec3< T > &rhs) |
| bool | operator> (const vec3< T > &lhs, const vec3< T > &rhs) |
| bool | operator< (const vec3< T > &lhs, const vec3< T > &rhs) |
| template<class U > | |
| std::ostream & | operator<< (std::ostream &, const vec3< U > &) |
3 element
| _x | |
| _y | |
| _z |
vec2 + T constructor
| a | 2D vector |
| z | element z |
single value constructor
| _v |
cross-product
| rhs |
calculates the vectors length (p=2-norm)
\[ \sqrt{\sum x_i} \]
returns normalized vector
cast operator into new type U
| U |
vector-scalar multiplication
| rhs |
vector-vector addition
| rhs |
vector-vector subtraction
| rhs |
vector-scalar division
| rhs |
copy constructor
| V |
element access
| index |
const element access
| index |
vector-scalar multiplication
| lhs | |
| rhs |
vector-scalar multiplication
| lhs | |
| rhs |
vector-vector multiplication aka dot-product
| lhs | |
| rhs |
vector-vector addition
| lhs | |
| rhs |
vector-vector subtraction
| lhs | |
| rhs |
vector-scalar division
| lhs | |
| rhs |
vector-scalar division
| lhs | |
| rhs |
smaller comparison operator
| lhs | |
| rhs |
beautified std::cout operator
| U |
equality comparison
| lhs | |
| rhs |
bigger comparison operator
| lhs | |
| rhs |