-
Book Overview & Buying
-
Table Of Contents
Game Physics Cookbook
By :
We have two planar primitives in our geometry toolbox, the Plane and the Triangle. The collision normal for both primitives is the same as the normal of the primitive itself. We must keep in mind that if a ray hits a plane or triangle from behind, that is not actually a hit. This is not a bug, it's how raycasting against these primitives should work. The "forward" direction of a triangle is determined by counter clockwise winding.
When we modify the Raycast API for a plane or a triangle we break all the functions that internally use the old declaration. We must take care to update these broken functions as well. We will need to update the Linetest against triangle function and the MeshRay function.
Follow these steps to update the Raycast function for both triangles and planes so that the functions return more useful data:
Raycast against both the Plane and Triangle in Geometry3D.h:bool Raycast...