views:

369

answers:

2

Hello, I have an issue similar to http://farseerphysics.codeplex.com/Thread/View.aspx?ThreadId=72364

I have a rectangle player geom, and many rectangle tile geoms lined up next to each other.

Occasionally when the player geom is crossing between them he seems to clip onto the corners of the tile geom and as a result rotate over.

Even when switching the moment of inertia to infinity which prevents rotation, the player geom "hops" when it clips the edge.

Here is a screenshot of the geoms tripping image

Is there any fix for this? I've tried the Farseer forums but it seems pretty inactive

Here is a link to a video using a circle geom for the player

http://www.notspike.com/PrototypeG/trip.avi

A: 

I would suggest that you avoid the use of small tiles placed next to each other for the level's collision geometry. For example, although visually it's clear that you're using tiles, the "floor" from the video would best be described as a long contiguous rectangle. That way, you don't have this problem at all ... floating point math is already imprecise enough and tiling collision geometry is just asking for that to go wrong :-)

Joel Martinez
Ended up writing a geometry merging algorithm to merge these for 'finalised' maps that would be deployed.
Shahin
A: 

I've had this happen before when my shapes are small enough or the movements are fast enough for the interval between physics calculation "ticks" to be enough to allow the objects to overlap before the collision detection to kick in.

TreeUK