NGE + Terrain Triangle Collision 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
almondega
Posts: 37
Joined: Sat Jun 21, 2008 2:14 am

NGE + Terrain Triangle Collision Problem

Post by almondega »

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:

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);
and right after, the triangle collision code:

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();
the camera moves with keymap, its a fps camera

am i missing something to get smooth camera using Triangle Collision + Terrain ?


:?
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

*Answering the NGE-Forum post*
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Post Reply