Thursday, April 28, 2011

PhysX Basics Tutorial: Using the Visual Debugger



In this tutorial, we will see how to connect our client application to the visual debugger. Usually, when you start the visual debugger, it will try to connect to an application. If there is no application connecting to it, it will do nothing.

How to enable remote debugging in your application
On the client side (your application) after you have created the sdk object call this line of code.

gPhysicsSDK->getFoundationSDK().getRemoteDebugger()->connect ("localhost", 5425);

The first parameter of the connect function is the ip address (for local debugging, you can use localhost (127.0.0.1)), the second parameter is the port where the connection will be made.

Demo run
We will now try to see the debugger in action. First, run the visual debugger. Then run your application. You should see all of your objects in the visual debugger. The active objects are green and the inactive (sleep) objects are yellow. This can turn out to be an invaluable tool when we are working on a fairly large project.

That's it for this demo. There is no source code for this tutorial. Just use any of the existing codes and add in the code snippet given earlier and see it in action.
Here is a snapshot of a debugging session.

Using PhysX Visual Debugger

We will look at how to create joints in the next tutorial.

0 comments:

Popular Posts

Copyright (C) 2011 - Movania Muhammad Mobeen. Awesome Inc. theme. Powered by Blogger.