NGE + Terrain Triangle Collision Problem
Posted: Thu Jul 31, 2008 4:23 am
hi, i'm using the NGE engine
and having problem to use the "addTerrainSceneNode" with "createCollisionResponseAnimator"
without the engine it works fine
but using it in nge engine, the camera get wrong movements
here is the Terrain Create code:
and right after, the triangle collision code:
the camera moves with keymap, its a fps camera
am i missing something to get smooth camera using Triangle Collision + Terrain ?
![Confused :?](./images/smilies/icon_confused.gif)
and having problem to use the "addTerrainSceneNode" with "createCollisionResponseAnimator"
without the engine it works fine
but using it in nge engine, the camera get wrong movements
here is the Terrain Create code:
Code: Select all
ITerrainSceneNode* terrain = smgr->addTerrainSceneNode("Media/Terrain/HeightMap.bmp",
z1->SceneNode(),
-1,
vector3df(0,0,0),
vector3df(0,0,0),
vector3df(100,10,100),
SColor(255,255,255,255),
2,
ETPS_17,
4);
terrain->setMaterialFlag(EMF_LIGHTING,false);
terrain->setMaterialFlag(EMF_FOG_ENABLE,true);
terrain->setMaterialTexture(0,driver->getTexture("Media/Terrain/Ground.png"));
terrain->setMaterialTexture(1,driver->getTexture("Media/Terrain/DetailMap.jpg"));
terrain->setMaterialType(EMT_DETAIL_MAP);
terrain->scaleTexture(1,40);
Code: Select all
ITriangleSelector *selector = smgr->createTerrainTriangleSelector(terrain);
terrain->setTriangleSelector(selector);
ISceneNodeAnimator *anim = smgr->createCollisionResponseAnimator(selector,camera,vector3df(60,100,60),
vector3df(0,0,0),
vector3df(0,0,0));
selector->drop();
camera->addAnimator(anim);
anim->drop();
am i missing something to get smooth camera using Triangle Collision + Terrain ?
![Confused :?](./images/smilies/icon_confused.gif)