Character Error

frier

12-07-2007 15:06:27

I keep getting some sort of pointer error i think it is on this piece of code

mScene->createCharacter("one", NxOgre::Pose(Ogre::Vector3(5,120,7)),"Mass: 10");

Error:


Unhandled exception at 0x00e2bbad in NxOgreTest.exe: 0xC0000005: Access violation reading location 0xcccccd20.

PhysX: v2.7.2(i think :S)
NxOgre: 0.9 SVN
Ogre : 1.4.2

betajaen

12-07-2007 15:20:28

I just split your post. Don't post in that thread for questions.

Try:

mScene->createCharacter("one", NxOgre::Pose(Ogre::Vector3(5,120,7)),"type: box, dimensions: 1 2 1");

Also, are you using terrain?

frier

12-07-2007 15:24:39

Ok sorry.

Yeah i saw an example like your code snippet but still crashes..

Yes i use terrain.
(cut and paste from my code exactly)
mSceneMgr->setWorldGeometry("terrain.cfg"); // have to create after ive created a camera in the scene
//mSceneMgr->setSkyBox( true, "Examples/SpaceSkyBox" );

mScene->createActor("terrain", new NxOgre::TerrainShape("terrain.png", 3000, 100, 513), Vector3::ZERO, "static: yes");

mScene->createActor("TheFloor", new NxOgre::CubeShape(100,2.1f,100), Vector3(0,-0.05f,0), "static: yes");

mScene->createCharacter("one", Vector3(5,120,7),"Mass: 10");

frier

12-07-2007 15:26:42

whoops i had that line edited out

mSceneMgr->setWorldGeometry("terrain.cfg"); // have to create after ive created a camera in the scene
//mSceneMgr->setSkyBox( true, "Examples/SpaceSkyBox" );

/*mScene->createActor("terrain", new NxOgre::TerrainShape("terrain.png", 3000, 100, 513), Vector3::ZERO, "static: yes");*/

mScene->createActor("TheFloor", new NxOgre::CubeShape(100,2.1f,100), Vector3(0,-0.05f,0), "static: yes");

mScene->createCharacter("one", Vector3(5,120,7),"Mass: 10");

betajaen

12-07-2007 16:08:55

So with and without the terrain it crashes? Or just with the terrain?

Either way; apply this patch -> http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4842

frier

13-07-2007 10:00:20

Ok sorry about late replie...

I tried that.. but still getting the same error on the following code:

mScene->createCharacter("one", Vector3(5,120,7),"Mass: 10");


I've commented out all my terrain code.

p.s: that little change in the NxOgreCharacterController.cpp file was done.. and i recompiled it in debug and release mode after the change.

betajaen

13-07-2007 10:03:35

It's very vague. Can you debug your application, and post at least a screenshot of where the debugger is finding the error?

frier

13-07-2007 10:16:04

Sorry about being vague

http://www.infernal-chaos.com/FrieR/errorSS.jpg

More then likely i've forgot to initialise something somewhere maybe.

betajaen

13-07-2007 10:29:07

It is.

Look at the lower left of the screen, all those 0xccccccc's. It's computer slang for saying, "he ain't working with a real playstate" ;)

frier

13-07-2007 10:34:08

It runs fine without the:

mScene->createCharacter("one", Ogre::Vector3(5.0f,1.0f,7.0f),"mass: 10");


Ill double check if playstates not a ghost in the wind.

frier

13-07-2007 11:02:56

Seems like that the PlayState is initialized. Its using the Singleton patten.

When i uncomment that createCharacter code it runs fun. Otherwise when i call the CreateCharacter method it gets angry..

I thought it might be because i had my own class called "Character" i changed it to "myCharacter".

Im the only one that seems to be having this trouble.. ill have to work at it. :cry:

betajaen

13-07-2007 11:28:15

I'm pretty sure it's your code. Just to make sure, just before the mRoot line there:

std::stringstream ss;
ss << "The pointer of this class is -> " << this << std::endl;
Ogre::LogManager::getSingleton().getDefaultLog()->logMessage(ss.str());


Check your Ogre.log. If the value is anything but 0xccccccc or 0, then it could be character.

frier

13-07-2007 12:09:21

21:07:35: The pointer of this class is -> 015232E8

Seems ok.. i removed character.cpp and .h from my project and removed the headers but still spitting the dummy heh..

ill keep looking

frier

13-07-2007 13:03:25

Hey Betajean it actualyl errors here in nxogrecharacter.cpp.

I copied the NxOgre_d.dll into the exe folder where all my project compiled exes sit and it got to here. getting a

Unhandled exception at 0x00e2bbad (NxOgre_d.dll) in Crawlers.exe: 0xC0000005: Access violation reading location 0xcccccd20.

here

mCharacter->getActor()->setGroup(0);

frier

13-07-2007 13:13:38

Ok copied over some newer(it seems) PhysX dlls over also to my working exe directory and it fixed my problem...

thanks for your patience betajaen!, and on another note thanks for spelling serialisation the proper way!

now lets delete this thread and never speak of it again!

off to ride my kangaroo to the shops.. BBL

betajaen

13-07-2007 13:13:55

That makes a bit more sense, but not much. Can you use your Debugger to find out the values of mCharacter and getActor()?

frier

13-07-2007 13:20:12

Yep fixed now.. read my last post :).

Thanks again.

betajaen

13-07-2007 13:27:26

Excellente.