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

2 dimensional integer vector. More...

#include <geom.hpp>

Public Member Functions

 ivec2 ()
 
 ivec2 (int x, int y)
 
 ivec2 (const vec2 &v)
 
 ivec2 (const ivec &v)
 
int & operator[] (int i)
 
int operator[] (int i) const
 
bool operator== (const ivec2 &o) const
 
bool operator!= (const ivec2 &o) const
 
bool iszero () const
 
ivec2shl (int n)
 
ivec2shr (int n)
 
ivec2mul (int n)
 
ivec2div (int n)
 
ivec2add (int n)
 
ivec2sub (int n)
 
ivec2mul (const ivec2 &v)
 
ivec2div (const ivec2 &v)
 
ivec2add (const ivec2 &v)
 
ivec2sub (const ivec2 &v)
 
ivec2mask (int n)
 
ivec2neg ()
 
ivec2min (const ivec2 &o)
 
ivec2max (const ivec2 &o)
 
ivec2min (int n)
 
ivec2max (int n)
 
ivec2abs ()
 
int dot (const ivec2 &o) const
 
int cross (const ivec2 &o) const
 

Public Attributes

union {
   struct {
int x
 
int y
 
   } 
 
int v [2]
 
}; 
 

Friends

std::ostream & operator<< (std::ostream &os, const ivec2 &v)
 Output operator, used for simple << ivec2 << functionality: output of form "(x, y)". More...
 

Detailed Description

2 dimensional integer vector.

Constructor & Destructor Documentation

ivec2::ivec2 ( )
inline
ivec2::ivec2 ( int  x,
int  y 
)
inline
ivec2::ivec2 ( const vec2 v)
inlineexplicit
ivec2::ivec2 ( const ivec v)
inlineexplicit

Member Function Documentation

ivec2& ivec2::abs ( )
inline
ivec2& ivec2::add ( int  n)
inline

Referenced by mergevslot().

ivec2& ivec2::add ( const ivec2 v)
inline
int ivec2::cross ( const ivec2 o) const
inline
ivec2& ivec2::div ( int  n)
inline
ivec2& ivec2::div ( const ivec2 v)
inline
int ivec2::dot ( const ivec2 o) const
inline
bool ivec2::iszero ( ) const
inline

Referenced by mergevslot(), and propagatevslot().

ivec2& ivec2::mask ( int  n)
inline
ivec2& ivec2::max ( const ivec2 o)
inline
ivec2& ivec2::max ( int  n)
inline

References inexor::rpc::max().

ivec2& ivec2::min ( const ivec2 o)
inline

References inexor::rpc::min().

ivec2& ivec2::min ( int  n)
inline

References inexor::rpc::min().

ivec2& ivec2::mul ( int  n)
inline
ivec2& ivec2::mul ( const ivec2 v)
inline
ivec2& ivec2::neg ( )
inline
bool ivec2::operator!= ( const ivec2 o) const
inline
bool ivec2::operator== ( const ivec2 o) const
inline
int& ivec2::operator[] ( int  i)
inline
int ivec2::operator[] ( int  i) const
inline
ivec2& ivec2::shl ( int  n)
inline
ivec2& ivec2::shr ( int  n)
inline
ivec2& ivec2::sub ( int  n)
inline
ivec2& ivec2::sub ( const ivec2 v)
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ivec2 v 
)
friend

Output operator, used for simple << ivec2 << functionality: output of form "(x, y)".

Member Data Documentation

union { ... }

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