New to Ogre Newt

brajeshlal

24-12-2006 20:56:03

I able to do a tutorial from

http://walaber.com/newton_wiki/index.ph ... ners_guide


Now i implemented in my project.

my create frame listner method has

void createFrameListener(void)
{
mFrameListener= new vrGame2FrameListener(mSceneMgr, mWindow, mCamera, mGUIRenderer, mWorld);

// Brajesh
// To off the default overlay given by the ogre i.e. its FPS and all
mFrameListener->showDebugOverlay(false);
// Brajesh

mRoot->addFrameListener(mFrameListener);

// Newton
mOgreNewtListener = new OgreNewt::BasicFrameListener(mWindow,mSceneMgr,mWorld,60);
mRoot->addFrameListener(mOgreNewtListener); //including this line causes app to crash

}


The error i get is:

Unhandled exception at 0x005d17fd (msvcp80d.dll) in vrGame2.exe: 0xC0000005: Access violation writing location 0x0000000f.


Wheni comment basic frame listener class then
no collison is happening

Thanks

trilobite

24-12-2006 22:14:46

My guess is that mOgreNewtListener may not be valid for some reason.

You can set a debug breakpoint to the line and debug your app to see what gets reported in your watch window. I recommend setting up your initialization code to test for variable validity, something like this...

// Newton
mOgreNewtListener = NULL;
mOgreNewtListener = new OgreNewt::BasicFrameListener(mWindow,mSceneMgr,mWorld,60);
if (mOgreNewtListener)
{
mRoot->addFrameListener(mOgreNewtListener); //including this line causes app to crash
}

If mOgreNewtListener is not getting created, then your mystery extends to investigate choices in the creation of window, scene manager and world.

OR...

mOgreNewtListener IS valid after all but the problem happens somewhere in the framelistener code itself. You have to find out exactly WHICH operation and which variable is causing the problem -- which means agressive debugging.