milo
milo

Reputation: 555

Farseer Physics Vector2 class

I'm trying to make an XNA game using Farseer Physics, and it's complaining that XNA and Farseer both have a class called Vector2. How would I make it only use one of them?

Upvotes: 1

Views: 1161

Answers (3)

Matt Bettcher
Matt Bettcher

Reputation: 130

Farseer comes with a vanilla class library that includes all of the relevant math classes and methods from Xna. Using the vanilla library will allow you to not have to include Xna in your project. It is useful for Mono or WinForms.

If you are using Xna then you will want to reference the Xna version of Farseer Physics.

Upvotes: 0

user925777
user925777

Reputation:

I don't think Farseer has a class called Vector2, at least I haven't faced this problem nor seen Vector2 class in it.

Quick Google search gave me this link, which is probably related to your problem. Basicly Farseer is excpecting another version of XNA framework. Are you using XNA 4.0 and the latest version of Farseer? You could also try latest source version from here.

Upvotes: 1

Tigran
Tigran

Reputation: 62246

You shoud specify fully qualified namepsace name, or by making story shorter use somethign like this:

using farser = FarserPhysicsNamespace; 

and in code use just

farser.Vector2;

Upvotes: 2

Related Questions