irrNewt problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
happyer
Posts: 17
Joined: Wed Aug 15, 2007 2:07 pm

irrNewt problem

Post by happyer »

I would like to know does irrNewt 0.4 support irrlicht 1.3.1? I use the following code

Code: Select all

IrrlichtDevice *device = createDevice(EDT_DIRECT3D9);
irr::newton::IWorld* p_world = irr::newton::createPhysicsWorld(device);
but immediately after the createPhysicsWorld line, the compiler say that "Unhandled exception at 0x10064ea8 in Game.exe: 0xC0000005: Access violation reading location 0x00000a28." So what's the problem?

I have uncomment the line in irrtonewt.hpp and copy the IrrNewt.dll in \bin\visual_studio folder. But just one thing I don't understand, what means "recompile the dll and the library" in the readme? Is that the problem happening because I haven't recompile? But I don't know how to recompile.... Or can anyone gives me the compiled version? Thanks very much
happyer
Posts: 17
Joined: Wed Aug 15, 2007 2:07 pm

Post by happyer »

I have changed my program to

Code: Select all

IrrlichtDevice *device=createDevice(video::EDT_DIRECT3D9);
	ISceneManager* smgr=device->getSceneManager();
	IVideoDriver* driver=device->getVideoDriver();

	
	//load a bsp quake map
	device->getFileSystem()->addZipFileArchive("media/level/map-20kdm2.pk3");
	scene::IAnimatedMesh* world_mesh = smgr->getMesh("media/level/20kdm2.bsp");
	scene::ISceneNode* world_node =
		smgr->addOctTreeSceneNode(world_mesh->getMesh(0));
	world_node->setPosition(core::vector3df(45,0,0));
	scene::ITriangleSelector* world_tri_selector=smgr->createOctTreeTriangleSelector(world_mesh->getMesh(0),world_node);

	//load a model
	scene::IAnimatedMesh* rigell_mesh = smgr->getMesh("media/rigell.md2");
	scene::ISceneNode* rigell_node =smgr->addMeshSceneNode(
		rigell_mesh->getMesh(1) );
	rigell_node->setMaterialFlag(video::EMF_LIGHTING,false);
	rigell_node->setMaterialTexture(0,driver->getTexture("media/rigell.jpg"));
	rigell_node->setPosition(core::vector3df(1469.6f,250.474f,1363.34f));

	//load an FPS camera
	ICameraSceneNode* camera=smgr->addCameraSceneNodeFPS();
	camera->setPosition(
		core::vector3df(1469.6f,146.474f,1363.34f));

	//PHYSICS
	
	//create world
	irr::newton::IWorld* p_world = irr::newton::createPhysicsWorld(device);
but still say that "Access violation reading location 0x00000001." Anyone knows what is the problem?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If the dll was compiled against a different Irrlicht version than you use your app will certainly crash. Since many parts of Irrlicht are still constantly changing, the class sizes and method offset are also changing. Any access to Irrlicht structures will access wrong memory areas. You will have to recompile either your app with the Irrlicht version of the Irrnewt.dll, or port irrnewt to the latest Irrlicht version.
happyer
Posts: 17
Joined: Wed Aug 15, 2007 2:07 pm

Post by happyer »

Thanks for answering. But I don't understand what you mean by
hybrid wrote:You will have to recompile either your app with the Irrlicht version of the Irrnewt.dll, or port irrnewt to the latest Irrlicht version.

What are the steps to do this?
Moreover, I am using irrlicht 1.3.1, newton 1.53 and irrnewt 0.4, is there any problem?
happyer
Posts: 17
Joined: Wed Aug 15, 2007 2:07 pm

Post by happyer »

can anyone please tell me what is recompile the dll and library? i have included them already and press the debug button, is it correct? or can anyone give me the dll and library that can solve this problem.

email: happyer9_9@yahoo.com.hk

many thanks!!
Manveru
Posts: 1
Joined: Sun Sep 16, 2007 10:38 pm

Post by Manveru »

I have got the same Problem.
The Exampels of IrrNewt works fine but, if i copy the Code in my own Projekt it get the access violation error at createPhysicsWorld
Post Reply