mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Harden WMO grounding rescue to prevent fall-through
This commit is contained in:
parent
2219ccde51
commit
bdde5f305a
1 changed files with 15 additions and 4 deletions
|
|
@ -939,12 +939,23 @@ void CameraController::update(float deltaTime) {
|
||||||
noGroundTimer_ += physicsDeltaTime;
|
noGroundTimer_ += physicsDeltaTime;
|
||||||
|
|
||||||
float dropFromLastGround = lastGroundZ - targetPos.z;
|
float dropFromLastGround = lastGroundZ - targetPos.z;
|
||||||
bool seamSizedGap = dropFromLastGround <= (nearWmoSpace ? 1.0f : 0.35f);
|
bool seamSizedGap = dropFromLastGround <= (nearWmoSpace ? 2.5f : 0.35f);
|
||||||
if (noGroundTimer_ < NO_GROUND_GRACE && seamSizedGap) {
|
if (noGroundTimer_ < NO_GROUND_GRACE && seamSizedGap) {
|
||||||
// Micro-gap grace only: keep continuity for tiny seam misses,
|
// Near WMO floors, prefer continuity over falling on transient
|
||||||
// but never convert air into persistent ground.
|
// floor-query misses (stairs/planks/portal seams).
|
||||||
float maxSlip = nearWmoSpace ? 0.25f : 0.10f;
|
float maxSlip = nearWmoSpace ? 1.0f : 0.10f;
|
||||||
targetPos.z = std::max(targetPos.z, lastGroundZ - maxSlip);
|
targetPos.z = std::max(targetPos.z, lastGroundZ - maxSlip);
|
||||||
|
if (nearWmoSpace && verticalVelocity < -2.0f) {
|
||||||
|
verticalVelocity = -2.0f;
|
||||||
|
}
|
||||||
|
grounded = false;
|
||||||
|
} else if (nearWmoSpace && noGroundTimer_ < 1.0f && dropFromLastGround <= 3.0f) {
|
||||||
|
// Extended WMO rescue window: hold close to last valid floor so we
|
||||||
|
// do not tunnel through walkable geometry during short hitches.
|
||||||
|
targetPos.z = std::max(targetPos.z, lastGroundZ - 0.35f);
|
||||||
|
if (verticalVelocity < -1.5f) {
|
||||||
|
verticalVelocity = -1.5f;
|
||||||
|
}
|
||||||
grounded = false;
|
grounded = false;
|
||||||
} else {
|
} else {
|
||||||
grounded = false;
|
grounded = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue