Hi All,
I am planning to use dynamic terrain extension for my ground. I will need a physics (ammo) for it as well. I suspect updating impostor mesh would be expensive. I plan to use much lower fixed LOD for physics of the terrain so should be alright. My question is: Is there some mechanism in dynamicTerrain that takes care of physics impostor when you cross the edge of the map and map starts over?
Bonus question: Is that recommended approach for large/infinite worlds with physics?
Any help appreciated.
I would do it like Minecraft handles its terrain: compute chunks of terrain depending on character position and recycle/dispose chunks when far enough. Some kind of quad tree with always 9 chunks in memory (3x3 chunks around the character). Now, for the size of each chunks, it depends on your use case. No magic values here. As long as you compute a new chunk every few seconds, it should be fine.
Thanks. I was hoping for some built in functionality but it seems its going to be a small project on its own. I have to do some more research on the mine-craft terrain.
The DynamicTerrain is basically a ribbon-like mesh updated according to the camera position in the world. So its BBox is computed. Not sure it would be what you require to manage an impostor.
Another approach would be to use a feature of the DT : the normal and the altitude at a given point of the map. With both these values you can easily detect if something intersects the terrain in some points and how it should react.
Thanks Jerome for suggesting that option. I got a lot of nice examples from your webpage. I am working on an airplane simulation with flight and vehicle (suspension) physics attached to it. Terrain is the last missing part. Simple collision checking wont work with btRaycastVehicle I think. I will need an impostor. I want the raycastvehicle as I might reuse that component of my code for other vehicles introduced later.