Body collision with wall is rebounding normal to the wall

Official forum for the Chipmunk2D Physics Library.

Body collision with wall is rebounding normal to the wall

Postby sakkeerhussainp » Mon Oct 24, 2016 2:03 am

I am developing a top down board game using chipmunk JS. I have a circle body (carom board striker) having following parameters

radius → 30 Density → 2 friction → 0.6 elasticity → 0.6

circle also having a positive moment of inertia.

and a carom wall with parameters

friction - 0.6 elasticity → 0.9

the space damping is 0.6.

When the circle hits the wall it properly rebounds.Since the circle having moment of inertia it internally rotates during its motion. To turn of angular rotation, I created the circle with infinite moment of inertia. But unfortunately when circle with infinite moment of inertia hits the wall it returns with an angle which is normal to the wall, regardless of the hitting angle. What will be the possible reasons. Is there anything i should try with friction, elasticity, or any other physical parameters. Can someone suggest some methods to completely turn off the rotation effects over the circle (something like yourBodyDef.preventRotation = true that can be set in box2d).

Thanks for reply.
sakkeerhussainp
 
Posts: 5
Joined: Mon Oct 03, 2016 10:20 am

Re: Body collision with wall is rebounding normal to the wal

Postby slembcke » Mon Oct 24, 2016 12:49 pm

Because the object isn't allowed to rotate (which is not normally possible in the real world), the friction will be able to absorb a lot of the velocity of the object. Consider the following example:

An object strikes the ground at a 45 degree angle (so velocity (10, -10) or so). With an elasticity of 0.9, v.y will end up being 9 and will have changed by 19. The maximum x-velocity lost due to friction is the fraction of that multiplied by the friction coeffifient which is 0.6 in your case. So 19*0.6 = 11.4, and that is greater than the original x-velocity of 10. So the resulting velocity after the collision will be (0, 9).

If you had an object in the real world that was prevented from rotating somehow, this is exactly what would happen. The other issue that makes this fairly unintuitive is that few real world materials have a high elasticity and frictional coefficient. In the case of a board game with an object that bounces around, it's probably made of a material with very low friction such as hard plastic or polished wood or metal.

tl;dr Use a much lower friction coefficient, I would say start with 0.1 and adjust downward until it feels right.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest

cron