mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
The walls should not push back so violently lets make this softer
This commit is contained in:
parent
3eb64dd9dd
commit
a503583b6b
1 changed files with 4 additions and 1 deletions
|
|
@ -2058,7 +2058,10 @@ bool WMORenderer::checkWallCollision(const glm::vec3& from, const glm::vec3& to,
|
|||
float absNz = std::abs(normal.z);
|
||||
if (absNz >= 0.45f) continue;
|
||||
|
||||
float pushDist = PLAYER_RADIUS - horizDist + 0.02f;
|
||||
const float SKIN = 0.007f; // small separation so we don’t re-collide immediately
|
||||
const float MAX_PUSH = 0.08f; // cap per triangle contact (tune 0.10–0.25)
|
||||
float penetration = (PLAYER_RADIUS - horizDist);
|
||||
float pushDist = glm::clamp(penetration + SKIN, 0.0f, MAX_PUSH);
|
||||
glm::vec2 pushDir2;
|
||||
if (horizDist > 1e-4f) {
|
||||
pushDir2 = glm::normalize(glm::vec2(delta.x, delta.y));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue