Terrain collision exception

I would typically agree, but in this case I think throwing this error is so useless that it doesn’t even cause the app to gracefully fail when collisions actually are broken. It also seems extra concerning that the Geometry class doesn’t do the same thing, and both use refreshFlags in the exact same way since they both extend Spatial, and the only extra code in the terrain class related to refreshFlags just throws this seemingly useless exception.

I have never seen this error thrown when one of my terrains was actually broken with collisions and needed entirely re-created, and I’ve only ever encountered this error as a result of this bug when a terrain is attached during a lag spike, and by the next frame the collisions are working again so it isn’t even catching a real problem in this case, its just throwing an error in cases where anything is trying to collide with a terrain that is taking an extra frame or two to be ready for some strange reason.

Yes since I made the change on my own fork I have never had any trouble with terrain collision. It was also about 4 years ago I originally ran into this error when I first started working on my own terrain editor, so in that time I have never experienced any other problem as a result of removing this exception.

Edit: I opened a PR to replace the Exception with just a warning

4 Likes