Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使 b2Body 沿弧形或弯曲路径移动?我听说过 cocos2d 贝塞尔曲线函数(ccBezier),但这是用于移动 cocos2d 精灵的。或者可以修改它以移动 box2d 物体吗?任何帮助表示赞赏。谢谢你。
不要以为你可以修改它来移动身体。在 CCNode 子类的情况下,此函数使用setPosition:方法。如果您使用 b2Body 对象的方法在每个刻度上更改身体的位置SetTransform,它将忽略所有可能的碰撞。
setPosition:
SetTransform
您可以尝试将线速度设置为物理体。在这种情况下,您需要根据需要更改(旋转)速度矢量。