开发者

Box2d - Dynamic Sensors?

开发者 https://www.devze.com 2023-03-18 12:13 出处:网络
开发者_开发问答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 w

开发者_开发问答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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消