开发者

PhysX: Joint friction/"stiff" joints

I'm working with physx (trying to add ik to ragdoll) at the moment. For some reason, all ragdoll joints are frictionless, and as a result, ragdoll tend to "wobble", 开发者_C百科especially when it is hung in the air and is connected to several moving kinematic actors.

I would like to add friction to the joints and make them "stiff". Imagine a door (with extremely rusty hinge) that needs to be kicked several times to be open - i.e. it rotates around the hinge, but not much, quickly stops, and large force is required to make it rotate. Or think about art manikins (see google images for pictures) - their limbs move around, but they do not swing around freely.

Unfortunately, I can't find anything related to joint friction in physx. I've checked documentation, google, and headers, and couldn't find anything useful.

So, how do I implement stiff joints/joint friction with physx? (I think) I've seen physx games without that problem, so apparently there should be some way to do that.

P.S. I'm not talking about joint/solver instability here. Ragdoll is stable (more or less), and joints honor degrees of freedom(joint limits), but joints have no friction, and I would like to add friction to them.


I've asked a question on the nvidia forums recently which might be related to this: link

Unfortunately I didn't get a real answer to my questions but managed to do what I want to do, using a spring in the joint might help you here if you only add a damping constant without a spring constant. This works in my case but I can't explain why so while I'm happy to use it I'm not totally sure whether to recommend it.

I don't know whether you could also add angular damping to all of the individual parts of the ragdoll, that would make them slow down quicker after they've started moving but it might not look right. Probably one of those things you will have to experiment with.


I found this forum thread about wobbly joints in Physx, dont know if you've seen it but I hope it helps.


Why don't you try that:

d6Desc.swingDrive.driveType.raiseFlagMask(NX_D6JOINT_DRIVE_VELOCITY); d6Desc.swingDrive.forceLimit = 0.1f; d6Desc.twistDrive.driveType.raiseFlagMask(NX_D6JOINT_DRIVE_VELOCITY); d6Desc.twistDrive.forceLimit = 0.1f; d6Desc.driveAngularVelocity.x = 0; d6Desc.driveAngularVelocity.y = 0; d6Desc.driveAngularVelocity.z = 0;

You drive the velocity to 0 with a small force, this way movement will be reduced and you objets will stop moving on the floor. It's not exactly like friction but near.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜