Hi all
I'm currently working on a project where we have a tank driving across a terrain scene node. We are using IrrNewt physics wrapper for Newton.
However we are experiencing problems with our terrain scene node where the tank will drive straight through the rendered terrain. We have created the Height map using the program EarthSculpture.
It appear to be that the TriangleSelector generated for the terrain is not the same as the displayed TriangleSelector.
I'm wondering if anyone else has had this problem and whether they have been able to solve it.
Cheers
Courtney
Terrain Collision Problems
When i load the terrain height map i automatically scale it in the constructor then irrNewt gets the physics data from the created node.
So im not sure that its the scaling thats an issue ... unless scaling in the constructor doesn't work.
Code: Select all
world_node = smgr->addTerrainSceneNode("media/level1.png",0,-1,vector3df(0,0,0),vector3df(0,0,0),vector3df(10, 1.0f, 10),SColor(255,255,255,255),5,ETPS_17,0,false);
world_node->setMaterialFlag(video::EMF_LIGHTING, false);
world_node->setMaterialTexture(0, driver->getTexture("media/brownsand.png"));
world_node->setMaterialTexture(2, driver->getTexture("media/orangesand.png"));
world_node->setMaterialTexture(1, driver->getTexture("media/longGrass.png"));
...
...
...
p_world=irr::newton::createPhysicsWorld(device);
//level body
irr::newton::SBodyFromNode levelData;
levelData.Node = world_node;
level_body = p_world->createBody(levelData);
So im not sure that its the scaling thats an issue ... unless scaling in the constructor doesn't work.
This is really more of an irrNewt issue then an irrlicht issue. Try to disable scaling and see if the problem is gone. Other things to try is to draw the newton debug data and see if it matches the irrlicht version (I highly doubt it does) and to make sure the bounding box and physics position of the tank is correct and matches the scenenode version.
There are many factors to consider, so I suggest you get started
There are many factors to consider, so I suggest you get started