Hi Matty. I wonder if you could help clarify the whole process of setting up a rag doll. I've been through the code and it's all fairly straight forward, but the little 'hack' of waiting 1 sync and then repositioning objects isn't 100% clear.
So far the process appears to be:
1. Make a dynamic actor for each limb of the model, with some tweaks like setting local rotation and tweaking damping
2. Disable each of these by turning off collision and putting them to sleep
Game is looping, and you want to switch on the rag doll
1. Enable all dynamic actors, enabling collision, waking them up and then syncing them to their respective bone
2. Join these actors together with new joints
3. Wait for a simulate and sync (what state is the simulation in now?)
4. On the next loop, reposition the object to 0,0,0, rotation 0,0,0. Why?
I'm guessing what's actually happening is, the object needs to be at 0,0,0 so that limbs/dynamics objects are synced up properly? And DarkDynamix will be moving the limbs all over the place. So culling needs to be switched off for the model to be visible. If the origin isn't visible on screen.
If this is true, I wonder if it would be possible to have a dynamic actor attached to limb 0? The central hip limb or something could be connected to this limb 0 by a fixed joint, and since limb 0 affects base object properties, it should move the actual object around. The limb object is given 0 mass and has collision turns off, so it effectively isn't simulated or have any effect on the other actors in the rag doll.
Just throwing ideas out there, as not having the model culled isn't desirable. Although, I suppose it wouldn't take much to query the screen positions of the limbs and manually handle culling based on that.