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.
-
Mreal
Post
by Mreal »
in the Collusion example, I have tryed to apply collusion detetion on one of the faeries.But it didnt worked.Here is the code:
Code: Select all
node = smgr->addAnimatedMeshSceneNode(faerie);
node->setPosition(core::vector3df(-70,20,-90));
node->setMD2Animation(scene::EMAT_RUN);
node->getMaterial(0) = material;
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node, core::vector3df(30,50,30),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,50,0));
node->addAnimator(anim);
anim->drop();
I cant see whats wrong... ?
-
soconne
- Posts: 87
- Joined: Fri Mar 05, 2004 2:00 pm
Post
by soconne »
Did you create the code for the triangle selector??
you need something like
scene::ITriangleSelector = smgr->createOctTreeTriangleSelector(node->getMesh(0));
this should work after that
-
Mreal
Post
by Mreal »
Yes, i am talking about the collusion demo... the TriangleSelector had been already created.
Code: Select all
scene::ITriangleSelector* selector = 0;
if (q3node)
{
q3node->setPosition(core::vector3df(-1370,-130,-1400));
selector = smgr->createOctTreeTriangleSelector(q3levelmesh->getMesh(0), q3node, 128);
q3node->setTriangleSelector(selector);
selector->drop();
}