如何使物理角色移动而不旋转
目前我正在开发一个使用物理引擎(Farseer for XNA)的简单游戏。
我想问一下如何才能让这个角色能够在地面上行走,在平台上跳跃而不旋转。
因为我需要更新身体位置和旋转,因为它是一个物理对象,所以它会像平常一样响应,它会自行旋转。
有人知道我该如何修复它吗?
currently I'm developing a simple game which uses physics engine (Farseer for XNA).
I would like to ask how can I make the character so that he can walking on the ground, jumping on platform without rotating itself.
Because I need to update the body position and rotation, because it is a physics object so it will response like the usual which will rotate itself.
Anyone know how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Farseer 2.1,您可以设置:
Farseer 3.0 似乎有一个固定旋转的标志,这似乎在内部执行相同的操作:
虽然我也在物理更新后将旋转设置为零,但为了确定:
不要害怕在物理更新运行后,进入并更改您“不喜欢”的任何物理值。大多数游戏都有很多虚假和捏造的东西。
For Farseer 2.1 you can set:
Farseer 3.0 appears to have a flag for fixed rotation, which appears to do the same thing internally:
Although I also set rotation to zero after the physics update, just to be sure:
Don't be afraid to go in, after your physics update runs, and change any physics values you "don't like". Most games fake and fudge things quite a lot.