🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

PhysX joints

Started by
5 comments, last by Matt_Aufderheide 4 years ago

I'm having trouble understanding how to configure joints in PhysX.. particularly the localFrame0 and localFrame1…
I create the rigidBodyDynamic actors in the proper place in world space and then connect each one to its parent using a spherical joint. But cant seem to figure out these joint setting.. the type of joint i'm trying to achieve is basically like this…

Parent actor should be also the anchor point for the child actor joint and so on.. (this is for simple a ragdoll simulation)

Advertisement

It's obvious, but maybe still helpful…

I've drawn to bodies shaped like a capsule, and they have their transform at body center of mass (most likely… it's also possible to use an offset transform to displace COM).

The joint has two offset transforms for each body it connects. Those offsets are in the local space of the bodies, and transform the origin to the position where the joint tries to achieve zero distance for both bodies.
The transformation of the local frames is shown by the grey arrows. It is like ‘jointSpace = BoneSpace * localFrame’. The origins should meet at your skeleton joint positions in setup pose ofc.

Physics engines usually have tool functions so you only give that position, and local offsets are calculated from that automatically.

Maybe you confuse those two options. But i never used PhysX and do not know. I assume it's similar like this for any physics engine.

Usually they also have debug view tools, e.g. to show joint limits. That's really helpful to proof your setup to be as intended.

Edit: If you use a cone limit for example, the orientation of the joint spave also matters. E.g. the limit cone might be aligned to parent x axis, and child x axis is kept inside this cone.

Yeah I have the positions working now.. but the orientation of the joints is messed up still… I think it's something wrong with my matrices… basically to get to the proper bone locations I use

inverse(transpose(boneOrientation)) *inverse(transpose(boneOffsetMatrix)) …but the angles are not right… i will keep trying.. thanks for the reply

Yeah i remember this sucks. I ended up with hard coded rotation offsets given by euler angles. Problem is for symmetric limits you very likely get issues because you do not have left handed space for left leg and right handed for right leg.
So i did trial and error with negating angles, subtracting 180 degrees, etc. until it was right.

My main problem now is that joints seem to stretch out way too much, even when there is not much force being applied… they just wont stay close enough…

One of the many reasons i was so impressed from Newton. Stiff joints, jitter is extremely rare, and supports large mass rations.

But PhysX became better i think? They showed some video with nice robotics recently. Maybe you need to select a better solver manually (e.g. ‘Featherstone’), or just increase (sub)iterations / reduce timestep.

Edit: Maybe such settings are per joint / ragdoll.

I don't think the solver count is the the problem here.. it's just that each of my joints seems to about twice the distance apart that it should be…I guess I still don't get how to set up the joints properly..

This topic is closed to new replies.

Advertisement