Crash using BasicFrameListener

gafman

30-11-2006 17:39:04

Hi all!

I've just got OgreNewt working or so I thought.
After adding the following two lines:

mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, mSceneMgr, m_pNewtWorld, 50 );
mRoot->addFrameListener( mOgreNewtListener );


My program crashes out with this message:

First-chance exception at 0x005c17fd (msvcp80d.dll) in TowersTA.exe: 0xC0000005: Access violation writing location 0x0000000f.
Unhandled exception at 0x005c17fd (msvcp80d.dll) in TowersTA.exe: 0xC0000005: Access violation writing location 0x0000000f.


It occures AFTER framestarted() is called, and BEFORE endframe() gets called. It's causing me a huge headache.

Also, what the basicFrameListener() actually used for?
Thanks in advance guys!

Squidinc

01-12-2006 17:46:41

I had a similar problem recently.

Can you give more information on the line where it crashes and the callstack on crash?

gafman

01-12-2006 21:11:08

I can't really give any more info about the error, but here's a screenshot at the breakage point


Will be glad to hear if you have any clues.
Again, what is the method BasicFrameListener call actually used for?

Squidinc

02-12-2006 00:07:52

The BasicFrameListener is the method that calls updates on the physic world. (Updates positions, collisions, etc..) Unless you do a frame listener that fills this job, you'll have to use it.

I had the same error actually. I fixed it by removing every lines writing in ogre log. So basically every lines that contains strings.

I know it's more of a quick hack than a real fix but it works. :/

Once these lines are removed,don't forget to rebuild the wrapper!

gafman

02-12-2006 08:39:43

Well I have managed to get the physics world to update, by calling
ogreNewtWorld->update(delta time

Thanks for the help, but I don't really want to get rid of the loggers functionality

ervilha

16-12-2006 03:59:59

I'm getting the same error, i think.

The end of ogre.log:

...
03:02:25: Win32Input8: Establishing keyboard input.
03:02:25: Win32Input8: Keyboard input established.
03:02:25: Win32Input8: Initializing mouse input in immediate mode.
03:02:25: Win32Input8: Mouse input in immediate mode initialized.
03:02:25: Win32Input8: DirectInput OK.
03:02:25: Newton Frame Listener... m_elapsed: 0 m_update:0.0166667


After this the tutorial 1 application (http://www.ogre3d.org/wiki/index.php/Newton_Game_Dynamics) launch the exception:
First-chance exception at 0x005b17fd (msvcp80d.dll) in TesteFisicas.exe: 0xC0000005: Access violation writing location 0x0000000f.
Unhandled exception at 0x005b17fd (msvcp80d.dll) in TesteFisicas.exe: 0xC0000005: Access violation writing location 0x0000000f.



So, i think the "ogreNewtWorld->update(delta time)" should solve the problem, but i don't know were to put this call... :? and what deltatime should i define.

gafman

16-12-2006 08:59:00

frameStarted / frameEnded would be a sencible place to put:
ogreNewtWorld->update(delta time)

Where delta time is the time, in milliseconds (not too sure, you'll have to check the doc), since the last update call

I used this method - I never did get the framelisteners working. But I still have problems with objects getting stuck in the air.

ervilha

17-12-2006 04:53:19

So, i was able to solve my problem out.
how? There goes:

1- I've build a BasicFrameListener class, much like the OgreNewt::BasicFrameListener, but with out debuging options. This as solved the exception problem.

2- Then your problem had came to my program :? so i've been looking in the forum, and in my case my world size was to small and the objects were out of the world. The world default size is -100,-100,-100 to 100,100,100. To set a new one, i have defined in the contructor...

OgreNewtApplication::OgreNewtApplication(void)
{
mWorld = new OgreNewt::World();
mWorld->setWorldSize(Vector3(-500,-500,-500),Vector3(500,500,500));
}



Now, i will try to put debugging working because i'm having some bouncing problems.

gafman

17-12-2006 09:06:21

That's fantastic! Thanks for the info.

Always turns out to be just an obvious or simple cause.

I'll give it a try when I get the chance

gafman

20-02-2007 16:52:08

I too have got it working in release build by increasing the size of the World so thanks.
It still crashes in debug though... did you get any success?