Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created October 21, 2022 13:21
Show Gist options
  • Select an option

  • Save wizard1066/aa5367815d9464aa134c928e146c4269 to your computer and use it in GitHub Desktop.

Select an option

Save wizard1066/aa5367815d9464aa134c928e146c4269 to your computer and use it in GitHub Desktop.
func intersects(point:SCNVector3, center:SCNVector3, radius:Float) -> Bool
{
let displacementToCenter = point - center;
let radiusSqr = radius * radius;
let intersects = displacementToCenter.magnitude < radiusSqr;
return intersects;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment