#include <vec2.h>
|
union { |
struct { |
T x |
|
T y |
|
} | |
|
}; | |
| packed data More...
|
|
const size_t | dim = 2 |
| object dimension More...
|
|
template<class T>
struct vec2< T >
2D vector representation
- Template Parameters
-
- Examples
- TestMatrix.cpp, TestUtils.cpp, mat/TestMat2.cpp, vec/TestVec2.cpp, and vec/TestVec4.cpp.
◆ vec2() [1/4]
◆ vec2() [2/4]
two-element constructor
- Parameters
-
◆ vec2() [3/4]
single value constructor initializes all elements with given _v
- Parameters
-
◆ vec2() [4/4]
copy constructor
- Parameters
-
◆ length()
template<class T >
float vec2< T >::length |
( |
| ) |
const |
|
inline |
◆ normalize()
template<class T >
vec2< T > vec2< T >::normalize |
( |
| ) |
const |
|
inline |
◆ operator vec2< U >()
template<class T >
template<typename U >
cast into other type
- Template Parameters
-
- Returns
◆ operator*=()
template<class T >
vec2< T > & vec2< T >::operator*= |
( |
const T & |
rhs | ) |
|
|
inline |
vector-scalar multiplication
- Parameters
-
- Returns
◆ operator+=()
vector-vector addition
- Parameters
-
- Returns
◆ operator-=()
vector-vector subtraction
- Parameters
-
- Returns
◆ operator/=() [1/2]
template<class T >
vec2< T > & vec2< T >::operator/= |
( |
const T & |
rhs | ) |
|
|
inline |
vector-scalar division
- Parameters
-
- Returns
◆ operator/=() [2/2]
◆ operator=()
template<class T >
constexpr vec2< T > & vec2< T >::operator= |
( |
vec2< T > const & |
V | ) |
|
|
inlineconstexpr |
assignment operator
- Parameters
-
- Returns
◆ operator[]() [1/2]
template<class T >
T & vec2< T >::operator[] |
( |
const int & |
index | ) |
|
|
inline |
member access
- Parameters
-
- Returns
◆ operator[]() [2/2]
template<class T >
const T & vec2< T >::operator[] |
( |
const int & |
index | ) |
const |
|
inline |
const member access
- Parameters
-
- Returns
◆ operator* [1/3]
template<class T >
vec2< T > operator* |
( |
const T & |
lhs, |
|
|
vec2< T > |
rhs |
|
) |
| |
|
friend |
scalar-vector multiplication
- Parameters
-
- Returns
◆ operator* [2/3]
template<class T >
vec2< T > operator* |
( |
vec2< T > |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
friend |
vec-scalar multiplication
- Parameters
-
- Returns
◆ operator* [3/3]
template<class T >
T operator* |
( |
vec2< T > |
lhs, |
|
|
const vec2< T > & |
rhs |
|
) |
| |
|
friend |
vector-vector multiplication (dot-product)
- Parameters
-
- Returns
◆ operator+
template<class T >
vec2< T > operator+ |
( |
vec2< T > |
lhs, |
|
|
const vec2< T > & |
rhs |
|
) |
| |
|
friend |
vec-vec addition
- Parameters
-
- Returns
◆ operator-
template<class T >
vec2< T > operator- |
( |
vec2< T > |
lhs, |
|
|
const vec2< T > & |
rhs |
|
) |
| |
|
friend |
vec-vec subtraction
- Parameters
-
- Returns
◆ operator/ [1/2]
template<class T >
vec2< T > operator/ |
( |
const vec2< T > & |
lhs, |
|
|
vec2< T > |
rhs |
|
) |
| |
|
friend |
◆ operator/ [2/2]
template<class T >
vec2< T > operator/ |
( |
vec2< T > |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
friend |
vector-scalar division
- Parameters
-
- Returns
◆ operator<<
template<class T >
template<class U >
std::ostream & operator<< |
( |
std::ostream & |
, |
|
|
const vec2< U > & |
|
|
) |
| |
|
friend |
beautified std::cout operator
- Template Parameters
-
- Returns
◆ operator==
template<class T >
bool operator== |
( |
const vec2< T > & |
lhs, |
|
|
const vec2< T > & |
rhs |
|
) |
| |
|
friend |
equality comparison operator
- Parameters
-
- Returns
union { ... } vec2< T >::@1 |
◆ dim
template<class T >
const size_t vec2< T >::dim = 2 |
The documentation for this struct was generated from the following file: