AC123
AC123

Reputation: 11

Box2d body Jitter

I am developing a box2d game. The world's scale is set at 30 units to one meter. The body size is one meter. Other parameters: density = 1; friction = 0.5f; restitution - 0.5f. I found that the object has been at a constant angular velocity after the collision. I also found that some bodies jitter. Different body paramenters lead to different performance. Why do you think this is the case?

Upvotes: 1

Views: 1226

Answers (1)

North-Pole
North-Pole

Reputation: 630

If I get it right you get two bodies colliding and on the collision the body A penetrates body b sticking to it and that causes odd behaviour ? Assuming that I understood right what you are saying then the problem is quite common. It happens often between dynamic bodies. The solution for that is to set the main body as a bullet. That will turn CCD, Continuos Collision Detection, which is expensive in a way as it will perform collision detection on the body constantly every frame and not only when the body AABB's overlap with some other body. Only set this on the bodies that you think need it, so for instance if you are doing golf game you would only set it on the golf ball.

Upvotes: 1

Related Questions