(I paused and had dinner in the middle of writing this post...)
But how would that work if the top of the building is hit compared to the bottom? Would the entire building still have to be replaced with smaller bodies as required?
Good question. In fact it's the perfect thing to describe the whole system with! The following would be a simple (rollcage-like) building:
When the spawn function from the script is run, it does not create any body at all! It just places one geom for the main building. And sets up a damage threshold and buffer and script to run when the buffer reaches zero.
When the "event script" gets called, it removes this geom and replaces it with smaller loose parts (and spawns an explosion). These parts will be pairs of one geom (for collision detection) and one body (to allow it to fly around).
This way, the building will not have a body, nor any joints to keep it locked to the ground, and when it gets destroyed, it will still just be a few pairs of geom+body which will only take the same amount of performance as the good old "simple box".
I know what you're thinking, "not the most realistic and interesting building"...?

Well, that was just an introduction! lets instead build a classic rollcage building!
spawn script) creates
no bodies, but several geoms: boxes/capsules for pillars, and a few boxes to describe the strange building itself. the pillars gets force threshold and health buffers (while the other geoms are indestructible).
event script) called for each pillar geom, keeps track of how many pillars left, and one there are 0 pillars left, call some other script
some other script) takes car of lowering the building geoms into ground for each step, spawns an explosion, and creates a few pieces of the building (one geom+body for each).
pieces events) when the geom of a piece of the building gets a health buffer of 0, it is replaced by several smaller pieces (again a pair of one geom and one body, so it's fee to move).
finally, an attempt on a more complex creation: a more realistic building:
spawn script) creates no bodies. Using some kind of looping algorithm it divides the building into several geoms. and also puts geoms to simulate windows - all geoms got a force threshold and buffer.
window geom event script) remove the window (play sound of breaking window and spawn a "crushed glass" animation where it used to be)
other geom event script) make the piece of the building moveable by creating a body and attaching the geom to that body (and play some sound).
piece event script) well, the same as the last example.
It will be necessary to keep track of what geoms are above the one breaking, so that if just the bottom of the building is destroyed, the top falls as well (and doesn't remain floating).
(I know you already know this, but: geom=collision geometry, body=moveable mass (assign geoms that should move to it). - since it now will be possible to read forces put on geoms without bodies, one only needs to add bodies once geoms are free to move)
---
Does an object not restricted by drag increase in velocity infinitely?
It does, but it will not accelerate in a linear fashion. Looking at it from an energy point of view, the needed energy for getting the velocity V is: M*V²/2. That means getting twice that velocity requires: M*(V*2)²/2=M*V²
*2²/2. - 4 times as much energy.
Basically, the faster a car goes, the less force is it able to accelerate with.
But right now, the tire simulation isn't the best... Hopefully it will be possible to have a low drag, motor_tweak of 1.0, and high motor_torque. And the only problem it will cause is a bit of wheelspin at start.
higher motor_tweak means more torque required to give the car a high end speed. This in turn m eans the car has TOO MUCH torque at low speed,
Yes, but thanks to some better tire friction simulation, the wheels will spin. At that point it might be necessary to add some kind of antispin...

use it to model a "broken" Rollcage car that sits in the sandbox and will eventually lose its wheels when hit around enough?
nice idea, would be fun! And given the possibility of making each geom react individual to forces, the main body could be damaged progressively at different parts (front bumpers falling of, rear wing cracking into two pieces and falling of... *drools*)
btw:
I got 8 yesterday before anything weird happened (which was the camera shaking. -_-) lol.
O_O and given how little performance the new system (that would allow buildings without bodies and without fixed joints - just optimized collision geoms) will take, it might be possible to simulate a whole city!
edit: I forgot to mention: I'm planing to add a boolean toggle for geoms to indicate if the forces should damage the geom's healt buffer or the body it is attached to (assuming it is attached to a body). this would be usefull if one only got two 3d models for the complete object: complete or broken (instead of having different several models for each part that can be destroyed/damaged/knocked off). it will then be possible to use several geoms to create a collision shape for one body, and then have that single body taking damage from all geoms' collisions (instead of each geom taking damage).
edit2: this is probably the last post before I return. Well, back in a few days, Bye!
