#include <vec3.h>
|
union { |
struct { |
T x |
|
T y |
|
T z |
|
} | |
|
}; | |
| packed data representation More...
|
|
const size_t | dim = 3 |
| dimension of object More...
|
|
|
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 > &) |
|
template<class T>
struct vec3< T >
3D vector representation
- Template Parameters
-
- Examples
- TestUtils.cpp, mat/TestMat3.cpp, and vec/TestVec3.cpp.
◆ vec3() [1/7]
default constructor initializes elements with 0
◆ vec3() [2/7]
template<class T >
vec3< T >::vec3 |
( |
const T & |
_x, |
|
|
const T & |
_y, |
|
|
const T & |
_z |
|
) |
| |
|
inline |
◆ vec3() [3/7]
◆ vec3() [4/7]
vec2 + T constructor
- Parameters
-
◆ vec3() [5/7]
template<class T >
template<typename U >
single value constructor
- Parameters
-
◆ vec3() [6/7]
copy-constructor
- Parameters
-
◆ vec3() [7/7]
◆ cross()
◆ length()
template<class T >
float vec3< T >::length |
( |
| ) |
const |
|
inline |
calculates the vectors length (p=2-norm)
\[
\sqrt{\sum x_i}
\]
- Returns
- Examples
- vec/TestVec3.cpp.
◆ normalize()
template<class T >
vec3< T > vec3< T >::normalize |
( |
| ) |
const |
|
inline |
◆ operator vec3< U >()
template<class T >
template<typename U >
cast operator into new type U
- Template Parameters
-
- Returns
- vec3<U>(vec3<T>)
◆ operator*=()
template<class T >
vec3< T > & vec3< T >::operator*= |
( |
const T & |
rhs | ) |
|
|
inline |
vector-scalar multiplication
- Parameters
-
- Returns
◆ operator+=()
vector-vector addition
- Parameters
-
- Returns
◆ operator-=()
vector-vector subtraction
- Parameters
-
- Returns
◆ operator/=()
template<class T >
vec3< T > & vec3< T >::operator/= |
( |
const T & |
rhs | ) |
|
|
inline |
vector-scalar division
- Parameters
-
- Returns
◆ operator=()
template<class T >
constexpr vec3< T > & vec3< T >::operator= |
( |
vec3< T > const & |
V | ) |
|
|
inlineconstexpr |
copy constructor
- Parameters
-
- Returns
◆ operator[]() [1/2]
template<class T >
T & vec3< T >::operator[] |
( |
const int & |
index | ) |
|
|
inline |
element access
- Parameters
-
- Returns
◆ operator[]() [2/2]
template<class T >
const T & vec3< T >::operator[] |
( |
const int & |
index | ) |
const |
|
inline |
const element access
- Parameters
-
- Returns
◆ operator* [1/3]
template<class T >
vec3< T > operator* |
( |
const T & |
lhs, |
|
|
vec3< T > |
rhs |
|
) |
| |
|
friend |
vector-scalar multiplication
- Parameters
-
- Returns
◆ operator* [2/3]
template<class T >
vec3< T > operator* |
( |
vec3< T > |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
friend |
vector-scalar multiplication
- Parameters
-
- Returns
◆ operator* [3/3]
template<class T >
T operator* |
( |
vec3< T > |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
vector-vector multiplication aka dot-product
- Parameters
-
- Returns
◆ operator+
template<class T >
vec3< T > operator+ |
( |
vec3< T > |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
vector-vector addition
- Parameters
-
- Returns
◆ operator-
template<class T >
vec3< T > operator- |
( |
vec3< T > |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
vector-vector subtraction
- Parameters
-
- Returns
◆ operator/ [1/2]
template<class T >
vec3< T > operator/ |
( |
vec3< T > |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
friend |
vector-scalar division
- Parameters
-
- Returns
◆ operator/ [2/2]
template<class T >
vec3< T > operator/ |
( |
vec3< T > |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
vector-scalar division
- Parameters
-
- Returns
◆ operator<
template<class T >
bool operator< |
( |
const vec3< T > & |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
smaller comparison operator
- Parameters
-
- Returns
◆ operator<<
template<class T >
template<class U >
std::ostream & operator<< |
( |
std::ostream & |
, |
|
|
const vec3< U > & |
|
|
) |
| |
|
friend |
beautified std::cout operator
- Template Parameters
-
- Returns
◆ operator==
template<class T >
bool operator== |
( |
const vec3< T > & |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
equality comparison
- Parameters
-
- Returns
◆ operator>
template<class T >
bool operator> |
( |
const vec3< T > & |
lhs, |
|
|
const vec3< T > & |
rhs |
|
) |
| |
|
friend |
bigger comparison operator
- Parameters
-
- Returns
union { ... } vec3< T >::@5 |
packed data representation
◆ dim
template<class T >
const size_t vec3< T >::dim = 3 |
The documentation for this struct was generated from the following file: