2 #define _BLOCKUPDATER 1
31 using namespace vrecko;
33 using namespace xercesc_2_7;
35 #define SHOWVEC3(v) "(" << v.x() << ", " << v.y() << ", " << v.z() << ")"
37 namespace ArtificialWorld
56 objectCenterDir = osg::Vec3(0.0f, 0.0f, 0.0f);
57 objectCenterPoint = osg::Vec3(0.0f, 0.0f, 0.0f);
62 objectCenterDir = newCenterDir;
71 objectCenterPoint = newCenterPoint;
87 osg::Vec3 objectCenterDir;
89 osg::Vec3 objectCenterPoint;
102 virtual void update(
void);
104 virtual void preInitialize(
void);
106 virtual void postInitialize(
void);
109 virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode *parametersNode);
111 bool LoadXMLParametersFromFile(
string filename);
121 void HideSubBlocks();
123 void ShowSubBlocks();
142 list<Model*> getVisibleModels(osg::Vec3 position);
144 XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument*
getDOMDocument() {
return xmlDocument; }
151 void updatescene(
unsigned long distance);
153 void updatescene(osg::Vec3 position);
156 void UpdateModels(
unsigned long distance);
158 void UpdateSubBlocks();
165 XERCES_CPP_NAMESPACE_QUALIFIER XercesDOMParser* xmlParser;
166 XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* xmlDocument;
170 list<Model*> currentlyVisibleModels;
172 vector<SubBlock*> subBlocks;
174 vector<BlockUpdater*> subBlocksUpdaters;
177 osg::Vec3 lastViewerPosition;
184 vector<Model*> models;
187 list<Model*> getVisibleModels(
unsigned long distance);
190 void RemoveLoadedModels(list<Model*> *toRemove);
193 void AddModels(list<Model*> *toAdd);
201 osg::Vec4 boundingSphere;
203 osg::Vec3 boundingBox[2];