Need help with getting code to work IMesh to IAnimatedMesh?
Posted: Thu Dec 20, 2007 7:41 am
Hi, I'm a beginner, and I was using this topic as a reference: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17247, and I just need to get the last part. ok, so I have the code:
and everypart works ok except at creating the ITriangleSelector. It gives the error 'class irr::scene::IMesh has no member named getMesh'. I know the problem is because roommesh is a IMesh, but how would I go about converting it into a IAnimatedMeshSceneNode, or just make the code work? Any help will be appreciated. Thanks in advance,
Ken
Code: Select all
//get the mesh name out
stringc roommesh_name = attribs->getAttributeAsString("Mesh");
attribs->drop();
//get a mesh from name
IMesh* roommesh = smgr->getMesh(roommesh_name.c_str())->getMesh(0);
ITriangleSelector* selector = smgr->createOctTreeTriangleSelector( roommesh->getMesh(0),roommesh_node,128);
roommesh_node->setTriangleSelector(selector);
selector->drop();
Ken