I try to use createCollisionResponseAnimator () but I have two ITriangleSelector * (the first parameter of this function) :
one for the terrain
another for the IAnimatedMeshSceneNode
what should i do because i would like both of them to have the collision response Should I combine them into some variable or should I call this function 2 times or any solutions ?
^_^
use createCollisionResponseAnimator() but 2 ITriangleSelectr
Use a scene::IMetaTriangleSelector*
Example:
Example:
Code: Select all
scene::IMetaTriangleSelector* metaselector = 0;
metaselector = smgr->createMetaTriangleSelector();
IAnimatedMesh* mBlock = smgr->getMesh("block.b3d");
int z = 1;
for(int y = 0; y < 8; y++)
{
for(int x = 0; x < 9; x++)
{
IAnimatedMeshSceneNode* nBlock = smgr->addAnimatedMeshSceneNode(mBlock, 0, z);
scene::ITriangleSelector* selector = 0;
selector = smgr->createOctTreeTriangleSelector(mBlock->getMesh(0), nBlock, 128);
metaselector->addTriangleSelector(selector);
if (nBlock)
{
//nBlock->setDebugDataVisible(true);
nBlock->setMaterialFlag(EMF_LIGHTING, true);
nBlock->setPosition(vector3df((22*x)-72,(22*y)+16.5,0));
}
z++;
z++;//odd ids for the bit mask
}
}