Linetest Plane

A Line segment represented by end points A and B can be parametrically expressed as follows:

S(t) = A + t(B-A) where Linetest Plane

We can check if a line segment intersects a Plane by substituting the parametric equation of the Line into the Plane equation. If any point along the line at time t exists that satisfies the Plane equation, the Line segment and Plane intersect:

Linetest Plane

Getting ready

We are going to implement a function to test if a Line segment and a Plane intersect. This function will return a Boolean result.

How to do it…

Follow these steps to ...

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.