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