Wednesday, June 14, 2017

c# - Farseer Physics for Xna missing ConvertUnits class



Im using Farseer Physics with Xna 4.0. Im following a starter guide. It said that to draw, I need to convert the meters to pixels with the ConvertUnits namespace. I looked through all of the engine, but I cant find the ConvertUnits class. Im basicly stuck without it. Where is it stored, or do I need another resource?



Answer



Starting with 3.x, FPE(Farseer Physics Engine) now uses the MKS (Meter-Kilogram-Second) system of units.


The ConvertUnits class can be found under Farseer Physics Engine 3.3.1 Samples XNA\Samples XNA\Samples XNA\ScreenSystem. ConvertUnits is a helper class that lets us switch between display units (pixels) and simulation units (MKS) easily.


This file can be downloaded here: http://farseerphysics.codeplex.com/releases/view/64108


Original Post at: http://farseerphysics.codeplex.com/discussions/247635


So you basically need to add the ConverUnits.cs file to your project, and you should be able to convert meters to pixels just fine :)


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...