几个球在一个有限的正方形内并且不会互相碰撞
使用box2d,我想将一些球放在一个有限的正方形中。它们不会与其他球碰撞,但在碰到边缘时会回来。我应该赋予球和正方形什么属性?
如果我设置边缘为b2_dynamicbody,球为b2_kinematicbody,球不会碰撞,但它们只是往那里走,与边缘没有反应(边缘随着球移开-_-“)。相反,球会碰撞我希望有某种方法可以忽略球的碰撞但与边缘做出反应。
With box2d,I want to put some balls in a limited square.They will not collide with other balls but will come back when hit the edge.What properties should I give to the balls and square?
If I set the edge is b2_dynamicbody and ball is b2_kinematicbody,balls don't collide but they just go there way and no reaction with the edge(the edge moved away with the balls -_-").To the contrary,balls will collide each other.I hope there is some way to ignore balls' collide but react with the edge.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是安德鲁在上面的评论中回答的答案。我复制了它,让其他遇到同样问题的人看到它已经解决了。非常感谢安德鲁(http://stackoverflow.com/users/444088/andrew)
'看看b2Filter b2Fixture 的属性。 box2d手册中有详细的解释。
另外,这是box2d官方手册的链接
http://www.box2d.org/manual.html
That's the answer which Andrew answered in comment above.I copied it and let others who meets the same problem see it's solved.Best thanks to Andrew(http://stackoverflow.com/users/444088/andrew)
'take a look at b2Filter property of b2Fixture. There is a detailed explanation of it in box2d manual.'
Additional,here is the link to box2d official manual
http://www.box2d.org/manual.html