Collision problem with wide object

Apr 14, 2009 at 2:49 PM
Hi,

quick question about a strange behaviour. I'm having an hard time explaining it so I included a screenshot to show the problem.
Here

I have two rectangle, the first is my ground and the other is a rectangle falling on the ground. Both rectangle are very wide 1000 x 32 for the ground and about 400 x 32 for the falling rectangle. If the corner of the falling rectangle touch the ground the collision works perfectly, but when the falling rectangle falls "flat" on the ground it will penetrate quite a bit inside the ground and "bounce back" in the air a bit like when you push a balloon inside a pool and let it go it will fly in the air.

So yeah I really hope it makes sense eheh. If not I'll try to be more clear, thanks for the help.

Coordinator
Apr 14, 2009 at 3:26 PM
There may be a couple of different things going on...

- There are issues in the Farseer Physics engine with "tunneling" (objects passing through each other). If you download the Farseer Physics Manual here - http://farseerphysics.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20625 - it has some good tips on how to avoid it. Also, I would recommend using the build of FarseerPhysics.dll, as it has a tweak to reduce the tunneling in farseer (more on that issue here - http://www.andybeaulieu.com/Home/tabid/67/EntryID/129/Default.aspx)

- It's hard for me to tell from the image if your boundaries are being calculated correctly? Are the outlines showing up around the proper way? If not, you may need to check that you didn't apply any Transforms (Rotate or Scale) on your XAML elements - you need to let the Physics Helper do this because that's what the simulation will use to do proper rotation, etc. when running.

Apr 14, 2009 at 4:12 PM
Hi Andy,

I believe the boundaries are calculated correctly, I created my rectangles with Blend without applying any transform to them. The other shape you see in the image all works correctly, I have the impression that it's when the shape gets too long that the problem occurs.

After looking at the documentation above, I see that there is a function to create more points along an edge called SubDivideEdges(). I'll try it when I get back home it might be what I need.


Thanks for the tips