Body lost a velocity component when hitting a wall

Discuss issues specific the Java port of Box2D
datvm
Posts: 1
Joined: Thu Apr 23, 2015 1:06 am

Body lost a velocity component when hitting a wall

Postby datvm » Thu Apr 23, 2015 1:13 am

I am creating a Breakout game using Box2D (of LibGdx if anyone interest). Everything works well until when the ball hits the wall when moving with a very small angle. Please look at the image for details:

Image

I tried to set the wall friction to 0 and restitution to 1, as well as the ball's friction and restitution, but it still move along the wall (I have no World Gravity). This also happens to the vertical wall if the angle is small enough, it will lose X velocity.

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

Return to “Java”



Who is online

Users browsing this forum: No registered users and 4 guests