Another problem with collision detection!

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
PsycoDad
Posts: 36
Joined: Mon Jan 09, 2006 8:30 am
Location: Munich/Germany

Another problem with collision detection!

Post by PsycoDad »

Hello everybody,
I know that there are a lot of questions about collision detection in the beginners forum, but i read the replys, and there was no answer for mine.

I build a terrain for a FPS and want to do this with unic files (all 3ds format). I do it like in the tutorial with a collision response animator.

Now my problem is that i only can give one file to the animator.
I do it with this:

Code: Select all

ITriangleSelector* selector = 0;

IAnimatedMesh* t1 = smgr->getMesh("file1.3ds");
	ISceneNode* terrain1 = smgr->addOctTreeSceneNode(t1->getMesh(0));

	if (terrain1)
	{		
		selector = smgr->createOctTreeTriangleSelector(t1->getMesh(0), terrain1, 128);
		terrain1->setTriangleSelector(selector);
		selector->drop();
	}

	
	IAnimatedMesh* t2 = smgr->getMesh("file2.3ds");
	ISceneNode* terrain2 = smgr->addOctTreeSceneNode(t2->getMesh(0));

	if (terrain2)
	{
		selector = smgr->createOctTreeTriangleSelector(t2->getMesh(0), terrain2, 128);
		terrain2->setTriangleSelector(selector);
		selector->drop();
	}

ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector, cameraFPS, 
		vector3df(10,10,10),vector3df(0,-1,0), vector3df(0,5,0));
		cameraFPS->addAnimator(anim);
		anim->drop();
I know i can only give one node to the animator. Must i create for every node a new animator, or is there a way to do collision response for different nodes with one animator?
Can please somebody help me with this newbie question?

Excuse my bad c++ and also my worse english!!
Wer andern eine Bratwurst brät, der hat ein Bratwurstbratgerät!
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

use the metatriangleselector
try a search :D
tjuhzj
Posts: 44
Joined: Mon Mar 27, 2006 7:00 am

ha ha ..

Post by tjuhzj »

just use metaTriangleSelector instead of common TriangleSelector .

Please turn to the API document for details.

P.S. this subject has been posted for many times, you would better search the forum first!
________
Teen Vid
Post Reply