PhysX:关节摩擦/“僵硬”关节

发布于 2024-09-02 23:39:44 字数 454 浏览 3 评论 0原文

我目前正在与 physx 合作(尝试将 ik 添加到 ragdoll)。由于某种原因,所有布娃娃关节都是无摩擦的,因此布娃娃往往会“摇摆”,特别是当它悬挂在空中并连接到多个移动的运动演员时。

我想增加关节的摩擦力并使它们“僵硬”。想象一扇门(铰链极其生锈)需要踢几次才能打开——即它绕着铰链旋转,但幅度不大,很快就停止了,需要很大的力才能使其旋转。 或者想想艺术人体模型(参见谷歌图片)——它们的四肢可以移动,但不能自由摆动。

不幸的是,我在 physx 中找不到任何与关节摩擦有关的内容。我检查了文档、谷歌和标题,但找不到任何有用的东西。

那么,如何使用 physx 实现僵硬关节/关节摩擦? (我认为)我见过没有这个问题的 physx 游戏,所以显然应该有某种方法可以做到这一点。

PS 我不是在这里谈论联合/解算器的不稳定性。布娃娃是稳定的(或多或少),关节具有自由度(关节限制),但关节没有摩擦力,我想给它们添加摩擦力。

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", 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南风几经秋 2024-09-09 23:39:44

我最近在 nvidia 论坛上提出了一个可能与此相关的问题: 链接

不幸的是,我没有得到我的问题的真正答案,但设法做我想做的事,如果您只添加阻尼常数而不添加阻尼常数,那么在接头中使用弹簧可能会对您有所帮助。弹簧常数。这适用于我的情况,但我无法解释为什么,虽然我很高兴使用它,但我不完全确定是否推荐它。

我不知道你是否也可以为布娃娃的所有单独部分添加角度阻尼,这将使它们在开始移动后减速得更快,但看起来可能不太正确。可能是您必须尝试的事情之一。

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.

疯狂的代价 2024-09-09 23:39:44

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

笨笨の傻瓜 2024-09-09 23:39:44

你为什么不尝试一下:

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;

您用很小的力将速度驱动到 0,这样运动就会减少,物体将停止在地板上移动。它并不完全像摩擦力,但很接近。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文