Any advice?
Code: Select all
bool Game::loadMap(std::string filename)
{
/* Remove the old map */
if (_map != 0)
_map->remove();
IMeshSceneNode* mapNode = smgr->addOctreeSceneNode(smgr->getMesh(filename.c_str()));
/* Load the new map*/
_map = new Map(mapNode, gameObjectManager);
gameObjectManager->addGameObject(_map);
mapNode->setPosition(core::vector3df(500, 0, 500));
mapNode->setScale(core::vector3df(6, 0, 6));
mapNode->setMaterialFlag(EMF_LIGHTING, false);
scene::ITriangleSelector* s = smgr->createOctreeTriangleSelector(mapNode->getMesh(),
mapNode,
128);
mapNode->setTriangleSelector(s);
s->drop();
/* Load the objects */
_map->addObject(1, 500, 500);
return true;
}