diff options
| author | aura <nw@moneybot.cc> | 2026-03-03 23:35:50 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-03-03 23:35:50 +0100 |
| commit | 7466c0415415052cda55f02befb720d2a348b6c9 (patch) | |
| tree | c0f2ada5142baf75a83eae875c5c5dba68f06bdd /src/game/physics/movement.cpp | |
| parent | e57cac01b0a4eb764185e8eca9396a25b83f34d3 (diff) | |
smoother walls
Diffstat (limited to 'src/game/physics/movement.cpp')
| -rw-r--r-- | src/game/physics/movement.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/game/physics/movement.cpp b/src/game/physics/movement.cpp index b2b2ffa..61b1cc4 100644 --- a/src/game/physics/movement.cpp +++ b/src/game/physics/movement.cpp @@ -257,7 +257,7 @@ F32 gmove_try_move( BSP_TRACE* t, VEC3* pos, VEC3* vel ) { F32 dot = vec_dot( *vel, t->normal ); *pos += wishmove * t->frac; // nudge player away from wall - *pos += t->normal * BSP_TRACE_EPSILON * 2.f; + *pos += t->normal * BSP_TRACE_EPSILON; // avoid clipping planes twice // in a rare edge case its possible to get stuck in the plane again after pushing away from it @@ -435,14 +435,11 @@ void gmove_step_move( VEC3 dest, BSP_TRACE* tr ) { VEC3 up = pos, down = pos; VEC3 upvel = vel, downvel = vel; - F32 groundn = 0.f; if( gmove->ground ) { VEC3 ground = pos; ground.z += 2.f; bsp_trace( tr, gmove->bsp, gmove->aabb, pos, ground ); - if( tr->hit ) - groundn = tr->normal.z; } // try moving forward first @@ -504,9 +501,6 @@ void gmove_step_move( VEC3 dest, BSP_TRACE* tr ) { gmove->pos += delta; if( tr->normal.z < 0.99f ) gmove->pos += tr->normal * BSP_TRACE_EPSILON * 2.f; - // hack : moving to a steeper slope, move up a bit to avoid getting stuck in the edge - if( gmove->ground && tr->normal.z < groundn ) - gmove->pos.z += BSP_TRACE_EPSILON; gmove->velocity = upvel; gmove->velocity.z = downvel.z; } |
