diff options
| author | xolatile | 2025-07-17 23:28:55 +0200 |
|---|---|---|
| committer | xolatile | 2025-07-17 23:28:55 +0200 |
| commit | c79dda69d6e603500a5681430172b5152041af0a (patch) | |
| tree | c1669442318e77a9ae76009edd5eefcaa69064ce /src/engine/physics.cpp | |
| parent | 5b88d873f42b1cad5c5fd03888cfe45b82da06d6 (diff) | |
| download | xolatile-badassbug-c79dda69d6e603500a5681430172b5152041af0a.tar.xz xolatile-badassbug-c79dda69d6e603500a5681430172b5152041af0a.tar.zst | |
Big changed mentioned in IRC channel...
Diffstat (limited to 'src/engine/physics.cpp')
| -rw-r--r-- | src/engine/physics.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/engine/physics.cpp b/src/engine/physics.cpp index 6e78863..e1cd04d 100644 --- a/src/engine/physics.cpp +++ b/src/engine/physics.cpp @@ -13,7 +13,7 @@ static int clipcacheversion = -2; static inline clipplanes &getclipplanes(const cube &c, const ivec &o, int size, bool collide = true, int offset = 0) { clipplanes &p = clipcache[int(&c - worldroot)&(MAXCLIPPLANES-1)]; - if(p.owner != &c || p.version != clipcacheversion+offset) + if(p.owner != &c || p.version != clipcacheversion+offset) { p.owner = &c; p.version = clipcacheversion+offset; @@ -359,8 +359,8 @@ ShadowRayCache *newshadowraycache() { return new ShadowRayCache; } void freeshadowraycache(ShadowRayCache *&cache) { delete cache; cache = NULL; } -void resetshadowraycache(ShadowRayCache *cache) -{ +void resetshadowraycache(ShadowRayCache *cache) +{ cache->version++; if(!cache->version) { @@ -839,7 +839,7 @@ static inline bool clampcollide(const clipplanes &p, const E &entvol, const plan } return false; } - + template<class E> static bool fuzzycollideplanes(physent *d, const vec &dir, float cutoff, const cube &c, const ivec &co, int size) // collide with deformed cube geometry { @@ -1213,7 +1213,7 @@ bool trystepdown(physent *d, vec &dir, float step, float xy, float z, bool init stepfloor.normalize(); if(d->physstate >= PHYS_SLOPE && d->floor != stepfloor) { - // prevent alternating step-down/step-up states if player would keep bumping into the same floor + // prevent alternating step-down/step-up states if player would keep bumping into the same floor vec stepped(d->o); d->o.z -= 0.5f; d->zmargin = -0.5f; @@ -1493,14 +1493,14 @@ bool droptofloor(vec &o, float radius, float height) { static struct dropent : physent { - dropent() - { - type = ENT_BOUNCE; + dropent() + { + type = ENT_BOUNCE; vel = vec(0, 0, -1); } } d; d.o = o; - if(!insideworld(d.o)) + if(!insideworld(d.o)) { if(d.o.z < worldsize) return false; d.o.z = worldsize - 1e-3f; @@ -1525,16 +1525,16 @@ float dropheight(entity &e) switch(e.type) { case ET_PARTICLES: - case ET_MAPMODEL: return 0.0f; + case ET_MAPMODEL: + return 0.0f; default: - if(e.type >= ET_GAMESPECIFIC) return entities::dropheight(e); return 4.0f; } } void dropenttofloor(entity *e) { - droptofloor(e->o, 1.0f, dropheight(*e)); + droptofloor(e->o, 1.0f, 4.0f); } void phystest() |
