This project has moved. For the latest updates, please go here.

[Solved] Farseer without XNA?

Topics: Developer Forum
Jul 31, 2012 at 7:13 PM

I saw an older post on this, but I have some new questions surrounding the topic.

I'm using Farseer's basic class installation with SDL. The older post mentioned this was possible without involving XNA or Silverlight. This looks like the best 2d physics implementation in C#, and I've used it before when I was working in XNA.

The first issue I'm coming up against, however, is that declaring a new World object requires that I use an XNA Vector2d for the gravity parameter. How do I get around this?

Jul 31, 2012 at 7:56 PM

Hah, never mind. I figured out what was going on by looking in the Farseer source. There's a locally declared "fake" XNA namespace IFDEFed with a Vector2 declaration if you aren't using the real XNA. Clever. :)

Aug 7, 2012 at 2:11 AM

Indeed. I packaged a Vector2 class (and 4-5 other classes) inside the class library version of the engine. When you use XNA, you will use the built-in Vector2 class, when using the class library, it will use the built-in Vector2 class.