Farseer Physice Engine Manual 

Introduction

The Farseer Physics Engine is an easy to use 2D physics engine designed specifically for Microsoft's XNA platform. The Farseer Physics Engine focuses on simplicity, useful features, and enabling the creation of fun, dynamic games.

Overview

Getting right to the nut, the Farseer Physics Engine is designed to control the position and rotation of game entities over time. 

In the real world, things move and spin due to applied forces and torques. In Farseer, the same is true. Objects called "Bodies" represent the real world things.  As forces and torques are applied, the bodies react according to the laws of 2D physics. The position and rotation of these bodies are then used to update game entities.

In the very simplest outline it works like this:

1. Create "Body" object
2. Add Body object to simulator.
Begin Game Loop
     3. Apply forces and torques to Body.
     4. Update the simulator
     5. Set game entity(sprite or whatever) position and rotation equal to Body position and rotation.
     6. Draw game entity
End Game Loop

Bodies, by design, have no geometry in the 2D world and therefore have no concept of collisions. 

For collision, Farseer has the "Geometry" object. Geometry objects are represented as 2D polygons and can be either concave or convex. They are defined by a set of vertices.  One or more Geometries are attached to a Body in order to give the Body geometrical awareness. This allows the Body to participate in collisions with other Bodies(actually other Geometries attached to other Bodies, but you get the picture.)

Dynamics

Body

Body Factory

Revolute Joint

Angle Joint

Joint Factory

Linear Spring

Angle Spring

Collision

Geometry

Grid

Vertices

Collision Groups

Collision Layers

Collision Events

Example Code Snippets