Code: Select all
irr::scene::IMesh* roomMesh = smgr->getMesh("Debug/room_mesh.b3d");
if ( !roomMesh )
return 1;
CGameEntity* room = gameLogic->createEntity();
Optional<IComponent*> meshComp = gameLogic->getComponentManager()->createComponent(CT_MESH_NODE);
if ( !meshComp.isValid() )
return 1;
room->addComponent(meshComp);
((CMeshSceneNodeComponent*)meshComp.var)->setMesh(roomMesh);
Code: Select all
IMeshSceneNode* mesh = smgr->createMeshSceneNode(0);
mesh->setMesh(roomNode);