Soften WMO wall pushback and fix fountain climbing

Cap WMO swept wall collision pushback to 0.15 units (was 0.55) so walls
stop the player without violent shoves. Fix M2 stepped fountain lateral
push using effectiveTop instead of rawMax.z so the near-top check matches
the stepped profile height at the player's radial position.
This commit is contained in:
Kelsi 2026-02-08 18:53:56 -08:00
parent f3a79f3246
commit af61e3d2c2
2 changed files with 11 additions and 3 deletions

View file

@ -2037,8 +2037,16 @@ bool WMORenderer::checkWallCollision(const glm::vec3& from, const glm::vec3& to,
float side = fromDist > 0.0f ? 1.0f : -1.0f;
glm::vec3 safeLocal = hitPoint + normal * side * (PLAYER_RADIUS + 0.05f);
glm::vec3 pushLocal(safeLocal.x - localTo.x, safeLocal.y - localTo.y, 0.0f);
localTo.x = safeLocal.x;
localTo.y = safeLocal.y;
// Cap swept pushback so walls don't shove the player violently
float pushLen = glm::length(glm::vec2(pushLocal.x, pushLocal.y));
const float MAX_SWEPT_PUSH = 0.15f;
if (pushLen > MAX_SWEPT_PUSH) {
float scale = MAX_SWEPT_PUSH / pushLen;
pushLocal.x *= scale;
pushLocal.y *= scale;
}
localTo.x += pushLocal.x;
localTo.y += pushLocal.y;
glm::vec3 pushWorld = glm::vec3(instance.modelMatrix * glm::vec4(pushLocal, 0.0f));
adjustedPos.x += pushWorld.x;
adjustedPos.y += pushWorld.y;