From 1b7f3e4bbd54d4c4d8413e9eaeb0875a1315985e Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Jan 2021 14:51:42 +0100 Subject: [PATCH] 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(). --- panda/src/collide/collisionHandlerPusher.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/collide/collisionHandlerPusher.cxx b/panda/src/collide/collisionHandlerPusher.cxx index 7c3f6674c3..2595dd0367 100644 --- a/panda/src/collide/collisionHandlerPusher.cxx +++ b/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;