From 43e5cd19e02d5f3d0d9835ee87e2216ec27b8357 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 20 Feb 2004 02:04:30 +0000 Subject: [PATCH] avatar should no longer float on landing --- panda/src/collide/collisionHandlerGravity.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/collide/collisionHandlerGravity.cxx b/panda/src/collide/collisionHandlerGravity.cxx index 4ac0729b44..06cbf9649c 100755 --- a/panda/src/collide/collisionHandlerGravity.cxx +++ b/panda/src/collide/collisionHandlerGravity.cxx @@ -151,7 +151,7 @@ handle_entries() { << "Adjusting height by " << adjust << "\n"; } - if (_current_velocity > 0.0f || adjust < -0.001f) { + if (_current_velocity > 0.0f || adjust) { // ...we have a vertical thrust, // ...or the node is above the floor, so it is airborne. float dt = ClockObject::get_global_clock()->get_dt(); @@ -170,6 +170,7 @@ handle_entries() { _current_velocity -= _gravity * dt; // Record the airborne height in case someone else needs it: _airborne_height = -max_height + adjust; + assert(_airborne_height>=0.0f); } if (_airborne_height < 0.001f && _current_velocity < 0.001f) {