Browse Source

collide: Fix pusher if interior and surface point don't lie along normal

Currently, all tests I'm aware of put the surface point above the interior point (ie. along the normal), but there seems to be no good reason for this requirement, especially since a dot product is more efficient than a length().
rdb 5 years ago
parent
commit
1b7f3e4bbd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      panda/src/collide/collisionHandlerPusher.cxx

+ 1 - 1
panda/src/collide/collisionHandlerPusher.cxx

@@ -140,7 +140,7 @@ handle_entries() {
 
 
               ShoveData sd;
               ShoveData sd;
               sd._vector = normal;
               sd._vector = normal;
-              sd._length = (surface_point - interior_point).length();
+              sd._length = (surface_point - interior_point).dot(normal);
               sd._valid = true;
               sd._valid = true;
               sd._entry = entry;
               sd._entry = entry;