Code: Select all
Ogre::MeshPtr mp = createStaticMesh(typ);
Ogre::Item *item = sceneManager->createItem(mp, Ogre::SCENE_DYNAMIC);
item->setDatablock(block);
item->setName(name);
Ogre::SceneNode *rootSceneNode =
sceneManager->getRootSceneNode(Ogre::SCENE_DYNAMIC)->
createChildSceneNode(Ogre::SCENE_DYNAMIC);
rootSceneNode->attachObject(item);
rootSceneNode->setPosition(Ogre::Vector3(0.0f, 0.0f, 0.0f));
rootSceneNode->setScale(Ogre::Vector3(3.0f, 3.0f, 3.0f));
Code: Select all
Ogre::MeshPtr mp = meshes.get_meshptr();
createStaticSubMesh(mp);
Code: Select all
void GS::createStaticSubMesh(Ogre::MeshPtr mesh)
{
Ogre::RenderSystem *renderSystem = root->getRenderSystem();
Ogre::VaoManager *vaoManager = renderSystem->getVaoManager();
/* The mesh has already been created at this point, so just
create submesh.
*/
Ogre::SubMesh *subMesh = mesh->createSubMesh();
// vertex declarations, fill data, vertex buffers, index buffers, etc...
}
Code: Select all
item->setVisible(booVal);
I would just like to show and hide a single submesh from several submeshes within a mesh object. How is that done? Should I be able to add a submesh to an item?