In Ogre Next, all old v1 things are in v1 namespace:
Code: Select all
v1::MeshPtr m1 = v1::MeshManager::getSingleton().create(s1, "General",
v1::HardwareBuffer::HBU_STATIC, v1::HardwareBuffer::HBU_STATIC );
So you should use v1::MeshManager.
Also Ogre Next has Item, which was Entity in old v1 Ogre.
There is also a useful method here, if you want to convert your v1 mesh to v2:
Code: Select all
void MeshUtils::importV1Mesh( const Ogre::String &meshName, const Ogre::String &groupName )
{
Ogre::v1::MeshPtr v1Mesh;
Ogre::MeshPtr v2Mesh;
v1Mesh = Ogre::v1::MeshManager::getSingleton().load( meshName, groupName,
Ogre::v1::HardwareBuffer::HBU_STATIC, Ogre::v1::HardwareBuffer::HBU_STATIC );
//Create a v2 mesh to import to, with the same name (arbitrary).
v2Mesh = Ogre::MeshManager::getSingleton().createByImportingV1( meshName, groupName,
v1Mesh.get(), true, true, true );
//Free memory
v1Mesh->unload();
// Do not destroy mesh, it could be used to recover from lost device.
// Ogre::v1::MeshManager::getSingleton().remove( meshName );
Here is an example from my demo project, creating a v1 plane in Ogre Next:
https://github.com/cryham/ogre3ter-demo ... ky.cpp#L32
Code: Select all
void CreatePlane(), DestroyPlane();
Ogre::Item *planeItem = 0;
Ogre::SceneNode *planeNode = 0;
Ogre::v1::MeshPtr planeMeshV1 = 0;
Ogre::MeshPtr planeMesh = 0;
Code: Select all
void TerrainGame::CreatePlane()
{
sizeXZ = 2000.0f;
planeMeshV1 = v1::MeshManager::getSingleton().createPlane(
"Plane v1", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Plane( Vector3::UNIT_Y, 1.0f ), sizeXZ, sizeXZ,
10, 10, true, 1, 40.0f, 40.0f, Vector3::UNIT_Z,
v1::HardwareBuffer::HBU_STATIC, v1::HardwareBuffer::HBU_STATIC );
planeMesh = MeshManager::getSingleton().createByImportingV1(
"Plane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
planeMeshV1.get(), true, true, true );
SceneManager *mgr = mGraphicsSystem->getSceneManager();
SceneNode *rootNode = mgr->getRootSceneNode( SCENE_STATIC );
planeItem = mgr->createItem( planeMesh, SCENE_STATIC );
planeItem->setDatablock( "Ground" );
planeNode = rootNode->createChildSceneNode( SCENE_STATIC );
planeNode->setPosition( 0, 0, 0 );
planeNode->attachObject( planeItem );
}
void TerrainGame::DestroyPlane()
{
SceneManager *mgr = mGraphicsSystem->getSceneManager();
if (planeNode)
{ mgr->destroySceneNode(planeNode); planeNode = 0; }
if (planeItem)
{ mgr->destroyItem(planeItem); planeItem = 0; }
auto& ms = MeshManager::getSingleton();
auto& m1 = v1::MeshManager::getSingleton();
if (planeMesh) ms.remove(planeMesh); planeMesh.reset();
if (planeMeshV1) m1.remove(planeMeshV1); planeMeshV1.reset();
}