Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
ion::vec4< T > Class Template Reference

4D vector More...

#include <vec4.h>

Inheritance diagram for ion::vec4< T >:
Inheritance graph
[legend]
Collaboration diagram for ion::vec4< T >:
Collaboration graph
[legend]

Public Member Functions

 vec4 ()
 Default constructor. More...
 
 vec4 (T const in)
 Scalar constructor. More...
 
 vec4 (T const x, T const y, T const z, T const w)
 Explicit constructor. More...
 
template<typename U >
 vec4 (glm::tvec4< U, glm::defaultp > const &v)
 GLM constructor. More...
 
template<typename U >
 vec4 (vec4< U > const &vec)
 Generic constructor. More...
 
 vec4 (vec3< T > const &vec, T const w=0)
 vec3 constructor (vec3, w) More...
 
 vec4 (T const x, vec3< T > const &vecYZW)
 vec3 constructor (x, vec3) More...
 
 vec4 (vec2< T > const &vec, T const z=0, T const w=0)
 vec2 constructor (vec2, z, w) More...
 
 vec4 (T const x, vec2< T > const &vecYZ, T const w)
 vec2 constructor (x, vec2, w) More...
 
 vec4 (T const x, T const y, vec2< T > const &vecZW)
 vec2 constructor (x, y, vec2) More...
 
 vec4 (vec2< T > const &vecXY, vec2< T > const &vecZW)
 vec2 constructor (vec2, vec2) More...
 
T operator[] (int i) const
 Note: Out-of-bounds access returns a dummy value without error. More...
 
Toperator[] (int i)
 Note: Out-of-bounds access returns a dummy value without error. More...
 
template<typename U >
vec4< T > & operator= (vec4< U > const &vec)
 Generic vector assignment operator. More...
 
void reset ()
 Sets all values to 0. More...
 
void set (T const in)
 Sets all values to a single scalar. More...
 
void set (T const in[])
 Sets all values by an input C-style array. More...
 
template<typename U >
void set (vec4< U > const &other)
 Sets all values by an input vector. More...
 
T Length () const
 Length of vector. More...
 
T LengthSq () const
 Squared-length of vector (computationally fast) More...
 
T Dot (vec4< T > const &other) const
 
T GetDistanceFrom (vec4< T > const &v) const
 
T const GetDistanceSqFrom (vec4< T > const &v) const
 
template<typename Real >
vec4< TGetInterpolated (vec4< T > const &v, Real const d) const
 
vec4< TGetNormalized () const
 
vec4< T > & Normalize ()
 Normalize this vector. More...
 
vec4< Toperator+ (vec4< T > const &v) const
 
vec4< Toperator- (vec4< T > const &v) const
 
vec4< Toperator* (vec4< T > const &v) const
 
vec4< Toperator/ (vec4< T > const &v) const
 
vec4< Toperator+ (T const s) const
 
vec4< Toperator- (T const s) const
 
vec4< Toperator* (T const s) const
 
vec4< Toperator/ (T const s) const
 
vec4< T > & operator+= (vec4< T > const &v)
 
vec4< T > & operator-= (vec4< T > const &v)
 
vec4< T > & operator*= (vec4< T > const &v)
 
vec4< T > & operator/= (vec4< T > const &v)
 
vec4< T > & operator+= (T const s)
 
vec4< T > & operator-= (T const s)
 
vec4< T > & operator*= (T const s)
 
vec4< T > & operator/= (T const s)
 
vec4< T > const operator- () const
 
bool operator< (vec4< T > const &v) const
 
bool operator== (vec4< T > const &v) const
 
bool operator!= (vec4< T > const &v) const
 
bool Equals (vec4< T > const &v, T const Epsilon=RoundingError< T >::Value()) const
 
glm::tvec4< T > const ToGLM () const
 
void Transform (glm::mat4 const &mat)
 
vec4< TGetTransformed (glm::mat4 const &mat) const
 
vec2< TXY () const
 
vec2< TXZ () const
 
vec2< TXW () const
 
vec2< TYZ () const
 
vec2< TZW () const
 
vec3< TXYZ () const
 

Static Public Member Functions

static vec4< TFromGLM (glm::tvec4< T > const &Vec)
 

Public Attributes

T X
 
T Y
 
T Z
 
T W
 

Friends

T Length (vec4< T > const &vec)
 Length of vector. More...
 
T LengthSq (vec4< T > const &vec)
 Squared-length of vector (computationally fast) More...
 
T Dot (vec4< T > const &lhs, vec4< T > const &rhs)
 
T Distance (vec4< T > const &lhs, vec4< T > const &rhs)
 
T DistanceSq (vec4< T > const &lhs, vec4< T > const &rhs)
 
template<typename Real >
vec4< TInterpolate (vec4< T > const &lhs, vec4< T > const &rhs, Real const d)
 
vec4< TNormalize (vec4< T > const &v)
 
vec4< Toperator+ (T const lhs, vec4< T > const &rhs)
 
vec4< Toperator- (T const lhs, vec4< T > const &rhs)
 
vec4< Toperator* (T const lhs, vec4< T > const &rhs)
 
vec4< Toperator/ (T const lhs, vec4< T > const &rhs)
 
vec4< TComponentMinimum (vec4< T > const &lhs, vec4< T > const &rhs)
 
vec4< TComponentMaximum (vec4< T > const &lhs, vec4< T > const &rhs)
 
std::ostream & operator<< (std::ostream &stream, vec4< T > const &vec)
 

Detailed Description

template<typename T>
class ion::vec4< T >

4D vector

Constructor & Destructor Documentation

template<typename T>
ion::vec4< T >::vec4 ( )
inline

Default constructor.

template<typename T>
ion::vec4< T >::vec4 ( T const  in)
inline

Scalar constructor.

template<typename T>
ion::vec4< T >::vec4 ( T const  x,
T const  y,
T const  z,
T const  w 
)
inline

Explicit constructor.

template<typename T>
template<typename U >
ion::vec4< T >::vec4 ( glm::tvec4< U, glm::defaultp > const &  v)
inline

GLM constructor.

template<typename T>
template<typename U >
ion::vec4< T >::vec4 ( vec4< U > const &  vec)
inline

Generic constructor.

template<typename T>
ion::vec4< T >::vec4 ( vec3< T > const &  vec,
T const  w = 0 
)
inline

vec3 constructor (vec3, w)

template<typename T>
ion::vec4< T >::vec4 ( T const  x,
vec3< T > const &  vecYZW 
)
inline

vec3 constructor (x, vec3)

template<typename T>
ion::vec4< T >::vec4 ( vec2< T > const &  vec,
T const  z = 0,
T const  w = 0 
)
inline

vec2 constructor (vec2, z, w)

template<typename T>
ion::vec4< T >::vec4 ( T const  x,
vec2< T > const &  vecYZ,
T const  w 
)
inline

vec2 constructor (x, vec2, w)

template<typename T>
ion::vec4< T >::vec4 ( T const  x,
T const  y,
vec2< T > const &  vecZW 
)
inline

vec2 constructor (x, y, vec2)

template<typename T>
ion::vec4< T >::vec4 ( vec2< T > const &  vecXY,
vec2< T > const &  vecZW 
)
inline

vec2 constructor (vec2, vec2)

Member Function Documentation

template<typename T>
T ion::vec4< T >::Dot ( vec4< T > const &  other) const
inline
template<typename T>
bool ion::vec4< T >::Equals ( vec4< T > const &  v,
T const  Epsilon = RoundingError<T>::Value() 
) const
inline
template<typename T>
static vec4<T> ion::vec4< T >::FromGLM ( glm::tvec4< T > const &  Vec)
inlinestatic
template<typename T>
T ion::vec4< T >::GetDistanceFrom ( vec4< T > const &  v) const
inline
template<typename T>
T const ion::vec4< T >::GetDistanceSqFrom ( vec4< T > const &  v) const
inline
template<typename T>
template<typename Real >
vec4<T> ion::vec4< T >::GetInterpolated ( vec4< T > const &  v,
Real const  d 
) const
inline
template<typename T>
vec4<T> ion::vec4< T >::GetNormalized ( ) const
inline
template<typename T>
vec4<T> ion::vec4< T >::GetTransformed ( glm::mat4 const &  mat) const
inline
template<typename T>
T ion::vec4< T >::Length ( ) const
inline

Length of vector.

template<typename T>
T ion::vec4< T >::LengthSq ( ) const
inline

Squared-length of vector (computationally fast)

template<typename T>
vec4<T>& ion::vec4< T >::Normalize ( )
inline

Normalize this vector.

template<typename T>
bool ion::vec4< T >::operator!= ( vec4< T > const &  v) const
inline
template<typename T>
vec4<T> ion::vec4< T >::operator* ( vec4< T > const &  v) const
inline
template<typename T>
vec4<T> ion::vec4< T >::operator* ( T const  s) const
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator*= ( vec4< T > const &  v)
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator*= ( T const  s)
inline
template<typename T>
vec4<T> ion::vec4< T >::operator+ ( vec4< T > const &  v) const
inline
template<typename T>
vec4<T> ion::vec4< T >::operator+ ( T const  s) const
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator+= ( vec4< T > const &  v)
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator+= ( T const  s)
inline
template<typename T>
vec4<T> ion::vec4< T >::operator- ( vec4< T > const &  v) const
inline
template<typename T>
vec4<T> ion::vec4< T >::operator- ( T const  s) const
inline
template<typename T>
vec4<T> const ion::vec4< T >::operator- ( ) const
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator-= ( vec4< T > const &  v)
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator-= ( T const  s)
inline
template<typename T>
vec4<T> ion::vec4< T >::operator/ ( vec4< T > const &  v) const
inline
template<typename T>
vec4<T> ion::vec4< T >::operator/ ( T const  s) const
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator/= ( vec4< T > const &  v)
inline
template<typename T>
vec4<T>& ion::vec4< T >::operator/= ( T const  s)
inline
template<typename T>
bool ion::vec4< T >::operator< ( vec4< T > const &  v) const
inline
template<typename T>
template<typename U >
vec4<T>& ion::vec4< T >::operator= ( vec4< U > const &  vec)
inline

Generic vector assignment operator.

template<typename T>
bool ion::vec4< T >::operator== ( vec4< T > const &  v) const
inline
template<typename T>
T ion::vec4< T >::operator[] ( int  i) const
inline

Note: Out-of-bounds access returns a dummy value without error.

template<typename T>
T& ion::vec4< T >::operator[] ( int  i)
inline

Note: Out-of-bounds access returns a dummy value without error.

template<typename T>
void ion::vec4< T >::reset ( )
inline

Sets all values to 0.

template<typename T>
void ion::vec4< T >::set ( T const  in)
inline

Sets all values to a single scalar.

template<typename T>
void ion::vec4< T >::set ( T const  in[])
inline

Sets all values by an input C-style array.

template<typename T>
template<typename U >
void ion::vec4< T >::set ( vec4< U > const &  other)
inline

Sets all values by an input vector.

template<typename T>
glm::tvec4<T> const ion::vec4< T >::ToGLM ( ) const
inline
template<typename T>
void ion::vec4< T >::Transform ( glm::mat4 const &  mat)
inline
template<typename T>
vec2<T> ion::vec4< T >::XW ( ) const
inline
template<typename T>
vec2<T> ion::vec4< T >::XY ( ) const
inline
template<typename T>
vec3<T> ion::vec4< T >::XYZ ( ) const
inline
template<typename T>
vec2<T> ion::vec4< T >::XZ ( ) const
inline
template<typename T>
vec2<T> ion::vec4< T >::YZ ( ) const
inline
template<typename T>
vec2<T> ion::vec4< T >::ZW ( ) const
inline

Friends And Related Function Documentation

template<typename T>
vec4<T> ComponentMaximum ( vec4< T > const &  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
vec4<T> ComponentMinimum ( vec4< T > const &  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
T Distance ( vec4< T > const &  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
T DistanceSq ( vec4< T > const &  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
T Dot ( vec4< T > const &  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
template<typename Real >
vec4<T> Interpolate ( vec4< T > const &  lhs,
vec4< T > const &  rhs,
Real const  d 
)
friend
template<typename T>
T Length ( vec4< T > const &  vec)
friend

Length of vector.

template<typename T>
T LengthSq ( vec4< T > const &  vec)
friend

Squared-length of vector (computationally fast)

template<typename T>
vec4<T> Normalize ( vec4< T > const &  v)
friend
template<typename T>
vec4<T> operator* ( T const  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
vec4<T> operator+ ( T const  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
vec4<T> operator- ( T const  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
vec4<T> operator/ ( T const  lhs,
vec4< T > const &  rhs 
)
friend
template<typename T>
std::ostream& operator<< ( std::ostream &  stream,
vec4< T > const &  vec 
)
friend

Member Data Documentation

template<typename T>
T ion::vec4< T >::W
template<typename T>
T ion::vec4< T >::X
template<typename T>
T ion::vec4< T >::Y
template<typename T>
T ion::vec4< T >::Z

The documentation for this class was generated from the following file: