Chapter 10. 3D Line Intersections

In this chapter, we are going to cover linear intersections with 3D primitives. A linear intersection is a Raycast or line segment test. We will be covering the following tests:

  • Raycast Sphere
  • Raycast Axis Aligned Bounding Box
  • Raycast Oriented Bounding Box
  • Raycast plane
  • Linetest Sphere
  • Linetest Axis Aligned Bounding Box
  • Linetest Oriented Bounding Box
  • Linetest plane

Introduction

In this chapter, we are going to test if rays or line segments intersect primitives. The primitives that we are going to test against are Sphere, Axis Aligned Bounding Box (AABB), Oriented Bounding Box (OBB), and plane. Raycast intersections will return the distance along the ray that the intersection has happened. Line segment intersections will ...

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.