简体   繁体   English

如何“钉”出充满活力的身材?

[英]How to "nail" a dynamic body?

So, what I want to achieve is to have the body's center of masses in a static position, but freely rotating.所以,我想要实现的是让身体的质心在 static position 中,但可以自由旋转。 Like it's nailed to a wall or something就像它被钉在墙上什么的

Tried to look at joints, but that doesn't feel right...试图查看关节,但感觉不对...

I personally didn't work with that one before but the Revolute Joint looks like what you are searching for.我个人之前没有使用过那个,但 Revolute Joint 看起来像你正在寻找的东西。

The revolute joint can be thought of as a hinge, a pin, or an axle.旋转关节可以被认为是铰链、销或轴。 An anchor point is defined on each body, and the bodies will be moved so that these two points are always in the same place, and the relative rotation of the bodies is not restricted.在每个body上定义一个锚点,移动body使这两个点始终在同一个地方,body的相对旋转不受限制。 Revolute joints can be given limits so that the bodies can rotate only to a certain point.旋转关节可以被限制,这样物体只能旋转到某个点。 They can also be given a motor so that the bodies will try to rotate at a given speed, with a given torque.还可以为它们提供一个电机,这样身体就会尝试以给定的速度和给定的扭矩旋转。 Common uses for revolute joints include: wheels or rollers, chains or swingbridges (using multiple revolute joints), rag-doll joints, rotating doors, catapults, levers旋转接头的常见用途包括:轮子或滚轮、链条或摆桥(使用多个旋转接头)、布娃娃接头、旋转门、弹射器、杠杆

In your mentioned setup I expect the wall to be body A and body B is pinned to it like in this example:在您提到的设置中,我希望墙是主体 A 并且主体 B 固定在上面,就像这个例子一样:

来自 iforce2d.net 的旋转关节示例

https://www.iforce2d.net/b2dtut/joints-revolute https://www.iforce2d.net/b2dtut/joints-revolute

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM