ray-polygon collision normals

This commit is contained in:
David Rose 2002-08-01 21:27:36 +00:00
parent 24c69cc00a
commit 5277c22302
1 changed files with 6 additions and 2 deletions

View File

@ -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;