所以我有这个动态体,我只想知道一个物体何时与它碰撞,但即使这个物体与它碰撞,动态体也总是同时移动,并且只会受到重力和地板的影响。
我尝试了运动体和传感器,但它不受重力影响。我可以添加重力,但如何添加它会与地板碰撞并停止?
我不在乎什么,但我最能找到解决方案。谢谢。
so I have this dynamic body, that I just want to know when an object collides with it, but even if this object collides with it, the dynamic body will always move at the same time and will only affect by gravity and the floor.
I tried kinmestic bodies and sensor, but it's not affected by gravity. I can add gravity but how can I add also that it will collide with the floor and stop?
I don't care what, but I most find a solution for that. Thanks.
发布评论
评论(1)
您的情况不需要传感器。您必须实现 b2ContactListener。以下是如何操作的手册:http://www.box2d.org/manual.html
There is no need for sensor in your case. You have to implement the b2ContactListener. Here is the manual how to do it: http://www.box2d.org/manual.html