FINALLY FIX the physics debug lines.

DieHard

25-01-2007 10:48:31

Took me two different days and working between 12AM to 5AM to figure out why I'm not able to see the physics debug lines. I made a new project using the application template from Ogre's tutorials and I got the physics debug lines to work. I started comparing between my big project and the new project. The order of "setting up Ogre" was thoroughly checked and found nothing wrong.

So, I started stripping my big-complicated project. I checked my singleton code and then tried placing the "NxOgre setup code" at different places like in the createScene() method.

At the breaking point of giving up, I revisited the issue I had a long time ago with "#include <nxOgre.h>" must be on top of the header files. Looking at my highest procedures, I have three classes ObjectManager.h, InputManager.h, and ConfigurationManager.h. The culprit was the InputManager.h needing the "#include <nxOgre.h>" on top, even though I don't use it. Very strange!

After the physics debug lines worked, I started putting my code back to together. And, I noticed another problem the order of "NxOgre setup code" made my physics debug lines stop displaying! It was working in the createScene() method. So, I made another initialize method for NxOgre in my ObjectManager to be called later, right before the createScene() method.





Pardon my grammer. I'm going to bed!

betajaen

25-01-2007 11:16:22

I thank you, seriously.

If it helps, in the latest NxOgre which I'm working on now. I've solved the include order (NxOgre first, then Ogre).

NxOgre_includes.h goes like this:

// Include Ogre double-yay!
#include <Ogre.h>

#include <OgreNoMemoryMacros.h>
#include <NxPhysics.h>
#include "ControllerManager.h"
#include <OgreMemoryMacros.h>


// Include your preferences
#include "nxOgre_configuration.h"
#include "nxOgre_pose.h"


So now in your code you can do:

#include "NxOgre.h"
#include "Ogre.h"

// or

#include "Ogre.h"
#include "NxOgre.h"


Perhaps this may work better, or not at all.

Also, are you a member of Betajaen's army? Because I would really like you to be, plus you get to have access to the latest sources. Well if you have time ;)

jchmack

29-01-2007 07:51:32

props man! seriously though ive been wondering about this for a while. I was wondering why my problem kinda fixed itself when i redid how all my files link together. Nice work diehard.