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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access