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

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

#include <color3.h>

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

Public Member Functions

 color3 ()
 Default constructor. More...
 
 color3 (T const in)
 Scalar constructor. More...
 
 color3 (T const r, T const g, T const b)
 Explicit constructor. More...
 
 color3 (color3< T > const &Other)
 Copy constructor. More...
 
 color3 (vec3< T > const &Other)
 Vector copy constructor. More...
 
template<typename U >
 color3 (color3< U > const &Other)
 Generic copy constructor. More...
 
color3< T > & operator= (color3< T > const &Other)
 Copy assignment operator. More...
 
template<typename U >
color3< T > & operator= (color3< U > const &Other)
 Generic copy assignment operator. More...
 
- Public Member Functions inherited from ion::vec3< T >
 vec3 ()
 Default constructor. More...
 
 vec3 (T const in)
 Scalar constructor. More...
 
 vec3 (T const x, T const y, T const z)
 Explicit constructor. More...
 
template<typename U >
 vec3 (glm::tvec3< U, glm::defaultp > const &v)
 GLM constructor. More...
 
template<typename U >
 vec3 (vec3< U > const &vec)
 Generic constructor. More...
 
 vec3 (vec2< T > const &vec, T const z=0)
 vec2 constructor (vec2, z) More...
 
 vec3 (T const x, vec2< T > const &vecYZ)
 vec2 constructor (x, 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 >
vec3< T > & operator= (vec3< 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 (vec3< 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 (vec3< T > const &other) const
 
T GetDistanceFrom (vec3< T > const &v) const
 
T const GetDistanceSqFrom (vec3< T > const &v) const
 
template<typename Real >
vec3< TGetInterpolated (vec3< T > const &v, Real const d) const
 
vec3< TGetNormalized () const
 
vec3< T > & Normalize ()
 Normalize this vector. More...
 
vec3< Toperator+ (vec3< T > const &v) const
 
vec3< Toperator- (vec3< T > const &v) const
 
vec3< Toperator* (vec3< T > const &v) const
 
vec3< Toperator/ (vec3< T > const &v) const
 
vec3< Toperator+ (T const s) const
 
vec3< Toperator- (T const s) const
 
vec3< Toperator* (T const s) const
 
vec3< Toperator/ (T const s) const
 
vec3< T > & operator+= (vec3< T > const &v)
 
vec3< T > & operator-= (vec3< T > const &v)
 
vec3< T > & operator*= (vec3< T > const &v)
 
vec3< T > & operator/= (vec3< T > const &v)
 
vec3< T > & operator+= (T const s)
 
vec3< T > & operator-= (T const s)
 
vec3< T > & operator*= (T const s)
 
vec3< T > & operator/= (T const s)
 
vec3< T > const operator- () const
 
bool operator< (vec3< T > const &v) const
 
bool operator== (vec3< T > const &v) const
 
bool operator!= (vec3< T > const &v) const
 
bool Equals (vec3< T > const &v, T const Epsilon=RoundingError< T >::Value()) const
 
vec3< TCrossProduct (vec3< T > const &v) const
 Vector cross product. More...
 
vec3< TCross (vec3< T > const &v) const
 Vector cross product. More...
 
glm::vec3 const ToGLM () const
 
void Transform (glm::mat4 const &mat, float const TranslateComponent=1)
 
vec3< TGetTransformed (glm::mat4 const &mat, float const TranslateComponent=1) const
 
vec3< TRotateAround (vec3< T > const &other, float const radians) const
 
vec2< TXY () const
 
vec2< TYZ () const
 
vec2< TXZ () const
 

Public Attributes

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

Additional Inherited Members

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

Detailed Description

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

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

Constructor & Destructor Documentation

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

Default constructor.

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

Scalar constructor.

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

Explicit constructor.

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

Copy constructor.

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

Vector copy constructor.

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

Generic copy constructor.

Member Function Documentation

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

Copy assignment operator.

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

Generic copy assignment operator.

Member Data Documentation

template<typename T>
T & ion::color3< T >::Blue
template<typename T>
T & ion::color3< T >::Green
template<typename T>
T& ion::color3< T >::Red

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