Ray Intersection

As I create more 3D tools that requires user interaction, its important to be able to handle ray interection on various shapes that may exist in the 3d scene. So this is a collection of various way to handle rays.

  1. Plane intersecting a plane that is defined by a point and normal dir.
  2. Points use a ray to intersect random points in 3d space.
  3. Segment / Line use a ray to test if it touches line in 3d space
  4. Triange How to test if a ray hits a single forward facing triangle.
  5. Quad Test if a ray hits a quad in 3d space.
  6. Circle How to rest if a ray hits a 2D circle in 3D space.
  7. Sphere How to test if a ray hits a sphere in 3d space.
  8. Axis Align Bounding Box (AABB) Test a ray on a 3D cube that does not rotate.
  9. Oriented Bounding Box (OBB) Testing a ray on a cube that may be rotated without transforming the ray to localspace.
  10. Capsule Test ray on a combination of an infinate cylinder and spheres.
  11. Voxel Chunk Test all the voxels a ray goes through in a voxel chunk.
  12. LocalSpace Transform a ray to local space of an object for testing.
  13. Mesh Loop through all the triangles of a mesh to test a ray.