Sphere-to-plane

To check if a sphere intersects anything you follow a simple formula. Find the closest point to the sphere on the shape and use this point to find the distance between the sphere and the shape. Compare the resulting distance to the radius of the sphere. If the distance is less than the radius, there is a collision. Checking if a sphere and plane intersect follows this same formula:

Sphere-to-plane

Getting ready

We are going to implement a function to test if a sphere and a plane are intersecting. We will also use a #define macro to implement convenience functions to see if a plane intersects a sphere. This macro just switches the function name and ...

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.