Mesh operations

It's time to implement intersection tests for the mesh object. We want to test the mesh for intersection against all of the primitive shapes we have implemented. The only shapes that we will not test for intersection are points and other meshes.

Getting ready

We are about to implement seven new functions. These functions test for intersection between a mesh and a number of primitives. We will not be performing a mesh to mesh intersection test because it would require looping through the triangle list of each mesh in a nested fashion. This nested loop would become very expensive.

Because most of the functions we are about to implement look the exact same, I will list the full source of MeshRay and MeshAABB here. MeshAABB will contain ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.