Need help with getting code to work IMesh to IAnimatedMesh?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kennypu666
Posts: 26
Joined: Thu Apr 26, 2007 6:57 am

Need help with getting code to work IMesh to IAnimatedMesh?

Post by kennypu666 »

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:

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();
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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Do this instead:

ITriangleSelector* selector = smgr->createOctTreeTriangleSelector( roommesh,roommesh_node,128);

You don't need roommesh->getMesh(0) because you already have an IMesh, which is what you want!
Image Image Image
kennypu666
Posts: 26
Joined: Thu Apr 26, 2007 6:57 am

Post by kennypu666 »

!! it worked!! thanks for your help JP!!
Ken
Post Reply