A really complex problem
Probably, Niko already know that
It seems that when you drop or remove a IAnimatedSceneNode, it suppress the mesh associed to, for example, this is my code :
Code: Select all
IPlayer::attachObjectCamera(IEntity *objectToAttach)
{
// On définit la position de l'objet par rapport à la camera
core::vector3df posWeaponCam(10,-15,15);
// Si il y'a déja un objet attaché à la camera, on le supprime
if (nodeObjectCamera!=NULL)
nodeObjectCamera->drop();
// Création du node attaché à la camera
nodeObjectCamera = smgr->addAnimatedMeshSceneNode(objectToAttach->getMesh(),smgr->getActiveCamera(),0,posWeaponCam);
// On définit les paramêtres textures
nodeObjectCamera->setMaterialFlag(video::EMF_LIGHTING, false);
nodeObjectCamera->setMaterialTexture(0,objectToAttach->getMaterial());
};
the IEntity class is a base class for all my object in the world, it have a function getMesh() which return a IAnimatedMesh class.
Althought, when this function more than 2 times, an error occur = the mesh in objectToAttach disappear.
I'm wonder if :
when you drop a node, the mesh linked with the node is dropped too ?
Thanks for your help !