by Julio Jerez » Tue Oct 06, 2009 10:19 am
The braking is a complex calculation, but they result is a data structure that is easy and fast to use.
For real time you are limited to no more than two three or four debris pieces, but for reconstructed demolished bodies it is only limited to how fast a visual body can be enable, and how much rigid body can be created in real time.
You can easily create 20 to 30 bodies in Newton, if every thong is recalculated,
So if you Game engine support the pre created of Visual mesh that are invisible and not affect the engine performance until they are active, then it should not be a problem.
Furthermore if the graphics engine support meshes Instances, then is should be fast and low memory consumption if you reuse the shapes for equal pieces.
For example you can have a crate that is an instance that you can use it many times.
If you make the crate destructible and reuse the collision shape, then same debris geometry and Collision is use everywhere,
By tagging the debris pieces with special ID or Material the you can remove pieces from the since when the member of debris is too high and too old,
you can do that by using a Queue with, then when the Queue reach some size you just delete pieces from the top until it is back to the desire size.
That way you can have debris that are persistence as long as the count is acceptable for the engine.
This feature does not stop there; you can also make cut on geometry like Holes, carving, unions, and intersection on any mesh.
In the next version 2.11
There will be the Compound breakable that will support partial compound destruction.
For example you can have an entire building made from solid pieces, very much like the technique that Quake and Half life engine editor use,
The entire building will be converted compound collision,The engine will generate the mesh for visualization that you will convert to a mesh for your graphics engine.
Then at run time each time wall is hit or any part of the body, if the impact in larger that the max impact impulse at that point, then you get a call back.
In the call back you can querie what part will be peel off from the compound to be converted into debri, you can do that by volume queries using the impact strength for the size of the volume.
Then for each peel off piece you issue a new debris pieces just like in the prefab SDK demo.
you cann VisualMeshUpdate to and new Index list to regenerate the base mesh using the same vertex array.
Finally it will report the New Partial compound, for example say there is a tall column, and it is hit in the center,
then the pieces intersected by the hit volume will be loose debris pieces, but the top and the bottom could be two different partial compounds.
Using this you can make entire destructible buildings and even stuff like space stations that are dynamics.
How does that sound to you, you thing Ogre can deal with that?