why can't DebugRenderer in terrain ?

Felipe

03-09-2007 18:37:10

create terrain

std::string terrain_cfg("Terreno3.cfg");
mSceneMgr -> setWorldGeometry( terrain_cfg );


event handler
if (mInputHandler->isKeyDown(Action::DEBUG_MODE))
{

mWorld->createDebugRenderer(mSceneMgr);


}


my application stop why?

betajaen

03-09-2007 18:45:33

Several reasons.

But for one thing, that is a REALLY bad way of handling on a Key Down, create the debug renderer after you've created the world or scene.

Felipe

03-09-2007 20:20:20

mWorld = new World("log: html");

mScene = mWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: yes");

mSceneMgr->setAmbientLight(ColourValue(1, 1, 1));

std::string terrain_cfg("Terreno3.cfg");
mSceneMgr -> setWorldGeometry( terrain_cfg );

mScene->createActor("terrain",new NxOgre::TerrainShape("terreno.png", 91.5, "mesh-scale: 29.239 1 29.239"),Vector3::ZERO,"static: yes");

void onFrame(float deltaTime) {
if (mInputHandler->isKeyDown(Action::DEBUG_MODE))
{
// Technically this only needs to be done once, and it should be in your setup code.
mWorld->createDebugRenderer(mSceneMgr);


}

}

betajaen

03-09-2007 20:36:27

Yeah. Move the createDebug Code after your new World bit.

Felipe

03-09-2007 21:17:49

i make this and my aplication stop, why?

betajaen

03-09-2007 21:24:36

Let me climb in your computer and find out. Logs, Debug Messages, anything. <sigh>


All I can say is stop using the crappy Debug Render, and use the Remote Debugger instead.

Felipe

04-09-2007 15:05:55

how i implement a Remote Debugger????

jchmack

04-09-2007 15:44:05

how i implement a Remote Debugger????

calm down calm down lol. I could see the next post:
how i implement a Remote Debugger?!?!?!!??!?!??!?!!?111111

sorry i couldn't resist :wink:

OK!!!
first open up start->ageia->tools->remote debugger
then call this in your code:
mWorld->getPhysXDriver()->getSDK()->getFoundationSDK().getRemoteDebugger()->connect("127.0.0.1");
run your program and the remote debugger will record your every move =)

betajaen

04-09-2007 17:13:12

...You can also stop the recording, and actually play with it in real time. It's very handy with a second computer because you can see what is exactly going on.

Felipe

05-09-2007 16:36:37

ok! thanks.