Debug Renderer

What is debug renderer? It's a very helpfull thing! You can use it to automaticly draw boundinboxes, orientations, forces and joints. Only thing you must to do is add this line after creating World:

mNxWorld->createDebugRenderer(mSceneMgr);

The mSceneMgr is a ogre stuff so if u creating your own project it can have different name.

Remote Debugger



Here comes another usefull tool. You can found it in $(PHYSX_DIR)/bin/win32/RemoteDebugger.exe. It's something like debug renderer but it can work on another monitor/computer. It not only show what debug renderer can do, but it also give you ability to move objects using mouse, pause, show statiscics and watch saved video frame by frame. To use it simply write this code:

mNxWorld->getPhysXDriver()->createDebuggerConnection(ip,port);

If you runing on the same computer leave it empty (). You can change port in remote debugger options.
Remote debugger will really slow your app so don't run it if u don't need it.

Hardware scene



You can make one your scene hardware. What does it mean? The main thing in NxPhysics is that you can use AGEIA PhysX card. The physic card will do the same thing for physic like graphic card for graphic so the cpu get more time ;) But the hardware have some limits:

  • only one application can use it at the same time
  • only one scene can use hardware mode, other software




To create hardware scene while createing add this param:

"simulation-type:hardware"

It will make it hardware. Propably u won't have physx card so it will run in software anyway ;)

NxOgre log



Another usefull thing is NxOgre log. NxOgre is creating two files:

  • NxOgre.html - sometimes you can find there errors
  • NxOgre.leaks.html - contains number of created and deleted objects. If u not release something it will be written here.




To get log information NxOgre need to be release at end. Read below.

Releasing NxOgre



The thing u shuld do at end is release NxOgre World. It's really easy:

delete mNxWorld;

You can also while in game delete scene:

mNxWorld->destroyScene("scene name");
 mNxWorld->destroyAllScenes();

If u created debug renderer u can destroy it any time u want:

mNxWorld->destroyDebugRenderer();

Info



Feel free to edit this if you think it can be better.

Problems? Quesions? http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7938&sid=11f8ff741c253e55245c1d6468529a81