I've got a strange issue I can't bare with (using manual world loading).
I'm setting area active with:
Code:
Memc < Game::WorldManager::AreaState > areaStates;
areaStates.New().set(VecI2(0,0, Game::AREA_ACTIVE);
Game::World.areaSetState(areaStates, true);
Then I'm generating heightmap and adding some objects with:
Code:
Game::ObjParamsPtr object = Game::Objs.ptrRequire("Data/Obj/plant/Grass/0.obj");
object->type(true, "OBJ_STATIC");
Game::Obj *obj=Game::World.objCreateNear(*object, Matrix(object->scale(), Vec(meshX, meshY, meshZ)));
It works OK, the area is created, set active and the objects appear.
Then I'm comencing a:
Code:
Memc < Game::WorldManager::AreaState > areaStates;
Game::World.areaSetState(areaStates, true);
Because container is empty, all areas are unloaded. It's OK.
But now, when I'm doing again the first two steps (setting area active and putting object), area appears and the previous object is already placed... In result, I have 2 objects, but I want only the new one. Aren't the objects deleted, when I set an area inactive? How can I delete them?[/align]