On my little world:
- The terrain is an icosphere, but the icosphere node is also the parent of everything that is on that sphere.
- I have a ray, from the camera position down to the center of the sphere.
- I need to find out the height at the point of the terrain under the camera position.
- I don’ t want icosphere.collideWith(ray, results) to iterate over all the children of this node. Just give me the spot where the ray hits the globe.
How could I do this?
The reason behind this is that I do this a lot every cycle and I assume iterating over a 1000 children is not good for performance.
So how to collide with just a single object?