From 1e600848e774a10c1094571484c5b3f3f85ddf67 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 1 Jul 2003 16:49:49 +0000 Subject: [PATCH] some collisions don't have surface normals --- direct/src/directtools/DirectSelection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/src/directtools/DirectSelection.py b/direct/src/directtools/DirectSelection.py index 737a929945..94dcb2471d 100644 --- a/direct/src/directtools/DirectSelection.py +++ b/direct/src/directtools/DirectSelection.py @@ -476,6 +476,10 @@ class SelectionQueue(CollisionHandlerQueue): # If dot product of collision point surface normal and # ray from camera to collision point is positive, we are # looking at the backface of the polygon + if not entry.hasFromSurfaceNormal(): + # Well, no way to tell. Assume we're not backfacing. + return 0 + v = Vec3(entry.getFromIntersectionPoint()) n = entry.getFromSurfaceNormal() # Convert to camera space for backfacing test