That's a problem when I want to get a mesh from .irr scene.Here is the codes.
smgr->loadScene("anting.irr");
//=============================================
ISceneNode *scene_node=smgr->getSceneNodeFromName("rooms");
IAnimatedMesh *levelMesh=0;
if(scene_node && (scene_node->getType()==ESNT_MESH))
{
levelMesh=(IAnimatedMesh*)scene_node;
}
ISceneNode *levelNode=0;
if(levelMesh)
{
//The problem is here...
levelNode=smgr->addOctTreeSceneNode(levelMesh->getMesh(0));
}
//=============================================
Why can't I use "levelmesh->getMesh(0)" to get a mesh?Every time I execute this,the compiler occur an error.I have no idea,can someone give me a hand?
How to get mesh from a .irr scene?
you cant typecast a ISceneNode into an IAnimatedMesh.
youd have to typecast the scene_node to IAnimatedMeshSceneNode.
then you can use the getMesh() method.
also this might help :
http://irrlicht.sourceforge.net/phpBB2/ ... 47&start=0
although it goes through adding colission to the mesh, it also shows how to get the mesh in order to set the collision to it
youd have to typecast the scene_node to IAnimatedMeshSceneNode.
then you can use the getMesh() method.
also this might help :
http://irrlicht.sourceforge.net/phpBB2/ ... 47&start=0
although it goes through adding colission to the mesh, it also shows how to get the mesh in order to set the collision to it
-
- Posts: 5
- Joined: Thu Mar 01, 2007 2:13 am