Rofar
Member
|
objQuery
Does objQuery only operate on active world areas? Assuming it queries scene node objects, then this would only be valid for world areas within the active range I'm guessing.
|
|
02-05-2010 04:16 AM |
|
Esenthel
Administrator
|
RE: objQuery
Hi,
it can return objects from AREA_ACTIVE and AREA_INACTIVE areas
but not from AREA_CACHE, AREA_UNLOADED
|
|
02-05-2010 03:50 PM |
|
Rofar
Member
|
RE: objQuery
What is the definition of these different area types? I guess it would be helpful to understand how the engine manages world areas better.
I can make a guess that AREA_CACHE means it has been loaded but is not currently in the scene. So it's still in memory. And AREA_UNLOADED means it has not been loaded from disk. AREA_ACTIVE = in frustrum? AREA_INACTIVE = loaded and in scene but not in view?
So given x and z world coordinates, is it easy to determine what state the world area that has those coordinates is in? And if it turns out to be in the cached or unloaded state, use that x,z for the location to be updated in Game:World.update() so it will be loaded?
|
|
02-05-2010 10:41 PM |
|
Esenthel
Administrator
|
RE: objQuery
please check the headers
the area states are described there, I guess it is in game\area.h
ill make a function for determining the area state for the next release
|
|
02-06-2010 12:02 AM |
|
Esenthel
Administrator
|
RE: objQuery
I've checked the codes, you can use this:
Vec pos;
VecI2 area=Game::World.worldToAreaPos(pos);
if(Grid<Game::Area> *grid=Game::World.areaActive(area))
{
// area at 'area' coordinates is AREA_ACTIVE
}else
{
// area is not AREA_ACTIVE
}
|
|
02-08-2010 12:18 AM |
|