Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Enumerations | Functions | Variables
physics.hpp File Reference
#include "inexor/shared/geom.hpp"

Go to the source code of this file.

Enumerations

enum  {
  RAY_BB = 1, RAY_POLY = 3, RAY_ALPHAPOLY = 7, RAY_ENTS = 9,
  RAY_CLIPMAT = 16, RAY_SKIPFIRST = 32, RAY_EDITMAT = 64, RAY_SHADOW = 128,
  RAY_PASS = 256, RAY_SKIPSKY = 512
}
 

Functions

bool pointincube (const clipplanes &p, const vec &v)
 
bool overlapsdynent (const vec &o, float radius)
 
void rotatebb (vec &center, vec &radius, int yaw)
 
float shadowray (const vec &o, const vec &ray, float radius, int mode, extentity *t=nullptr)
 
ShadowRayCachenewshadowraycache ()
 
void freeshadowraycache (ShadowRayCache *&cache)
 
void resetshadowraycache (ShadowRayCache *cache)
 
float shadowray (ShadowRayCache *cache, const vec &o, const vec &ray, float radius, int mode, extentity *t=nullptr)
 
float raycube (const vec &o, const vec &ray, float radius=0, int mode=RAY_CLIPMAT, int size=0, extentity *t=nullptr)
 
float raycubepos (const vec &o, const vec &ray, vec &hit, float radius=0, int mode=RAY_CLIPMAT, int size=0)
 
float rayfloor (const vec &o, vec &floor, int mode=0, float radius=0)
 
bool raycubelos (const vec &o, const vec &dest, vec &hitpos)
 
void moveplayer (physent *pl, int moveres, bool local)
 
bool moveplayer (physent *pl, int moveres, bool local, int curtime)
 
bool ellipseboxcollide (physent *d, const vec &dir, const vec &o, const vec &center, float yaw, float xr, float yr, float hi, float lo)
 
bool ellipsecollide (physent *d, const vec &dir, const vec &o, const vec &center, float yaw, float xr, float yr, float hi, float lo)
 
bool collide (physent *d, const vec &dir=vec(0, 0, 0), float cutoff=0.0f, bool playercol=true)
 
bool bounce (physent *d, float secs, float elasticity, float waterfric, float grav)
 
bool bounce (physent *d, float elasticity, float waterfric, float grav)
 
void avoidcollision (physent *d, const vec &dir, physent *obstacle, float space)
 
bool movecamera (physent *pl, const vec &dir, float dist, float stepdist)
 
void physicsframe ()
 
void dropenttofloor (entity *e)
 
bool droptofloor (vec &o, float radius, float height)
 
void vecfromyawpitch (float yaw, float pitch, int move, int strafe, vec &m)
 
void vectoyawpitch (const vec &v, float &yaw, float &pitch)
 
bool moveplatform (physent *p, const vec &dir)
 
void updatephysstate (physent *d)
 
void cleardynentcache ()
 
void updatedynentcache (physent *d)
 
bool entinmap (dynent *d, bool avoidplayers=false)
 
void findplayerspawn (dynent *d, int forceent=-1, int tag=0)
 

Variables

vec collidewall
 
bool collideinside
 
physentcollideplayer
 

Enumeration Type Documentation

anonymous enum
Enumerator
RAY_BB 
RAY_POLY 
RAY_ALPHAPOLY 
RAY_ENTS 
RAY_CLIPMAT 
RAY_SKIPFIRST 
RAY_EDITMAT 
RAY_SHADOW 
RAY_PASS 
RAY_SKIPSKY 

Function Documentation

void avoidcollision ( physent d,
const vec dir,
physent obstacle,
float  space 
)
bool bounce ( physent d,
float  secs,
float  elasticity,
float  waterfric,
float  grav 
)
bool bounce ( physent d,
float  elasticity,
float  waterfric,
float  grav 
)
void cleardynentcache ( )
bool collide ( physent d,
const vec dir = vec(0, 0, 0),
float  cutoff = 0.0f,
bool  playercol = true 
)
void dropenttofloor ( entity e)

References dropheight(), droptofloor(), and entity::o.

Referenced by dropentity().

bool droptofloor ( vec o,
float  radius,
float  height 
)
bool ellipseboxcollide ( physent d,
const vec dir,
const vec o,
const vec center,
float  yaw,
float  xr,
float  yr,
float  hi,
float  lo 
)
bool ellipsecollide ( physent d,
const vec dir,
const vec o,
const vec center,
float  yaw,
float  xr,
float  yr,
float  hi,
float  lo 
)
bool entinmap ( dynent d,
bool  avoidplayers = false 
)
void findplayerspawn ( dynent d,
int  forceent = -1,
int  tag = 0 
)
void freeshadowraycache ( ShadowRayCache *&  cache)
bool movecamera ( physent pl,
const vec dir,
float  dist,
float  stepdist 
)
bool moveplatform ( physent p,
const vec dir 
)
void moveplayer ( physent pl,
int  moveres,
bool  local 
)
bool moveplayer ( physent pl,
int  moveres,
bool  local,
int  curtime 
)
ShadowRayCache* newshadowraycache ( )
bool overlapsdynent ( const vec o,
float  radius 
)
void physicsframe ( )
bool pointincube ( const clipplanes p,
const vec v 
)
float raycube ( const vec o,
const vec ray,
float  radius = 0,
int  mode = RAY_CLIPMAT,
int  size = 0,
extentity t = nullptr 
)
bool raycubelos ( const vec o,
const vec dest,
vec hitpos 
)
float raycubepos ( const vec o,
const vec ray,
vec hit,
float  radius = 0,
int  mode = RAY_CLIPMAT,
int  size = 0 
)
float rayfloor ( const vec o,
vec floor,
int  mode = 0,
float  radius = 0 
)

References hitsurface, and raycube().

Referenced by partrenderer::calc().

void resetshadowraycache ( ShadowRayCache cache)
void rotatebb ( vec center,
vec radius,
int  yaw 
)
float shadowray ( const vec o,
const vec ray,
float  radius,
int  mode,
extentity t = nullptr 
)
float shadowray ( ShadowRayCache cache,
const vec o,
const vec ray,
float  radius,
int  mode,
extentity t = nullptr 
)
void updatedynentcache ( physent d)
void updatephysstate ( physent d)
void vecfromyawpitch ( float  yaw,
float  pitch,
int  move,
int  strafe,
vec m 
)
void vectoyawpitch ( const vec v,
float &  yaw,
float &  pitch 
)

Variable Documentation

bool collideinside
physent* collideplayer

Referenced by bounce().

vec collidewall