physx ragdoll, integrated, but need some player help.
by deepscratch · in Torque 3D Professional · 05/10/2009 (8:56 am) · 7 replies
so, I used the px formating that is used by the physx integration, and have managed to build a pxRagdoll. no errors, links fine, but I have no idea how to get player to call it. can a physx maestro maybe help me with this?
About the author
email me at medan121@gmail.com
Recent Threads
#2
So you would do something like this in Player::onAdd()....
The ragdoll would probably be created, but left disabled until needed.
The Player could would then wait till its time to ragdoll (death i would think), pass its transforms and velocity down to the PhysicsRagdoll object so it can set it all into motion.
Then down in rendering...
With an abstraction like that you should be able to implement a Bullet or ODE or Havok physics implementation without changing a line of stock T3D code.
Now the tricky bit.
You should only create the ragdoll on the server in single player modes or only on the client in release. It should never be both on the client and server as there is no good way to syncronize them.
Physics and networking is hard... impossibly hard.
06/25/2009 (11:24 pm)
Well i think ideally you would abstract that into an interface that is not PhysX specific that Torque's Player class creates and interacts with. Like a PhysicsRagdoll class.So you would do something like this in Player::onAdd()....
if ( gPhysicsPlugin ) mRagdoll = gPhysicsPlugin->createRagdoll( thePlayer );
The ragdoll would probably be created, but left disabled until needed.
The Player could would then wait till its time to ragdoll (death i would think), pass its transforms and velocity down to the PhysicsRagdoll object so it can set it all into motion.
if ( mRagdoll )
{
mShapeInstance->animate();
mRagdoll->toss( mShapeInstance, mVelocity );
}Then down in rendering...
if ( mRagdoll && mRagdoll->isEnabled() ) mRagdoll->getTransforms( mShapeInstance, mVelocity ); else mShapeInstance->animate();
With an abstraction like that you should be able to implement a Bullet or ODE or Havok physics implementation without changing a line of stock T3D code.
Now the tricky bit.
You should only create the ragdoll on the server in single player modes or only on the client in release. It should never be both on the client and server as there is no good way to syncronize them.
Physics and networking is hard... impossibly hard.
#3
though since GMK came out, I havent messed much more with it.
if anyone wants to try get it working properly, let me know and I'll upload the files.
its basicaly the physx sdk ragdoll, that I managed to compile within T3D without any errors.
oh, I've also got a solution for attaching the new pxCloth onto shapes, someone want to test it out?
06/26/2009 (2:52 am)
Tom, thanks for the explaination,though since GMK came out, I havent messed much more with it.
if anyone wants to try get it working properly, let me know and I'll upload the files.
its basicaly the physx sdk ragdoll, that I managed to compile within T3D without any errors.
oh, I've also got a solution for attaching the new pxCloth onto shapes, someone want to test it out?
#4
06/26/2009 (3:57 am)
I do DeepScratch!
#6
If the pxRagdoll handles itself, I can add the abstraction Tom suggested and write the code to retrieve/update the shape instance joint transforms.
06/26/2009 (6:01 am)
I was dwelling in the internals of the animation system recently (retrieving node positions from specific sequences at specific times), so I might be able to take a look at this during the weekend.If the pxRagdoll handles itself, I can add the abstraction Tom suggested and write the code to retrieve/update the shape instance joint transforms.
#7
I would like to see how you got the pxCloth to attatch because i am trying to do the same thing but with softBody
07/13/2009 (12:56 pm)
deepscratch, "I've also got a solution for attaching the new pxCloth onto shapes, someone want to test it out?" I would like to see how you got the pxCloth to attatch because i am trying to do the same thing but with softBody
Torque 3D Owner Disturbance