Libprimis
Imprimis' 3D destroyable world engine
Loading...
Searching...
No Matches
ivec Struct Reference

Public Member Functions

 ivec (const vec &v)
 
 ivec (int a, int b, int c)
 
 ivec (int d, int row, int col, int depth)
 
 ivec (int i, const ivec &co, int size)
 
 ivec (const ivec2 &v, int z=0)
 
 ivec (const svec &v)
 
int & operator[] (int i)
 
int operator[] (int i) const
 
bool operator== (const ivec &v) const
 
bool operator!= (const ivec &v) const
 
ivec operator+ (const ivec &v) const
 
 operator bool () const
 Type conversion operator from ivec -> bool.
 
ivecshl (int n)
 
ivecshr (int n)
 
ivecmul (int n)
 
ivecdiv (int n)
 
ivecadd (int n)
 
ivecsub (int n)
 
ivecmul (const ivec &v)
 
ivecdiv (const ivec &v)
 
ivecadd (const ivec &v)
 
ivecsub (const ivec &v)
 
ivecmask (int n)
 
ivecneg ()
 
ivecmin (const ivec &o)
 
ivecmax (const ivec &o)
 
ivecmin (int n)
 
ivecmax (int n)
 
ivecabs ()
 
ivecclamp (int l, int h)
 
iveccross (const ivec &a, const ivec &b)
 
int dot (const ivec &o) const
 
float dist (const plane &p) const
 

Static Public Member Functions

static ivec floor (const vec &o)
 
static ivec ceil (const vec &o)
 

Public Attributes

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

Member Function Documentation

◆ operator bool()

ivec::operator bool ( ) const
inlineexplicit

Type conversion operator from ivec -> bool.

If this ivec is identical to the origin (0,0,0), returns false; for any other values of (x,y,z) returns true. This is behavior analogous to int in three dimensions.


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