Dynamic body (circle) not bouncing off as expected

Topics: User Forum
Jul 5, 2011 at 9:07 AM
Edited Jul 5, 2011 at 9:09 AM

Hi. Using Farseer 3.3.1, I have set up a simple world without gravity and with 4 walls (static bodies) that form a rectangle. I didn't change any settings of the static walls, except for friction which I set to 0 and restitution set to 1.

Inside the rectangle I placed a ball, i.e. a dynamic body, with some initial speed (e.g. 20 cm/sec) in a random direction. The ball has friction 0 and restitution 1.

My code for doing so might not be the nicest, but I think i should be OK (?):

 

Body ballBody = BodyFactory.CreateCircle(_world, ConvertUnits.ToSimUnits(25), 1f, ballPos);
ballBody.BodyType = BodyType.Dynamic;
ballBody.FixtureList[0].Restitution = 1f;
ballBody.FixtureList[0].Friction = 0f:
ballBody.SleepingAllowed = false;
//... setting up initial ball speed

 

My problem now is that the ball will not bounce off the wall correctly in those cases where the incident angle (i.e. the ball's velocity) is very similar to the tangent (i.e. surface) of the wall. Or in other words, if the reflection angle (between the normal of the wall, and the ball's direction) is > 80° (or something like that), the ball will not bounce off but "stick" to the wall.

It feels "as if" friction was still affecting things, even though it shouldn't. With angles such aas 50°, reflection appears to be perfectly fine.

Any suggestions as to what I could do to fix that?