This project has moved and is read-only. For the latest updates, please go here.

PhysicsHelper Falling Object

Aug 20, 2009 at 12:46 PM

Hey all, just started picking up Farseer with C#/PhysicsHelper and was wondering how do you create a rectangle you can fall on top of that adds friction? So instead of landing ontop of it it would go over it but be very very slow

Aug 20, 2009 at 5:14 PM

Friction is a part of the physics response from colliding objects. This means that you can't just add friction without also adding a collision response (objects bounce away from each other).

Don't worry tho, you can still create a "friction-box". You need to create a rectangle geometry and set geom.IsSensor = true. Then you apply the "friction" in the OnCollision event.

I write "friction" because it is not really friction. To create friction you need the normal and mass of the object, since that is not possible the way you draw it, you need a damping factor instead. You could simply add a counter-force to the body that enters the sensor geometry. Use relative force (A percentage of the total force) and apply it in negated form to the body. If this makes no sense to you, let me know.