The body lost a velocity component when it hits a wall

I am creating a Breakout game using Box2D (from LibGdx, if anyone is interested). Everything works well until the ball hits the wall when moving with a very small angle. Please see the image for more details:

enter image description here

I tried to set the friction of the walls to 0 and restore to 1, as well as the friction and recovery of the ball, but it still moves along the wall (I do not have World Gravity, and it only gave the ball an initial impulse when it hits the oar). This also happens with a vertical wall, if the angle is small enough, it will lose speed X.

How can I move the ball as I expected? If there is no friction, what caused the problem?

+4
1

libgdx.

void World.setVelocityThreshold(float threshold);
float World.getVelocityThreshold();

http://www.badlogicgames.com/wordpress/?p=2030

+1

Source: https://habr.com/ru/post/1584215/


All Articles