Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle terrain holes?
#4
(04-09-2024, 08:34 PM)btduser Wrote: Hmm, I'm on 7.0.2 and it doesn't seem to work for me. I thought the issue was related to me changing the hole data at runtime but even if I paint a hole in the terrain before starting the scene, the rope will not pass through. Is there anything particular I need to do? I just have a terrain with an obi collider - am I missing something? See the attached image for reference:

EDIT: Ok I sort of figured it out - in my test scene, I had the heightmap flattened down to zero. I'm looking at the logic in ObiHeightFieldContainer.cs where it reads the hole data but I'm not exactly sure how it explains what I was seeing before. I can work around the issue in practice, but the "invisible floor" at terrain height 0 is unexpected - not sure if it would be considered a bug.

Hi!

Terrain holes are encoded as the sign of the heightmap values: positive height means solid terrain, negative height means a hole. According to IEEE floating point standard, -0 is equal to 0, which means a hole at height zero is actually considered solid terrain (because -0 is not < 0). The alternative in this case would be to have -0 be less than 0, which would cause all terrain at height zero to be a hole - probably a worse option.

It’s not usual to have completely flat terrain with zero height, maybe in this case a MeshCollider would be a better fit? If you do need flat terrain, increasing its height uniformly to a non-zero value would be a valid workaround.

Let me know if you need further help,

Kind regards
Reply


Messages In This Thread
How to handle terrain holes? - by btduser - 04-09-2024, 04:55 PM
RE: How to handle terrain holes? - by josemendez - 04-09-2024, 07:38 PM
RE: How to handle terrain holes? - by btduser - 04-09-2024, 08:34 PM
RE: How to handle terrain holes? - by josemendez - 04-09-2024, 10:35 PM
RE: How to handle terrain holes? - by btduser - 04-09-2024, 11:04 PM
RE: How to handle terrain holes? - by josemendez - 05-09-2024, 07:53 AM
RE: How to handle terrain holes? - by btduser - 05-09-2024, 02:28 PM
RE: How to handle terrain holes? - by josemendez - 06-09-2024, 07:56 AM