what the different between AnimatedMeshSceneNode and IAnimatedMesh?
i load my file with IAnimatedMesh.. but i can't use getposition in IAnimatedMesh...
here is my project preview:
i want to ask about load mesh...
u can see in my preview have load file mesh menu strip..
it use for load a mesh file and show in the irrlicht engine..
i use IAnimatedMesh to load it..
and here is my code for loading it..
Code: Select all
if (!mesh1.isEmpty())
{
if(this->getIrrlichtWidget()->getIrrlichtDevice())
{
ISceneManager *smgr = this->getIrrlichtWidget()->getIrrlichtDevice()->getSceneManager();
IVideoDriver *driver = this->getIrrlichtWidget()->getIrrlichtDevice()->getVideoDriver();
//Just display a simple mesh
IAnimatedMesh *mesh = smgr->getMesh(qPrintable(mesh1));
//vector3df nodePosition = mesh->getPosition();
if (!mesh)
{
this->getIrrlichtWidget()->getIrrlichtDevice()->drop();
}
IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode(mesh);
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation(scene::EMAT_STAND);
if (!texture.isEmpty())
{
node->setMaterialTexture( 0, driver->getTexture(qPrintable(texture)));
}
}
}
}
else
{
this->getIrrlichtWidget()->getIrrlichtDevice()->drop();
}
mesh1 is file path where the mesh file i located...
and after i load the mesh, it will show the mesh file in the left treeview (p.s you can see it in my preview too)..
and i click the text in the treeview, in right hand side about properties.. it will show the properties of this mesh..
my problem is how to let the treeview know which one of the mesh i will select..
for example:
i load 10 mesh with 10 name:
sydney1
sydney2
sydney3
sydney4
sydney5
sydney6
sydney7
sydney8
sydney9
sydney10
i want if i select sydney8 in the treeview, the irrlicht engine know that i select this mesh and return the position of this file..
the mesh have a array? so each time i load a mesh and put in a array, and i can call it back..




