I have a statictrianglegroup, I'm using it as a terrain and I'm doing raycast to get terrain height. So, I'm doing it from downwards
triangleStaticGroup.RayCast (new Vector3 (1000, -1, 1000), Vector.UnitY, 10000.0f ..)
instead of the usual top down.
triangleStaticGroup.RayCast (new Vector3 (1000, 10000, 1000), -Vector.UnitY, 10000.0f ..)
I find that it works on the edges (0,-1,0), but within the map, it returns 0. Would this be a bug?
Raycast in reverse
Re: Raycast in reverse
There's definitely a bug somewhere. I'll look into it.
Re: Raycast in reverse
On second glance, it turns out my test was accidentally using the X coordinate of the camera for both the X and Z coordinate of the raycast, explaining the problem I observed . I haven't found a bug yet.
If your triangle mesh ever drops below -1 on the y coordinate, that particular raycast will fail, but I assume that you have created the terrain so that it is always above that point.
If your triangle mesh ever drops below -1 on the y coordinate, that particular raycast will fail, but I assume that you have created the terrain so that it is always above that point.
Re: Raycast in reverse
Yes, my terrain is above 0
Re: Raycast in reverse
I think it's my collision proxy, it has a additional plane at Y = 0 that got exported. Sorry for the false alarm.