I just finished adding the newton with IPhysics libraries to my project, and it compiles, no errors, but when the window opens, it closes automatically.. so, anyone know what could be wrong?
[edit]
I was commenting things out, and found that it was closnig cause of this line
IPhysicsEntity* terrainEntity = physics.addEntity(&terrain);
still though, i have no clue why. Hope you guys can help.
[EDIT 2]
I went through all my code cleaned it up, to double check that was the only problem, and turns out.. it is.
IPhysicsEntity* terrainEntity = physics.addEntity(&terrain);
seems to be the only thing closeing the application, I looked through the example in IPhysics on the terrain, and mine is pretty Identicle, accept wont work.. loads, no errors, closes, no error.
[edit 3]
was reading through a post... Nick_Japan responded to someone with same problem..
"@klikmaster: Does Irrlicht successfully load your mesh? If that's not the problem, it could possibly be that IPhysics is using the wrong vertex type, although I added support for all of them. What kind of mesh is your map.my3d? Are there lightmaps or any other FX like that? How big is it? IPhysics currently just uses Irrlicht defaults, so still 16 bit indices."
~"...is using the wrong vertex type..."
How do i change the vertex type? To see if it works? He doesnt say how anywhere in the topic.
=EDIT FINAL=
heh, too many edits.. x_x; Im using terrain..
// Create the Terrain scene node
scene::ITerrainSceneNode* terrainNode = smgr->addTerrainSceneNode("media/heightMap.jpg");
terrainNode->setPosition( core::vector3df(0,0,0) );
terrainNode->setMaterialFlag(video::EMF_LIGHTING, false);
terrainNode->setMaterialTexture(0, driver->getTexture("media/texture.jpg"));
terrainNode->setMaterialTexture(1, driver->getTexture("media/detailmap3.jpg"));
terrainNode->setMaterialType(video::EMT_DETAIL_MAP);
terrainNode->scaleTexture(1.0f, 20.0f);
vector3df terrainScale(40, 4.0f, 40);
terrainNode->setScale(terrainScale);
// create triangle selector for the terrain
scene::ITriangleSelector* selector = smgr->createTerrainTriangleSelector(terrainNode, 0);
terrainNode->setTriangleSelector(selector);
selector->drop();
// create collision response animator and attach it to the camera
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector, camera, core::vector3df(60,100,60),
core::vector3df(0,0,0), core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();
// create SPhysicsTerrain
SPhysicsTerrain terrain;
terrain.terrainNode = terrainNode;
terrain.terrainScale = terrainScale;
// create Terrain entity
IPhysicsEntity *terrainEntity = physics.addEntity(&terrain);
thats my code up until where it crashes.
Need some more help.. not sure what the problem is..
Just for undestanding:
you don't use the height map, the height map is only used to create the terrain mesh, after this the hm is no longer used !!!
Maybe you have to use getMeshBufferForLOD(...), but I don't really know...
you don't use the height map, the height map is only used to create the terrain mesh, after this the hm is no longer used !!!
Maybe you have to use getMeshBufferForLOD(...), but I don't really know...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java