BULLET OGRE DEBUG

jobes
Posts: 4
Joined: Wed Mar 19, 2008 7:15 pm

BULLET OGRE DEBUG

Post by jobes »

Hello, im learning bullet, but i need to see what happens on the screen to do something. All i need is debug lines. Please, tell me, how can i set them up to get them shown on screen? I've started to write source, he isn't too good, uses much memory, but i can edit him later. Here it is http://pastebin.com/f79dd6a02.

Graphical engine is OGRE, so i've added dynamicsWorld = new btDiscreteDynamicsWorld to function createScene.

I've added:
UGCline3D *debugClass= new UGCline3D(mSceneMgr);
dynamicsWorld->setDebugDrawer(debugClass);

what i am doing wrong?

thx jobes
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BULLET OGRE DEBUG

Post by Erwin Coumans »

jobes wrote:Hello, im learning bullet, but i need to see what happens on the screen to do something. All i need is debug lines. Please, tell me, how can i set them up to get them shown on screen? I've started to write source, he isn't too good, uses much memory, but i can edit him later. Here it is http://pastebin.com/f79dd6a02.

Graphical engine is OGRE, so i've added dynamicsWorld = new btDiscreteDynamicsWorld to function createScene.

I've added:
UGCline3D *debugClass= new UGCline3D(mSceneMgr);
dynamicsWorld->setDebugDrawer(debugClass);

what i am doing wrong?

thx jobes
Does UGCline3D implement the btIDebugDraw::drawLine interface?

You have to call dynamicsWorld->debugDrawWorld() at the right time, so that the lines are drawn correctly. Typically this is at the end of the rendering stage, just before the 'swap buffers'.

Hope this helps,
Erwin
jobes
Posts: 4
Joined: Wed Mar 19, 2008 7:15 pm

Re: BULLET OGRE DEBUG

Post by jobes »

thx

in function frameStarted i am calling this:

mWorld->stepSimulation(1/60.0f);
mWorld->debugDrawWorld();

but i didnt found anywhere, which debug mode i wanna. I have seen in demos, that there are more debug modes, i think here is that problem. How can i set debug mode?

Propably in function void setDebugMode(int), but i have it empty {;}