开发者

Box2d Collision. object gets deformed

i'm developing an app that uses Box2d. i have a world with several blocks and an object that collides with them. at the moment the collision starts, the obj开发者_开发知识库ects start to change their shape, they get more large. what could be causing that.

i'm creating the bodies in fixed positions and in sleep state. also shapeDef->friction = 0.8f; shapeDef->density = 1.0f; shapeDef->restitution = 0.2f;

maybe i'm not using the right physics parameters, i don't want that deformation. just the movement and the body keeping its original form.


OK i found the bug.

it's fault of my rendering function. the aspect ratio in the gl initialization wasn't correct, so when the object was rotating on the axis it was being enlarged.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜