Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
bvec Struct Reference

3-dimensional UNSIGNED CHAR vector. More...

#include <geom.hpp>

Public Member Functions

 bvec ()
 
 bvec (uchar x, uchar y, uchar z)
 
 bvec (const vec &v)
 
 bvec (const bvec4 &v)
 
ucharoperator[] (int i)
 
uchar operator[] (int i) const
 
bool operator== (const bvec &v) const
 
bool operator!= (const bvec &v) const
 
bool iszero () const
 
vec tonormal () const
 
bvecnormalize ()
 
void lerp (const bvec &a, const bvec &b, float t)
 
void lerp (const bvec &a, const bvec &b, int ka, int kb, int d)
 
void flip ()
 
void scale (int k, int d)
 
bvecshl (int n)
 
bvecshr (int n)
 
vec tocolor () const
 

Static Public Member Functions

static bvec fromcolor (const vec &v)
 
static bvec from565 (ushort c)
 

Public Attributes

union {
   struct {
uchar x
 
uchar y
 
uchar z
 
   } 
 
   struct {
uchar r
 
uchar g
 
uchar b
 
   } 
 
uchar v [3]
 
}; 
 

Detailed Description

3-dimensional UNSIGNED CHAR vector.

Constructor & Destructor Documentation

bvec::bvec ( )
inline

Referenced by from565(), and fromcolor().

bvec::bvec ( uchar  x,
uchar  y,
uchar  z 
)
inline
bvec::bvec ( const vec v)
inlineexplicit
bvec::bvec ( const bvec4 v)
inlineexplicit

Member Function Documentation

void bvec::flip ( )
inline
static bvec bvec::from565 ( ushort  c)
inlinestatic

References bvec().

static bvec bvec::fromcolor ( const vec v)
inlinestatic

References bvec().

bool bvec::iszero ( ) const
inline

Referenced by rendermaterials().

void bvec::lerp ( const bvec a,
const bvec b,
float  t 
)
inline
void bvec::lerp ( const bvec a,
const bvec b,
int  ka,
int  kb,
int  d 
)
inline
bvec& bvec::normalize ( )
inline

References f(), and vec::magnitude().

bool bvec::operator!= ( const bvec v) const
inline
bool bvec::operator== ( const bvec v) const
inline
uchar& bvec::operator[] ( int  i)
inline
uchar bvec::operator[] ( int  i) const
inline
void bvec::scale ( int  k,
int  d 
)
inline
bvec& bvec::shl ( int  n)
inline
bvec& bvec::shr ( int  n)
inline
vec bvec::tocolor ( ) const
inline

References f().

Referenced by blendfog(), drawminimap(), drawreflection(), and maskreflection().

vec bvec::tonormal ( ) const
inline

References f().

Member Data Documentation

union { ... }

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