From 5277c22302a540c0cc967fcddbd97d25a9873af6 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 1 Aug 2002 21:27:36 +0000 Subject: [PATCH] ray-polygon collision normals --- panda/src/collide/collisionPolygon.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/collide/collisionPolygon.cxx b/panda/src/collide/collisionPolygon.cxx index bdcb7a2dc9..d600c472e8 100644 --- a/panda/src/collide/collisionPolygon.cxx +++ b/panda/src/collide/collisionPolygon.cxx @@ -424,7 +424,9 @@ test_intersection_from_ray(CollisionHandler *record, PT(CollisionEntry) new_entry = new CollisionEntry(entry); new_entry->set_into_intersection_point(plane_point); - new_entry->set_into_surface_normal(get_normal()); + + LVector3f into_normal = get_normal() * entry.get_inv_wrt_space(); + new_entry->set_into_surface_normal(into_normal); record->add_entry(new_entry); return 1; @@ -475,7 +477,9 @@ test_intersection_from_segment(CollisionHandler *record, PT(CollisionEntry) new_entry = new CollisionEntry(entry); new_entry->set_into_intersection_point(plane_point); - new_entry->set_into_surface_normal(get_normal()); + + LVector3f into_normal = get_normal() * entry.get_inv_wrt_space(); + new_entry->set_into_surface_normal(into_normal); record->add_entry(new_entry); return 1;