![]() |
VMTK
|
#include <vmath.h>
Public Member Functions | |
Vector4 () | |
Vector4 (T nx, T ny, T nz, T nw) | |
Vector4 (T nx, T ny, T nz) | |
Vector4 (const Vector3< T > &v, T nw) | |
Vector4 (const Vector3< T > &v) | |
Vector4 (const Vector4< T > &src) | |
template<class FromT > | |
Vector4 (const Vector4< FromT > &src) | |
template<typename FromT > | |
Vector4 (const Vector3< FromT > &src, FromT w) | |
Vector4< T > | operator= (const Vector4< T > &rhs) |
template<class FromT > | |
Vector4< T > | operator= (const Vector4< FromT > &rhs) |
T & | operator[] (int n) |
const T & | operator[] (int n) const |
Vector4< T > | operator+ (const Vector4< T > &rhs) const |
Vector4< T > | operator- (const Vector4< T > &rhs) const |
Vector4< T > | operator* (const Vector4< T > rhs) const |
Vector4< T > | operator/ (const Vector4< T > &rhs) const |
Vector4< T > & | operator+= (const Vector4< T > &rhs) |
Vector4< T > & | operator-= (const Vector4< T > &rhs) |
Vector4< T > & | operator*= (const Vector4< T > &rhs) |
Vector4< T > & | operator/= (const Vector4< T > &rhs) |
bool | operator== (const Vector4< T > &rhs) const |
bool | operator!= (const Vector4< T > &rhs) const |
Vector4< T > | operator- () const |
Vector4< T > | operator+ (T rhs) const |
Vector4< T > | operator- (T rhs) const |
Vector4< T > | operator* (T rhs) const |
Vector4< T > | operator/ (T rhs) const |
Vector4< T > & | operator+= (T rhs) |
Vector4< T > & | operator-= (T rhs) |
Vector4< T > & | operator*= (T rhs) |
Vector4< T > & | operator/= (T rhs) |
T | length () const |
void | normalize () |
T | lengthSq () const |
Vector4< T > | lerp (T fact, const Vector4< T > &r) const |
operator T* () | |
operator const T * () const | |
Vector3< T > | xyz () const |
std::string | toString () const |
void | print () |
Public Attributes | |
union { | |
T r | |
T x | |
}; | |
union { | |
T g | |
T y | |
}; | |
union { | |
T b | |
T z | |
}; | |
union { | |
T a | |
T w | |
}; | |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const Vector4< T > &rhs) |
Class for four dimensional vector. There are four ways of accessing vector components. Let's have Vector4f v
, you can either:
v.x = v.y = v.z = v.w = 1;
v.s = v.t = v.u = v.v = 1;
v.r = v.g = v.b = v.a = 1;
v[0] = v[1] = v[2] = v[3] = 1;
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Linear interpolation of two vectors
fact | Factor of interpolation. For translation from position of this vector to vector r, values of factor goes from 0.0 to 1.0. |
r | Second Vector for interpolation |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Equality test operator
rhs | Right hand side argument of binary operator. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
T VMATH_NAMESPACE::Vector4< T >::a |
T VMATH_NAMESPACE::Vector4< T >::b |
T VMATH_NAMESPACE::Vector4< T >::g |
T VMATH_NAMESPACE::Vector4< T >::r |
T VMATH_NAMESPACE::Vector4< T >::w |
T VMATH_NAMESPACE::Vector4< T >::y |
T VMATH_NAMESPACE::Vector4< T >::z |