[英]Box2d - compromise between rope and distance joint features
I am struggling with this issue since few weeks, I am making game using BOX2D physics engine (latest version) where I got crane, I needed rope, so at beginning I used distance joint, with anchor points set between hook of the crane, and its arm, it works quite okay. 几个星期以来,我一直在努力解决这个问题,我使用BOX2D物理引擎(最新版本)制作游戏,在那里我需要起重机,我需要绳索,因此开始时我使用了距离关节,在起重机的吊钩之间设置了锚点,并且它的手臂,效果还不错。
I just draw line between those two anchor points, so it looks like a rope. 我只是在这两个锚点之间画线,所以它看起来像一根绳子。
Distance Joint: 距离关节:
Pros: 优点:
Cons: 缺点:
Rope Joint: 绳接头:
Pros: 优点:
Cons: 缺点:
Is there any way to combine them, achieving good result, where: 有什么方法可以将它们结合起来,取得良好的结果,其中:
Thanks in advance for any help. 在此先感谢您的帮助。
What is the rope joint connected to at the top? 顶部的绳索接头连接到什么位置? Maybe you could make the top body a little bit moveable eg. 也许您可以使顶部主体移动一些,例如。 make it dynamic, and connect it to a static body with a soft joint like a weld joint (and probably another rope joint to stop it moving too far). 使其动态,然后通过软接头(如焊接接头)将其连接到静态物体(可能还有另一个绳索接头以阻止其移动太远)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.