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

Customized variant of vec4 that intelligently handles conversion between floating point and integer colors. More...

#include <color4.h>

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

Public Member Functions

 color4 ()
 Default constructor. More...
 
 color4 (T const in)
 Scalar constructor. More...
 
 color4 (T const r, T const g, T const b, T const a)
 Explicit constructor. More...
 
 color4 (color4< T > const &Other)
 Copy constructor. More...
 
 color4 (vec4< T > const &Other)
 Vector copy constructor. More...
 
template<typename U >
 color4 (color4< U > const &Other)
 Generic copy constructor. More...
 
color4< T > & operator= (color4< T > const &Other)
 Copy assignment operator. More...
 
template<typename U >
color4< T > & operator= (color4< U > const &Other)
 Generic copy assignment operator. More...
 
 color4 (color3< T > const &Other)
 color3 constructor More...
 
template<typename U >
 color4 (color3< U > const &Other)
 Generic color3 constructor. More...
 
color4< T > & operator= (color3< T > const &col)
 color3 assignment More...
 
template<typename U >
color4< T > & operator= (color3< U > const &col)
 Generic color3 assignment. More...
 
 operator color3< T > ()
 
- Public Member Functions inherited from ion::vec4< T >
 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
 

Public Attributes

TRed
 
TGreen
 
TBlue
 
TAlpha
 
- Public Attributes inherited from ion::vec4< T >
T X
 
T Y
 
T Z
 
T W
 

Additional Inherited Members

- Static Public Member Functions inherited from ion::vec4< T >
static vec4< TFromGLM (glm::tvec4< T > const &Vec)
 

Detailed Description

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

Customized variant of vec4 that intelligently handles conversion between floating point and integer colors.

Constructor & Destructor Documentation

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

Default constructor.

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

Scalar constructor.

template<typename T>
ion::color4< T >::color4 ( T const  r,
T const  g,
T const  b,
T const  a 
)
inline

Explicit constructor.

template<typename T>
ion::color4< T >::color4 ( color4< T > const &  Other)
inline

Copy constructor.

template<typename T>
ion::color4< T >::color4 ( vec4< T > const &  Other)
inline

Vector copy constructor.

template<typename T>
template<typename U >
ion::color4< T >::color4 ( color4< U > const &  Other)
inline

Generic copy constructor.

template<typename T>
ion::color4< T >::color4 ( color3< T > const &  Other)
inline

color3 constructor

template<typename T>
template<typename U >
ion::color4< T >::color4 ( color3< U > const &  Other)
inline

Generic color3 constructor.

Member Function Documentation

template<typename T>
ion::color4< T >::operator color3< T > ( )
inline
template<typename T>
color4<T>& ion::color4< T >::operator= ( color4< T > const &  Other)
inline

Copy assignment operator.

template<typename T>
template<typename U >
color4<T>& ion::color4< T >::operator= ( color4< U > const &  Other)
inline

Generic copy assignment operator.

template<typename T>
color4<T>& ion::color4< T >::operator= ( color3< T > const &  col)
inline

color3 assignment

template<typename T>
template<typename U >
color4<T>& ion::color4< T >::operator= ( color3< U > const &  col)
inline

Generic color3 assignment.

Member Data Documentation

template<typename T>
T & ion::color4< T >::Alpha
template<typename T>
T & ion::color4< T >::Blue
template<typename T>
T & ion::color4< T >::Green
template<typename T>
T& ion::color4< T >::Red

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