[SOLVED] Flickering collision

User avatar
emersonmx
Posts: 9
Joined: Mon Sep 09, 2013 2:06 pm

[SOLVED] Flickering collision

Post by emersonmx »

Hello guys :D

I'm having a problem when I move an object with the keyboard and he collides with a wall.
If I keep the Down button pressed while colliding with the wall, the racket shakes.

Look the file below to see what I'm saying.
bt_pong.zip
The game code can be downloaded at https://bitbucket.org/emersonmx/pong, but I can not
guarantee it will compile on all systems. So I made an example in the blender to demonstrate
what I mean. The configurations of the rigid bodies can be seen in the file https://bitbucket.org/emersonmx/pong/sr ... ?at=master

As I need the ball has a perfect bounce, I set ball_restitution = 1, wall_restitution = 1 and
racket_restitution = 1.
I know that the problem is that the wall and the racket has restitution = 1,
but without it the ball don't bounces correctly. :?

There is an option to disable the restitution for the case wall-racket?

Sorry for my bad english and thanks in advance.
You do not have the required permissions to view the files attached to this post.
Last edited by emersonmx on Thu Sep 19, 2013 1:06 am, edited 1 time in total.
User avatar
emersonmx
Posts: 9
Joined: Mon Sep 09, 2013 2:06 pm

Re: Flickering collision

Post by emersonmx »

Kinda figured out how to solve this problem. :D

First I made the wall and the racket does not collide with each other, then used a slider
constraint so that the racket moves only to the point where it collides with the wall.

I had a problem when using the slider constraint, which generated this topic
http://www.bulletphysics.org/Bullet/php ... f=9&t=9424

My only concern is how far this approach to solve the problem of having multiple objects
with high restitution and that in specific cases they interact as restitution = 0 will work.
:?

Complete code https://bitbucket.org/emersonmx/pong