i have read through many other threads concerning similiar topics, but none did exactley grasp my problem.
I know a lot of you prefer using newton or something similiar for this, but i just don't need a physics engine.
What i try to achieve is a simple block, rotating slowly.
In my whole program (ok it's just a main file after all ) i use oct-trees for collision detection.
Heres part of my code for this:
Code: Select all
mesh = smgr->getMesh("Segel_x.x");
animatedNode = smgr->addAnimatedMeshSceneNode(mesh);
animatedNode->setMaterialFlag(EMF_TRILINEAR_FILTER, true);
animatedNode->setMaterialFlag(EMF_ANISOTROPIC_FILTER, true);
animatedNode->setMaterialFlag(EMF_FOG_ENABLE, true);
animatedNode->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
animatedNode->setAnimationSpeed(80);
//collission
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
octTreeSelector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(octTreeSelector);
metaTriangleSelector->addTriangleSelector(octTreeSelector);
octTreeSelector->drop();
The problem is, that there now is one instance of this model standing still, but beeing used for collision detection, and one rotating through wich i can walk.
What i already tried is to add the node returned from smgr->addOctTree... as a child to the node that is animated. I did this cause i read childs are moved relative to their parents. Didn't work.
I get that these are different nodes so i get the problem, i just don't see how to do it in another way.
Im sure my brain is just stuck, and the solution is just pretty simple, but i don't get it.
Regards,
nFec