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

Body, geometry, controller and joint events

Dec 25, 2007 at 4:28 PM
Edited Dec 25, 2007 at 4:31 PM
To crashlander:

I'm not sure if you forgot or did not have the time (or you changed your mind), but the events is not yet included in Farseer.
For easy integration, I've posted a diff /patch file with the changes down here: EDIT: stupid codeplex editor.... i've uploaded the patch here:

To everyone else:
This patch extends Farseer Physics Engine with some events. Those events are: GeometryAdded, BodyAdded, JointAdded, ControllerAdded and their Removed counterparts. This is useful in many scenarios such as async operations (multithreading) and in my case, debugging with WPF.
Dec 28, 2007 at 5:14 PM
These are in the engine. I think I just forgot to list them when I released. They are in the respective list objects BodyList, JointList.. etc..

public class BodyList : List<Body> {
private List<Body> markedForRemovalList = new List<Body>();

public delegate void BodyAddedRemovedDelegate(Body body);
public BodyAddedRemovedDelegate BodyAddedHandler;
public BodyAddedRemovedDelegate BodyRemovedHandler;