mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Fix jump snap-down: only ground when velocity is non-positive
Removed the '|| *groundH > feetZ' condition that was snapping player to ground during upward jumps when ground was above current position. Now only grounds when vertical velocity is <= 0 (falling or landing), preventing premature grounding during jump arc.
This commit is contained in:
parent
4ca4d1e509
commit
9090fb8727
1 changed files with 1 additions and 2 deletions
|
|
@ -541,8 +541,7 @@ void CameraController::update(float deltaTime) {
|
|||
|
||||
// WoW-style: snap to floor if within step-up or fall-catch range,
|
||||
// but only when not moving upward (jumping)
|
||||
if (dz <= stepUp && dz >= -fallCatch &&
|
||||
(verticalVelocity <= 0.0f || *groundH > feetZ)) {
|
||||
if (dz <= stepUp && dz >= -fallCatch && verticalVelocity <= 0.0f) {
|
||||
targetPos.z = *groundH;
|
||||
verticalVelocity = 0.0f;
|
||||
grounded = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue