使 Box2d 对象遵循预定路径 [英] Making a Box2d object follow a predetermined path

查看:18
本文介绍了使 Box2d 对象遵循预定路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个游戏,其中某个对象(建模为 box2d 主体)必须遵循固定路径.有没有一种方法可以让我指定路径坐标并使每个 dt 的对象在其上前进?

I'm making a game in which a certain object (modelled as a box2d body) has to follow a fixed path. Is there a way by which I can specify the path coordinates and make the object advance over it for each dt?

谢谢

推荐答案

另一种选择:

  • 将鼠标关节连接到您的身体上
  • 使用鼠标关节的setTarget方法移动body

这篇关于使 Box2d 对象遵循预定路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆