The fastest way would be to compare two "boxes" in 3D space.
You simply check if any one of the box A's points are inside box B.
Since SceneKit's "getBoundingBoxMin:Max:" is still broken, you will have to make up with the locations of the points yourself.
Simply create some variables for your points, and extend their locations based on the node's position.
If your game is not moving around vertically so much, you may not need to compare all the points of the two boxes. Instead just compare the 2D locations as if the world was flattened. (Or even go further to simply compare the node's singular point position against a 2D box)
That would be the most efficient way.
Both SceneKit's physics engine and doing a distance calculation, (as gchiste proposed), would be heavier than comparing box points. - And it is not much effort to compare points like that.
Topic:
Graphics & Games
SubTopic:
Metal
Tags: