Code: Select all
Ogre::HlmsUnlitDatablock *block;
Ogre::MeshPtr mp;
// ...
Ogre::Item *item = sceneManager->createItem(mp, Ogre::SCENE_DYNAMIC);
item->setDatablock(block);
Code: Select all
Ogre::HlmsUnlitDatablock *block;
Ogre::MeshPtr mp;
// ...
Ogre::Item *item = sceneManager->createItem(mp, Ogre::SCENE_DYNAMIC);
item->setDatablock(block);
My problem is I don't create the second SubMesh till after the first Mesh/SubMesh has been created. So after the Mesh has been created, I later create another Ogre::SubMesh object and attach it to the same Ogre::Mesh object, (so I guess you could say I am creating the SubMesh manually).SubItem instances are never created manually. They are created at the same time as their parent Item by the SceneManager method createItem.
Code: Select all
Ogre::MeshPtr mp = meshManager->createManual(...);
mp->createSubMesh();
// ...
Ogre::Item *item = sceneManager->createItem(mp, Ogre::SCENE_DYNAMIC);
Code: Select all
Ogre::SubMesh *subMesh = mp->createSubMesh();
// ...