Search code examples
xna2dgame-physicsmonogamefarseer

Velcro Physics: Collisions should rotate body, but not move it


I'm using the latest version of Velcro Physics (formerly Farseer Physics) and I would like to have a body that is able to be rotated by collisions, but not translated/moved by them.

If it helps, the application for this is a gear system where the gears rotate each other but cannot push/move each other.

I've tried setting the position of each gear to the same place every frame, but that solution still allows for the gears to move in that single frame.

Thanks for any help!


Solution

  • I ended up just setting body.LinearDamping to 100f and resetting the object to the same position every frame. The LinearDamping variable slows the movement of the object so it doesn't go flying away every update, but it's not perfect, so the position still has to be reset.