Selaa lähdekoodia

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 vuotta sitten
vanhempi
sitoutus
1b7f3e4bbd
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      panda/src/collide/collisionHandlerPusher.cxx

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

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