Helly everybody,
I know this quite an old thread, but I'm trying to use the Debug Drawing Utility Class, which seems exactly what I needed.
I am using Ogre 1.8 on a Linux machine with OpenGL rendered. I had to modify a few things to get it work:
A) changed "__int64" (which is a MSVC specific type) to "Ogre::int64" (which takes care to use __int64 on windows and other types with gcc).
B) changed "ms_Singelton" to "msSingelton"
Now I have tryied to do exactly what is explained in the wiki to get it work. It compiles, but I don't see any debug plot on sreen when the application runs.
So:
I initialize it in my APP::startup() function (I'm not using the exampleApplication) like this:
Code: Select all
_sceneManager = _root->createSceneManager(Ogre::ST_GENERIC);
// debug drawing facilites
new DebugDrawer(_sceneManager, 0.5f);
and unallocating it in my APP::shutdown() function like this:
Code: Select all
// destroy debug facilities
delete DebugDrawer::getSingletonPtr();
In my FrameListener::frameStarted function, at the end of the function, I iterate all the objects I have put in a special <vector> and call DebugDraw, I also call the .build() method, like this:
Code: Select all
// Right before the frame is rendered, call DebugDrawer to display all the entities
// that are in debug mode
for(int i_ent =0; i_ent!=_debugEntitiesVector->size(); ++i_ent){
DebugDrawer::getSingleton().drawCuboid(_debugEntitiesVector->at(i_ent)->getBoundingBox().getAllCorners(), Ogre::ColourValue::Red, true);
}
DebugDrawer::getSingleton().build();
return true;
And finally, I call .clean() in frameEnded:
Code: Select all
// After the frame is rendered, call DebugDrawer::clear()
DebugDrawer::getSingleton().clear();
return true;
I get no compilation errors, but when I run the code, I don't see any red box aroung my debug meshes... I have also tried to copy the for loops in the examples that plot a lot of colored boxes all around, I'don't see anything.
Does anyone understand the problem? I'm I doing something wrong?
thanks in advance.