If I want to do a collision detection on the .irr file, is it possible? Since I cannot use the getMesh function on the .irr file. Then I can't do the createOctTreeTriangleSelector and createCollisionResponseAnimator. If can, how can I do it?
Thanks.
.irr question
Code: Select all
void Snow::Add_collision()
{
scene::ITriangleSelector* selectorSoc1[29];
ISceneNode *scene_node1[29];
scene_node1[1] = getSMGR()->getSceneNodeFromName("home2");
scene_node1[2] = getSMGR()->getSceneNodeFromName("home3");
scene_node1[3] = getSMGR()->getSceneNodeFromName("home4");
scene_node1[4] = getSMGR()->getSceneNodeFromName("home5");
scene_node1[5] = getSMGR()->getSceneNodeFromName("home6");
int sum = 6;
for(int i = 1;i <= sum;i++)
{
selectorSoc1[i] = getSMGR()->createTriangleSelectorFromBoundingBox(scene_node1[i]);
scene_node1[i]->setTriangleSelector(selectorSoc1[i]);
selectorSoc1[i]->drop();
}
scene::IMetaTriangleSelector *metaTri;
metaTri = getSMGR()->createMetaTriangleSelector();
for(i = 1; i<= sum; i++)
{
metaTri->addTriangleSelector(selectorSoc1[i]);
}
scene::ISceneNodeAnimator* anim = getSMGR()->createCollisionResponseAnimator(
metaTri, hero->animateMesh, core::vector3df(1,1,1),
core::vector3df(0,0,0),
core::vector3df(1,1,1));
hero->animateMesh->addAnimator(anim);
}
ARIZONA DISPENSARIES
Last edited by koller202 on Thu Feb 17, 2011 1:14 am, edited 1 time in total.
Re: .irr question
I've posted code on this several times. You can find information and code in the following posts...happyer wrote:If I want to do a collision detection on the .irr file, is it possible?
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19725
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=21292
Travis
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact: