Box2d 碰撞。物体变形
我正在开发一个使用 Box2d 的应用程序。我有一个有几个块和一个物体的世界 与他们发生碰撞。当碰撞开始的那一刻,物体开始改变它们的形状,它们变得更大。可能是什么原因造成的。
我正在以固定位置和睡眠状态创建身体。还有shapeDef->friction = 0.8f; shapeDef->密度=1.0f; shapeDef->恢复=0.2f;
也许我没有使用正确的物理参数,我不想要那种变形。只是动作和身体保持原来的形状。
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 objects 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我发现了这个错误。
这是我的渲染功能的错。 gl 初始化中的纵横比不正确,因此当对象在轴上旋转时,它会被放大。
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.