On 01/11/2017 at 13:28, xxxxxxxx wrote:
Hi,
Short of collapsing the entire scene into a single polygon object is there a simple way to do a GeRayCollider collision test with the entire scene?
Basically, I'm looking for something like:
https://docs.unity3d.com/ScriptReference/Physics.Raycast.htm
I'm trying to build a tool that allows me to easily drop an object onto the ground, but I don't want to force users to build a list of "ground" objects ahead of time.
If there isn't a built-in way of doing this, has anyone else already written ray/scene intersection code that would be willing to share?
My initial thoughts on how to approach it would be:
1. Collapse all objects into a single polygon object using SendModelingCommand, CurrentStateToObject & Connect. Unfortunately, this seems incredibly slow and memory inefficient.
2. Test all object bounding boxes to see if they are directly below the ray origin, then convert these to polys and test one at a time.
Also, if there isn't something like this readily available, I'd like to request that it be added to a future version of the SDK. Seems like a pretty common need.
Thanks,
Donovan