About Store Forum Documentation Contact



Post Reply 
objQuery
Author Message
Rofar Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
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
Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
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
Find all posts by this user Quote this message in a reply
Post Reply