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

Difficulties with implementation of DebugView

Topics: User Forum
May 25, 2013 at 6:19 PM
I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the "using FarseerPhysics.DebugViews;" to my class.

But DebugView is still not working. I tried this code but I always get an error message and a warning. I found the code in another discussion:
Error message: 'FarseerPhysics.DebugViews.DebugViewXNA' does not contain a definition for 'DebugPanel' and no extension method 'DebugPanel' accepting a first argument of type 'FarseerPhysics.DebugViews.DebugViewXNA' could be found (are you missing a using directive or an assembly reference?)
Warning: The referenced component 'DebugView XNA Content (Content)' could not be found.
What is this DebugPanel? What is wrong?

What should I change in my code?

World world;
DebugViewXNA physicsDebug;
DebugViewXNA DebugViewFlags;
physicsDebug = new DebugViewXNA(world);
physicsDebug.DefaultShapeColor = Color.White;
physicsDebug.SleepingShapeColor = Color.LightGray;
physicsDebug.LoadContent(GraphicsDevice, Content);
Drawing DebugView:
// calculate the projection and view adjustments for the debug view
        Matrix projection = Matrix.CreateOrthographicOffCenter(0f, graphics.GraphicsDevice.Viewport.Width / _displayUnitsToSimUnitsRatio,
                                                         graphics.GraphicsDevice.Viewport.Height / _displayUnitsToSimUnitsRatio, 0f, 0f,
        Matrix view = Matrix.CreateTranslation(new Vector3((_cameraPosition / _displayUnitsToSimUnitsRatio) - (_screenCenter / _displayUnitsToSimUnitsRatio), 0f)) * Matrix.CreateTranslation(new Vector3((_screenCenter / _displayUnitsToSimUnitsRatio), 0f));
        // draw the debug view
        physicsDebug.RenderDebugData(ref projection, ref view);