I have a 'big' tokamak system coded in my game.
Sweenie, I have to say you did an excellent job with the wrapper, ... you are on my Credits :)
It has happened a lot of time since I had a toka-bug, and it is working pretty much stable.
One tip when working with ragdolls (or whenever you use Joints)
ALWAYS delete the Joints BEFORE the RigidBodies,
the next is INCORRECT:
the next is the right way :)
But, to make it better, in my code, after freeing the Joints I'm leaving
the RBs alive for one more tick, and then I delete them.
If you free a joint after the RB that are connected to it, sooner or
later you will get a MAV at the TOKSIM_Advance().
This way, I have tested spawning and deleting more than 200 ragdolls and
everthing work fine, no memory leak, no MAVs, ... :)
Hope it helps!
Paolo.
Sweenie, I have to say you did an excellent job with the wrapper, ... you are on my Credits :)
It has happened a lot of time since I had a toka-bug, and it is working pretty much stable.
One tip when working with ragdolls (or whenever you use Joints)
ALWAYS delete the Joints BEFORE the RigidBodies,
the next is INCORRECT:
TOKRB_Free(RB) ;<- this is the RB connected with the joint TOKJOINT_Free(Joint)
the next is the right way :)
TOKJOINT_Free(Joint) TOKRB_Free(RB) ;<- this is the RB connected with the joint
But, to make it better, in my code, after freeing the Joints I'm leaving
the RBs alive for one more tick, and then I delete them.
If you free a joint after the RB that are connected to it, sooner or
later you will get a MAV at the TOKSIM_Advance().
This way, I have tested spawning and deleting more than 200 ragdolls and
everthing work fine, no memory leak, no MAVs, ... :)
Hope it helps!
Paolo.