NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.11k stars 793 forks source link

Is there any guide to scale a joint ? #602

Open haolly opened 1 year ago

haolly commented 1 year ago

I have created a normal ragdoll which use D6Joint, and now I want to make it work the same avatar which varying scale size.

Is there any document I can reference?

preist-nvidia commented 1 year ago

Hi - you should be able to just scale the local pose position of the joint and it should work. I.e. have a look at setLocalPose

E.g. local pose position of joint on actor with scale 1 is PxVec3(0.5, 1.0, 2.0) and you scale with a factor of 5, you should update to 5.0 * PxVec3(0.5, 1.0, 2.0).

haolly commented 1 year ago

Do I need to scale the rigidbody's mass and(or) Center Mass local pose ?

The shape also needs to scale definitely, I guess.