meta selector

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
Acki

meta selector

Post by Acki »

I have a problem with the meta selector.
When I add some meshes (nodes) to the meta selector and tell the camera to response collisions from it, it works only for the first mesh I'm adding (the map mesh).
The response doesn't work for the meshes added next...
I do the setup like this:

// global vars
ITriangleSelector* selector = 0;
IMetaTriangleSelector* MetaSelector = 0;
ICameraSceneNode* CamNode = 0;
ISceneNode* LevelNode = 0;

// setup Map (OK)
{
IAnimatedMesh* LevelMesh = smgr->getMesh(MapFile);
LevelNode = smgr->addOctTreeSceneNode(LevelMesh->getMesh(0));
selector = smgr->createOctTreeTriangleSelector(LevelMesh->getMesh(0), LevelNode, 128);
LevelNode->setTriangleSelector(selector);
MetaSelector->addTriangleSelector(selector);
selector->drop();
}

// some objects (wrong(?), because no collision response from)
{
for(int t=0; t < cntObj; t++){
IAnimatedMesh* objMesh = smgr->getMesh(ObjStatic[t]);
ObjStatic[t].node = smgr->addOctTreeSceneNode(objMesh->getMesh(0));
selector = smgr->createOctTreeTriangleSelector(objMesh->getMesh(0), Level.MapGlas.node, 128);
ObjStatic[t].node->setTriangleSelector(selector);
MetaSelector->addTriangleSelector(selector);
selector->drop();
}
}

// the camera setup (wrong(?), because only works for the map)
{
CamNode = smgr->addCameraSceneNodeFPS(0, RotSpeed, MovSpeed, -1, keyMap, 8);
ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(MetaSelector, CamNode, PlayerSize, Gravitation, Accel, Eye);
CamNode->addAnimator(anim);
anim->drop();
MetaSelector->drop();
}
Guest

Post by Guest »

oh,sorry about the text style !!!
how do you enter tabs in the text ???
and how to prevent smilies when entering ; and ) with no spaces ???
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Are you using the latest irrlicht engine?
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

To post 2 :

Just use "[ code ] your code here [ / code ]"

w/o the spaces

doesn't format the text at all, keeps it the way you typed it
The Robomaniac
Project Head / Lead Programmer
Centaur Force
Post Reply