remove physics part of iengine

master
Daniel Kolesa 2020-07-29 03:27:11 +02:00
parent 504b110305
commit 4cdc9c6db5
9 changed files with 32 additions and 27 deletions

View File

@ -1,3 +1,4 @@
#include "physics.hh"
#include "rendermodel.hh" // loadmapmodel
#include "stain.hh"
#include "texture.hh"

View File

@ -1,5 +1,6 @@
#include "dynlight.hh"
#include "physics.hh" // collide
#include "pvs.hh"
#include "rendergl.hh" // camera1
#include "renderva.hh"

View File

@ -7,6 +7,7 @@
#include "material.hh"
#include "octa.hh"
#include "octarender.hh"
#include "physics.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "renderlights.hh"

View File

@ -3,10 +3,36 @@
#include <shared/geom.hh>
struct dynent;
struct physent;
struct extentity;
struct entity;
extern vec collidewall;
extern int collideinside;
extern physent *collideplayer;
bool overlapsdynent(const vec &o, float radius);
void rotatebb(vec &center, vec &radius, int yaw, int pitch, int roll = 0);
float shadowray(const vec &o, const vec &ray, float radius, int mode, extentity *t = NULL);
void moveplayer(physent *pl, int moveres, bool local);
bool moveplayer(physent *pl, int moveres, bool local, int curtime);
void crouchplayer(physent *pl, int moveres, bool local);
bool collide(physent *d, const vec &dir = vec(0, 0, 0), float cutoff = 0.0f, bool playercol = true, bool insideplayercol = false);
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);
void updatephysstate(physent *d);
void cleardynentcache();
void updatedynentcache(physent *d);
bool entinmap(dynent *d, bool avoidplayers = false);
#endif

View File

@ -9,6 +9,7 @@
#include "pvs.hh"
#include "octaedit.hh"
#include "octarender.hh" // valist
#include "physics.hh" // movecamera
#include "rendergl.hh"
#include "renderlights.hh"
#include "rendermodel.hh"

View File

@ -5,6 +5,7 @@
#include "console.hh" /* conoutf */
#include "main.hh" // loadprogress, renderprogress
#include "octarender.hh"
#include "physics.hh" // collidewall
#include "pvs.hh"
#include "rendergl.hh"
#include "renderva.hh"

View File

@ -1,6 +1,7 @@
#include "cube.hh"
#include <engine/octaedit.hh>
#include <engine/physics.hh>
#include <engine/worldio.hh>
#include <engine/world.hh>

View File

@ -84,29 +84,3 @@ extern void loopend(ident *id, identstack &stack);
#define loopstart(id, stack) if((id)->type != ID_ALIAS) return; identstack stack;
static inline void loopiter(ident *id, identstack &stack, int i) { tagval v; v.setint(i); loopiter(id, stack, v); }
static inline void loopiter(ident *id, identstack &stack, float f) { tagval v; v.setfloat(f); loopiter(id, stack, v); }
// physics
extern vec collidewall;
extern int collideinside;
extern physent *collideplayer;
extern void moveplayer(physent *pl, int moveres, bool local);
extern bool moveplayer(physent *pl, int moveres, bool local, int curtime);
extern void crouchplayer(physent *pl, int moveres, bool local);
extern bool collide(physent *d, const vec &dir = vec(0, 0, 0), float cutoff = 0.0f, bool playercol = true, bool insideplayercol = false);
extern bool bounce(physent *d, float secs, float elasticity, float waterfric, float grav);
extern bool bounce(physent *d, float elasticity, float waterfric, float grav);
extern void avoidcollision(physent *d, const vec &dir, physent *obstacle, float space);
extern bool overlapsdynent(const vec &o, float radius);
extern bool movecamera(physent *pl, const vec &dir, float dist, float stepdist);
extern void physicsframe();
extern void dropenttofloor(entity *e);
extern bool droptofloor(vec &o, float radius, float height);
extern void vecfromyawpitch(float yaw, float pitch, int move, int strafe, vec &m);
extern void vectoyawpitch(const vec &v, float &yaw, float &pitch);
extern void updatephysstate(physent *d);
extern void cleardynentcache();
extern void updatedynentcache(physent *d);
extern bool entinmap(dynent *d, bool avoidplayers = false);
extern void findplayerspawn(dynent *d, int forceent = -1, int tag = 0);

View File

@ -54,7 +54,6 @@ namespace game
extern void updateworld();
extern void initclient();
extern void physicstrigger(physent *d, bool local, int floorlevel, int waterlevel, int material = 0);
extern void bounced(physent *d, const vec &surface);
extern void edittrigger(const selinfo &sel, int op, int arg1 = 0, int arg2 = 0, int arg3 = 0, const VSlot *vs = NULL);
extern void vartrigger(ident *id);
extern void dynentcollide(physent *d, physent *o, const vec &dir);