Ball bouncing at very shallow angle

Post Reply
pinkisntwell
Posts: 11
Joined: Tue May 31, 2016 3:38 pm

Ball bouncing at very shallow angle

Post by pinkisntwell »

I am evaluating Bullet for a billiards simulation. I am simulating the table bed and the cushions by static plane shapes. But I find the ball behaviour very incorrect when it travels with relatively low speeds. I can't take a video now but the effect I am describing is this:

Image

My code is here: https://github.com/gtzampanakis/justsho ... ulator.cpp

I have tried changing all the parameters, changing restitutions, frictions, scale, timestep, but the effect remains, i.e. the ball hugs the cushion and stays with it even though the correct behaviour would be for it to bounce off.

Any ideas?
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Ball bouncing at very shallow angle

Post by benelot »

I will look into your code, there might be something wrong with it. Currently I am on holiday, so feedback might take me until next week.
hiker
Posts: 83
Joined: Tue Oct 24, 2006 11:52 pm
Location: Australia
Contact:

Re: Ball bouncing at very shallow angle

Post by hiker »

Hi,

I have seen the same in our game supertuxkart (bullet 2.79 though). Here a trace of a (soccer) ball movement (in green) with the static track (walls) in purple, and a zoomed in version:
bouncing1.jpg
bouncing1.jpg (34.05 KiB) Viewed 7129 times
bouncing2.jpg
bouncing2.jpg (65.51 KiB) Viewed 7129 times
We actually added a push-back force from the wall to avoid the problem that the ball kind of sticks to the wall.

Cheers,
Joerg
hiker
Posts: 83
Joined: Tue Oct 24, 2006 11:52 pm
Location: Australia
Contact:

Re: Ball bouncing at very shallow angle

Post by hiker »

Hi,

I've found the problem in our case: the static mesh from which the ball bounces off had no restitution set, so it was 0. The overall restitution is the product of the restitution of both objects, which is then 0 as well, whatever we defined for the ball. We are now experimenting with either giving the actual track restitution (which would change the game behaviour e.g. in case of a kart vs track collision), or changing the restitution combination formula.

Hope that helps someone.
Joerg
pinkisntwell
Posts: 11
Joined: Tue May 31, 2016 3:38 pm

Re: Ball bouncing at very shallow angle

Post by pinkisntwell »

In my case restitution is not zero.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Ball bouncing at very shallow angle

Post by benelot »

I will look at your issue today as soon as possible. I just created a small breakdown game and the bounces seemed to be realistic so far.
pinkisntwell
Posts: 11
Joined: Tue May 31, 2016 3:38 pm

Re: Ball bouncing at very shallow angle

Post by pinkisntwell »

benelot wrote:I will look at your issue today as soon as possible. I just created a small breakdown game and the bounces seemed to be realistic so far.
Thanks a million.

For what it's worth, the issue seems to happen only when the velocity of the ball is small.
Post Reply