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
plane Struct Reference

#include <geom.hpp>

Inheritance diagram for plane:
vec

Public Member Functions

float dist (const vec &p) const
 
float dist (const vec4 &p) const
 
bool operator== (const plane &p) const
 
bool operator!= (const plane &p) const
 
 plane ()
 
 plane (const vec &c, float off)
 
 plane (const vec4 &p)
 
 plane (int d, float off)
 
 plane (float a, float b, float c, float d)
 
void toplane (const vec &n, const vec &p)
 
bool toplane (const vec &a, const vec &b, const vec &c)
 
bool rayintersect (const vec &o, const vec &ray, float &dist)
 
planereflectz (float rz)
 
planeinvert ()
 
planescale (float k)
 
planetranslate (const vec &p)
 
planenormalize ()
 
float zintersect (const vec &p) const
 
float zdelta (const vec &p) const
 
float zdist (const vec &p) const
 
float & operator[] (int i)
 operators for accessing XYZ vector coordinates More...
 
float operator[] (int i) const
 
vecset (int i, float f)
 
bool operator== (const vec &o) const
 operators for vector comparisn More...
 
bool operator!= (const vec &o) const
 
vecabs ()
 Receive the absolute values of this vec. More...
 
bool iszero () const
 "do all cartesian coordinates (XYZ) of this vector have the value zero?" More...
 
float squaredlen () const
 calculate the squared length of this vector (pythagoras) More...
 
template<class T >
float dot2 (const T &o) const
 dot product (line by line) of 2 dimensions More...
 
float dot (const vec &o) const
 dot product (line by line) of all 3 dimensions More...
 
float absdot (const vec &o) const
 dot product with absolute values. More...
 
vecmul (const vec &o)
 scalar multiplication More...
 
vecmul (float f)
 
vecdiv (const vec &o)
 scalar division More...
 
vecdiv (float f)
 
vecadd (const vec &o)
 scalar sum More...
 
vecadd (float f)
 
vecsub (const vec &o)
 scalar subtraction More...
 
vecsub (float f)
 
vecneg2 ()
 turn XY coordinates into its negative values More...
 
vecneg ()
 turn all 3 (XYZ) coordinates into its negative values More...
 
vecmin (const vec &o)
 vector min/max-comparison and clamp methods More...
 
vecmin (float f)
 
vecmax (const vec &o)
 
vecmax (float f)
 
vecclamp (float f, float h)
 
float magnitude2 () const
 vector's magnitude in XY dimension More...
 
float magnitude () const
 vector's magnitude in all 3 (XYZ) dimensions More...
 
bool isnormalized () const
 "is this vector normalized?" More...
 
float squaredist (const vec &e) const
 distance calculation methods More...
 
float dist (const vec &e, vec &t) const
 
float dist2 (const vec &o) const
 
bool reject (const vec &o, float r)
 
template<class A , class B >
veccross (const A &a, const B &b)
 template based vector cross product More...
 
veccross (const vec &o, const vec &a, const vec &b)
 
float scalartriple (const vec &a, const vec &b) const
 scalar triple product can be used to calculate the volume of a 3 dimensional parallelogram More...
 
vecreflect (const vec &n)
 
vecproject (const vec &n)
 vector projection More...
 
vecprojectxydir (const vec &n)
 
vecprojectxy (const vec &n)
 
vecprojectxy (const vec &n, float threshold)
 
veclerp (const vec &b, float t)
 interpolation between two vectors More...
 
veclerp (const vec &a, const vec &b, float t)
 
template<class B >
vecmadd (const vec &a, const B &b)
 
template<class B >
vecmsub (const vec &a, const B &b)
 
vecrescale (float k)
 scale a vector to a certain length More...
 
vecrotate_around_z (float c, float s)
 vector rotation methods More...
 
vecrotate_around_z (float angle)
 
vecrotate_around_z (const vec2 &sc)
 
vecrotate_around_x (float c, float s)
 
vecrotate_around_x (float angle)
 
vecrotate_around_x (const vec2 &sc)
 
vecrotate_around_y (float c, float s)
 
vecrotate_around_y (float angle)
 
vecrotate_around_y (const vec2 &sc)
 
vecrotate (float c, float s, const vec &d)
 
vecrotate (float angle, const vec &d)
 
vecrotate (const vec2 &sc, const vec &d)
 
void orthogonal (const vec &d)
 orthogonal projection More...
 
void orthonormalize (vec &s, vec &t) const
 
template<class T >
bool insidebb (const T &bbmin, const T &bbmax) const
 is vector inside bounding box bounding boxes have a minimal vector and a maximal vector More...
 
template<class T , class U >
bool insidebb (const T &o, U size) const
 
template<class T >
float dist_to_bb (const T &min, const T &max) const
 calculate vector's distance to a bounding box More...
 
template<class T , class S >
float dist_to_bb (const T &o, S size) const
 

Static Public Member Functions

static vec hexcolor (int color)
 

Public Attributes

float offset
 
union {
   struct {
float x
 
float y
 
float z
 
   } 
 
   struct {
float r
 
float g
 
float b
 
   } 
 
float v [3]
 
}; 
 memory union which contains position, color or 3 float values please note that only one of these members can be accessed! More...
 

Constructor & Destructor Documentation

plane::plane ( )
inline
plane::plane ( const vec c,
float  off 
)
inline
plane::plane ( const vec4 p)
inline
plane::plane ( int  d,
float  off 
)
inline

References hmap::d.

plane::plane ( float  a,
float  b,
float  c,
float  d 
)
inline

Member Function Documentation

vec& vec::abs ( )
inlineinherited

Receive the absolute values of this vec.

Referenced by matrix3::abstransform().

float vec::absdot ( const vec o) const
inlineinherited

dot product with absolute values.

Referenced by matrix3::abstransposedtransform().

vec& vec::add ( const vec o)
inlineinherited

scalar sum

Referenced by physent::abovehead(), matrix3::abstransform(), triangle::add(), game::adddynlights(), addgrasstri(), addmergedverts(), addnormals(), addtris(), ragdolldata::applyrotlimit(), avoidcollision(), BIH::BIH(), blendfogoverlay(), bounce(), model::boundbox(), boxs(), ai::wpcache::build(), animmodel::mesh::buildnorms(), md5::md5mesh::buildverts(), partrenderer::calc(), ragdolldata::calcanimjoint(), calcavatarpos(), animmodel::calcbb(), ragdolldata::calcboundsphere(), calcgeombb(), vertmodel::vertmeshgroup::calctagmatrix(), skelmodel::skeleton::calctags(), animmodel::mesh::calctangents(), calcvert(), mpr::SolidCube::center(), blobrenderer::clip(), decalrenderer::clip(), mpr::collide(), ragdolldata::constraindist(), ai::delselwaypoints(), vec::dist_to_bb(), shadowmaptexture::dorender(), game::drawhudmodel(), game::drawminimap(), drawminimap(), game::collectclientmode::droptoken(), dynlightreaching(), game::dynlighttrack(), editmoveplane(), ellipsecollide(), gui::end(), entautoview(), entpaste(), entselectionbox(), game::explode(), game::explodeeffects(), physent::feetpos(), particleemitter::finalize(), fireballrenderer::finddepthfxranges(), findnormal(), ai::findorientation(), g3d_key(), genclipplanes(), gencubeverts(), generatelightmap(), generatelumel(), gengrassquads(), genpos(), genpos< PT_TRAIL >(), genprefabmesh(), skelmodel::skeleton::genragdollbones(), blobrenderer::gentris(), decalrenderer::gentris(), getentboundingbox(), dualquat::gettranslation(), game::gotoplayer(), game::gotosel(), guessnormals(), guessshadowdir(), physent::headpos(), fpsent::hitpush(), game::movable::hitpush(), game::hudgunorigin(), ragdolldata::init(), skelmodel::skeleton::initragdoll(), interppos(), quat::invertedrotate(), isshadowmapreceiver(), ai::jumpto(), lerpnormal(), lightreaching(), vec::madd(), menuinfrontofplayer(), mmcollide(), mpr::Model::Model(), modifygravity(), ragdolldata::move(), move(), movecamera(), moveplatform(), moveplayer(), moveragdoll(), ai::movewaypoints(), matrix4x3::mul(), game::newbouncer(), noedit(), game::offsetray(), particle_trail(), game::particletrack(), game::predictplayer(), previewblends(), previewlightmapalpha(), ai::process(), rayboxintersect(), raycubepos(), recalcdir(), recomputecamera(), regularshape(), ai::avoidset::remap(), flarerenderer::render(), render3dbox(), game::renderbouncers(), rendereditcursor(), renderellipse(), renderentarrow(), renderentbox(), renderentcone(), game::collectclientmode::rendergame(), renderlightning(), rendermodel(), game::renderplayerpreview(), game::renderprojectiles(), quat::rotate(), varenderer< T >::seedemitter(), seedpos(), seedpos< PT_TRAIL >(), setcammatrix(), setlerpstep(), ragdollskel::setupjoints(), setupsunlight(), setupsurface(), setupsurfaces(), setva(), game::shoot(), game::shorten(), game::shoteffects(), slideagainst(), animmodel::mesh::smoothnorms(), game::spawnbouncer(), game::spawnnextsplinter(), game::spawnsplinters(), blobrenderer::split(), mpr::EntOBB::supportpoint(), mpr::EntCapsule::supportpoint(), mpr::ModelOBB::supportpoint(), mpr::ModelEllipse::supportpoint(), game::swayhudgun(), switchfloor(), threeplaneintersect(), matrix4::transform(), matrix4::transformnormal(), trystepdown(), trystepup(), ragdolldata::tryunstick(), game::updatebouncers(), game::updateprojectiles(), and writeobj().

vec& vec::add ( float  f)
inlineinherited

References f().

vec& vec::clamp ( float  f,
float  h 
)
inlineinherited

Referenced by linkvslotshader().

template<class A , class B >
vec& vec::cross ( const A &  a,
const B &  b 
)
inlineinherited
vec& vec::cross ( const vec o,
const vec a,
const vec b 
)
inlineinherited

References vec::cross(), vec::sub(), and vec::vec().

Referenced by vec::cross().

float vec::dist ( const vec e,
vec t 
) const
inlineinherited

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

float plane::dist ( const vec p) const
inline
float plane::dist ( const vec4 p) const
inline

References vec4::dot3(), and offset.

float vec::dist2 ( const vec o) const
inlineinherited

Referenced by regularshape().

template<class T >
float vec::dist_to_bb ( const T &  min,
const T &  max 
) const
inlineinherited

calculate vector's distance to a bounding box

References loopi().

Referenced by calcdynlightmask(), vec::dist_to_bb(), findvisiblemms(), and vadist().

template<class T , class S >
float vec::dist_to_bb ( const T &  o,
size 
) const
inlineinherited

References vec::add(), and vec::dist_to_bb().

vec& vec::div ( const vec o)
inlineinherited
vec& vec::div ( float  f)
inlineinherited

References f().

float vec::dot ( const vec o) const
inlineinherited
template<class T >
float vec::dot2 ( const T &  o) const
inlineinherited
static vec vec::hexcolor ( int  color)
inlinestaticinherited
template<class T >
bool vec::insidebb ( const T &  bbmin,
const T &  bbmax 
) const
inlineinherited

is vector inside bounding box bounding boxes have a minimal vector and a maximal vector

template<class T , class U >
bool vec::insidebb ( const T &  o,
size 
) const
inlineinherited
plane& plane::invert ( )
inline

References vec::neg(), and offset.

bool vec::isnormalized ( ) const
inlineinherited

"is this vector normalized?"

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

Referenced by calcocclusion().

bool vec::iszero ( ) const
inlineinherited
vec& vec::lerp ( const vec b,
float  t 
)
inlineinherited
vec& vec::lerp ( const vec a,
const vec b,
float  t 
)
inlineinherited
template<class B >
vec& vec::madd ( const vec a,
const B &  b 
)
inlineinherited
float vec::magnitude ( ) const
inlineinherited
float vec::magnitude2 ( ) const
inlineinherited
vec& vec::max ( const vec o)
inlineinherited
vec& vec::max ( float  f)
inlineinherited

References inexor::rpc::max().

vec& vec::min ( const vec o)
inlineinherited

vector min/max-comparison and clamp methods

References inexor::rpc::min().

Referenced by BIH::BIH(), calcshadowmask(), genclipplanes(), and blobrenderer::gentris().

vec& vec::min ( float  f)
inlineinherited

References inexor::rpc::min().

template<class B >
vec& vec::msub ( const vec a,
const B &  b 
)
inlineinherited
vec& vec::mul ( const vec o)
inlineinherited

scalar multiplication

Referenced by matrix3::abstransform(), game::adddynlights(), flarerenderer::addflare(), addmergedverts(), addnormals(), addtris(), ragdolldata::applyrotlimit(), BIH::BIH(), bounce(), boxs3D(), md5::md5mesh::buildverts(), quat::calcangleaxis(), matrix3::calcangleaxis(), ragdolldata::calcanimjoint(), animmodel::calcbb(), dynlight::calccolor(), calcgeombb(), vertmodel::vertmeshgroup::calctagmatrix(), skelmodel::skeleton::calctags(), animmodel::mesh::calctangents(), calcvert(), blobrenderer::clip(), decalrenderer::clip(), mpr::collide(), vertmodel::vertmeshgroup::concattagtransform(), skelmodel::skeleton::concattagtransform(), ragdolldata::constraindist(), ai::delselwaypoints(), shadowmaptexture::dorender(), game::hideandseekclientmode::drawblip(), game::ctfclientmode::drawblip(), game::bombclientmode::drawblip(), game::collectclientmode::drawblip(), game::captureclientmode::drawblips(), drawfogdome(), game::drawhudmodel(), game::drawminimap(), drawminimap(), game::drawteammate(), server::ctfservermode::dropflag(), dynlightreaching(), editmoveplane(), gui::end(), entautoview(), entpaste(), entselectionbox(), game::explodeeffects(), particleemitter::finalize(), fireballrenderer::finddepthfxranges(), findents(), ai::findorientation(), genclipplanes(), gencubeverts(), generatelightmap(), generatelumel(), gengrassquads(), genpos(), genpos< PT_TAPE >(), genprefabmesh(), skelmodel::skeleton::genragdollbones(), genrotpos< PT_PART >(), blobrenderer::gentris(), decalrenderer::gentris(), dualquat::gettranslation(), game::gotoplayer(), game::gotosel(), guessshadowdir(), fpsent::hitpush(), game::movable::hitpush(), game::hudgunorigin(), ragdolldata::init(), skelmodel::skeleton::initragdoll(), interppos(), matrix3::invert(), matrix4x3::invert(), quat::invertedrotate(), isshadowmapreceiver(), lerpnormal(), lightreaching(), vec::madd(), flarerenderer::makelightflares(), menuinfrontofplayer(), mergevslot(), modifygravity(), modifyvelocity(), game::movable::movable(), ragdolldata::move(), movecamera(), moveplayer(), moveragdoll(), game::collectclientmode::movetoken(), vec::msub(), matrix3::mul(), matrix4x3::mul(), matrix3::multranspose(), matrix4x3::multranspose(), game::newbouncer(), noedit(), game::offsetray(), server::parsepacket(), game::parsepositions(), game::particletrack(), game::predictplayer(), previewblends(), previewlightmapalpha(), previewprefab(), server::bombservermode::pushentity(), rayboxintersect(), raycubelos(), raycubepos(), recalcdir(), regularshape(), flarerenderer::render(), game::renderbouncers(), rendereditcursor(), renderentarrow(), renderentcone(), renderlightning(), renderprefab(), game::renderprojectiles(), rendertexturepanel(), renderwater(), vec::rescale(), quat::rotate(), matrix3::rotate_around_x(), matrix4x3::rotate_around_x(), matrix3::rotate_around_y(), matrix4x3::rotate_around_y(), matrix3::rotate_around_z(), matrix4x3::rotate_around_z(), matrix3::scale(), matrix4x3::scale(), scale(), game::selectcrosshair(), game::sendposition(), setcammatrix(), setdynlights(), setlerpstep(), setupcaustics(), ragdollskel::setupjoints(), setupsunlight(), setupsurface(), setupsurfaces(), setva(), game::shoot(), game::shorten(), blobrenderer::split(), game::swayhudgun(), threeplaneintersect(), dualquat::transform(), matrix3::transform(), matrix4::transform(), matrix4x3::transformnormal(), matrix4::transformnormal(), game::triggerplatform(), trystepdown(), trystepup(), game::updatebouncers(), game::updatemovables(), and game::updateprojectiles().

vec& vec::mul ( float  f)
inlineinherited

References f().

vec& vec::neg ( )
inlineinherited
vec& vec::neg2 ( )
inlineinherited

turn XY coordinates into its negative values

plane& plane::normalize ( )
inline

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

Referenced by setvfcP().

bool vec::operator!= ( const vec o) const
inlineinherited
bool plane::operator!= ( const plane p) const
inline

References offset.

bool vec::operator== ( const vec o) const
inlineinherited

operators for vector comparisn

bool plane::operator== ( const plane p) const
inline

References offset.

float& vec::operator[] ( int  i)
inlineinherited

operators for accessing XYZ vector coordinates

float vec::operator[] ( int  i) const
inlineinherited
void vec::orthogonal ( const vec d)
inlineinherited
void vec::orthonormalize ( vec s,
vec t 
) const
inlineinherited

References vec::dot(), vec::sub(), and vec::vec().

Referenced by generatelumel().

vec& vec::project ( const vec n)
inlineinherited
vec& vec::projectxy ( const vec n)
inlineinherited
vec& vec::projectxy ( const vec n,
float  threshold 
)
inlineinherited
vec& vec::projectxydir ( const vec n)
inlineinherited

Referenced by vec::projectxy().

bool plane::rayintersect ( const vec o,
const vec ray,
float &  dist 
)
inline

References vec::dot().

Referenced by editmoveplane(), and gui::end().

vec& vec::reflect ( const vec n)
inlineinherited

References vec::dot().

Referenced by ragdolldata::move(), and ragdolldata::updatepos().

plane& plane::reflectz ( float  rz)
inline

Referenced by setvfcP().

bool vec::reject ( const vec o,
float  r 
)
inlineinherited
vec& vec::rescale ( float  k)
inlineinherited

scale a vector to a certain length

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

Referenced by calcavatarpos(), game::newbouncer(), vec::projectxy(), regularshape(), and ragdolldata::tryunstick().

vec& vec::rotate ( float  c,
float  s,
const vec d 
)
inlineinherited

References vec::vec().

Referenced by decalrenderer::adddecal().

vec& vec::rotate ( float  angle,
const vec d 
)
inlineinherited

References vec::rotate().

Referenced by vec::rotate().

vec& vec::rotate ( const vec2 sc,
const vec d 
)
inlineinherited

References vec::rotate().

Referenced by vec::rotate().

vec& vec::rotate_around_x ( float  c,
float  s 
)
inlineinherited

Referenced by calcmodelpreviewpos().

vec& vec::rotate_around_x ( float  angle)
inlineinherited

References vec::rotate_around_x().

Referenced by vec::rotate_around_x().

vec& vec::rotate_around_x ( const vec2 sc)
inlineinherited

References vec::rotate_around_x().

Referenced by vec::rotate_around_x().

vec& vec::rotate_around_y ( float  c,
float  s 
)
inlineinherited
vec& vec::rotate_around_y ( float  angle)
inlineinherited

References vec::rotate_around_y().

Referenced by vec::rotate_around_y().

vec& vec::rotate_around_y ( const vec2 sc)
inlineinherited

References vec::rotate_around_y().

Referenced by vec::rotate_around_y().

vec& vec::rotate_around_z ( float  c,
float  s 
)
inlineinherited
vec& vec::rotate_around_z ( float  angle)
inlineinherited

References vec::rotate_around_z().

Referenced by vec::rotate_around_z().

vec& vec::rotate_around_z ( const vec2 sc)
inlineinherited

References vec::rotate_around_z().

Referenced by vec::rotate_around_z().

float vec::scalartriple ( const vec a,
const vec b 
) const
inlineinherited

scalar triple product can be used to calculate the volume of a 3 dimensional parallelogram

Referenced by addcubeverts(), and mpr::collide().

plane& plane::scale ( float  k)
inline

References vec::mul().

vec& vec::set ( int  i,
float  f 
)
inlineinherited

References f().

Referenced by gui::end().

float vec::squaredist ( const vec e) const
inlineinherited
float vec::squaredlen ( ) const
inlineinherited
vec& vec::sub ( const vec o)
inlineinherited

scalar subtraction

Referenced by decalrenderer::adddecal(), flarerenderer::addflare(), addgrasstri(), addlight(), addnormals(), addtris(), ragdolldata::applyrotlimit(), avoidcollision(), BIH::BIH(), bounce(), game::bounced(), brightestlight(), ai::wpcache::build(), animmodel::mesh::buildnorms(), partrenderer::calc(), ragdolldata::calcanimjoint(), calcavatarpos(), animmodel::calcbb(), calcshadowmapbb(), calcshadowmask(), animmodel::mesh::calctangents(), ragdolldata::calctris(), blobrenderer::clip(), decalrenderer::clip(), mpr::collide(), ragdolldata::constraindist(), vec::cross(), damagecompass(), ai::delselwaypoints(), vec::dist(), ai::dointerest(), game::hideandseekclientmode::drawblip(), game::ctfclientmode::drawblip(), game::bombclientmode::drawblip(), game::collectclientmode::drawblip(), game::captureclientmode::drawblips(), game::drawminimap(), drawminimap(), game::drawteammate(), dynlightreaching(), editmoveplane(), ellipseboxcollide(), gui::end(), entautoview(), entselectionbox(), fireballrenderer::finddepthfxranges(), findents(), g3d_key(), genclipplanes(), generatelightmap(), generatelumel(), gengrassquads(), genpos(), genpos< PT_TAPE >(), skelmodel::skeleton::genragdollbones(), decalrenderer::gentris(), getentboundingbox(), dualquat::gettranslation(), guessshadowdir(), game::hudgunorigin(), ragdolldata::init(), ai::jumpto(), lerpnormal(), lightreaching(), linecylinderintersect(), ai::lockon(), flarerenderer::makelightflares(), mmcollide(), mmintersect(), gui::modelpreview(), ragdolldata::move(), moveplayer(), vec::msub(), game::newbouncer(), game::newprojectile(), game::offsetray(), vec::orthonormalize(), platformcollide(), plcollide(), flag::pos(), raycubelos(), raysphereintersect(), regularshape(), flarerenderer::render(), animmodel::part::render(), render3dbox(), rendereditcursor(), renderentradius(), renderlightning(), fireballrenderer::renderpart(), game::renderplayer(), game::bombclientmode::renderplayersposindicator(), game::renderprojectiles(), setdynlights(), setlerpstep(), ragdollskel::setupjoints(), setupsurface(), game::shorten(), animmodel::mesh::smoothnorms(), blobrenderer::split(), triangle::sub(), toplane(), matrix4x3::transposedtransform(), matrix4::transposedtransform(), BIH::triintersect(), trystepup(), game::updatebouncers(), and ragdolldata::updatepos().

vec& vec::sub ( float  f)
inlineinherited

References f().

void plane::toplane ( const vec n,
const vec p 
)
inline
bool plane::toplane ( const vec a,
const vec b,
const vec c 
)
inline
plane& plane::translate ( const vec p)
inline

References vec::dot().

float plane::zdelta ( const vec p) const
inline

Referenced by gengrassquads().

float plane::zdist ( const vec p) const
inline

References zintersect().

float plane::zintersect ( const vec p) const
inline

References offset.

Referenced by zdist().

Member Data Documentation

union { ... }

memory union which contains position, color or 3 float values please note that only one of these members can be accessed!

float plane::offset

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