Browse Source

avatar should no longer float on landing

Dave Schuyler 22 years ago
parent
commit
43e5cd19e0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      panda/src/collide/collisionHandlerGravity.cxx

+ 2 - 1
panda/src/collide/collisionHandlerGravity.cxx

@@ -151,7 +151,7 @@ handle_entries() {
             << "Adjusting height by " << adjust << "\n";
             << "Adjusting height by " << adjust << "\n";
         }
         }
 
 
-        if (_current_velocity > 0.0f || adjust < -0.001f) {
+        if (_current_velocity > 0.0f || adjust) {
           // ...we have a vertical thrust,
           // ...we have a vertical thrust,
           // ...or the node is above the floor, so it is airborne.
           // ...or the node is above the floor, so it is airborne.
           float dt = ClockObject::get_global_clock()->get_dt();
           float dt = ClockObject::get_global_clock()->get_dt();
@@ -170,6 +170,7 @@ handle_entries() {
           _current_velocity -= _gravity * dt;
           _current_velocity -= _gravity * dt;
           // Record the airborne height in case someone else needs it: 
           // Record the airborne height in case someone else needs it: 
           _airborne_height = -max_height + adjust;
           _airborne_height = -max_height + adjust;
+          assert(_airborne_height>=0.0f);
         }
         }
 
 
         if (_airborne_height < 0.001f && _current_velocity < 0.001f) {
         if (_airborne_height < 0.001f && _current_velocity < 0.001f) {