

enum AREA_STATE
{
	AREA_UNLOADED, // the area is completely unloaded, it doesn't contain any data at all
	AREA_CACHE, // the area has data loaded from the disk to the temporary memory, but not used in the game, objects are not listed in object containers, actors are not created
	AREA_INACTIVE, // the area has data loaded and used in the game, objects are listed in object containers however they're not updated or  drawn, all actors are frozen (set to kinematic and cannot move)
	AREA_ACTIVE, // the area has data loaded and used in the game, objects are listed in object containers         and are     updated and drawn,     actors can be dynamic
	AREA_LOAD, // this state can be specified only for World.areaSetState, it converts state from AREA_UNLOADED to AREA_CACHE (if the state was not AREA_UNLOADED then it remains unmodified)
};


struct Area3D{

	Area3D(C VecI2 &xz, Ptr grid_user);
	~Area3D();
	void Load();
	void Save();
	void Build();
	void update();// update
	void Draw();
	void CreatePhysics();
	void RemovePhysics();

	void Unload();
	C Vec Pos()C{ return mat.pos; }
	
	AREA_STATE state;
	VecI pos;
private:
	Flt   last_update;
	Image img;
	Blocks          blocks;
	BlocksOcclusion blocks_occlusion; // helper object used for calculating blocks ambient occlusion
	Matrix mat;
};