Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
PagedGeometry.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------------------
2Copyright (c) 2006 John Judnich
3
4This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
5Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
6 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
7 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
8 3. This notice may not be removed or altered from any source distribution.
9-------------------------------------------------------------------------------------*/
10
11#include "PagedGeometryConfig.h"
12
13//PagedGeometry.h
14//Main header file for the PagedGeometry engine.
15
16// this small snipped disables some warnings under MSVC that can be ignored normally
17#ifdef _MSC_VER
18// disable MSVC warning "... possible loss of data"
19//# pragma warning(disable: 4244)
20#endif //_MSC_VER
21
22
23#ifndef __PagedGeometry_H__
24#define __PagedGeometry_H__
25
26#include <limits> // numeric_limits<>
27#include <memory>
28
29#include <OgreRoot.h>
30#include <OgrePrerequisites.h>
31#include <OgreRenderSystem.h>
32#include <OgreEntity.h>
33#include <OgreCommon.h>
34#include <OgreCamera.h>
35#include <OgreVector3.h>
36#include <OgreTimer.h>
37#include <OgreMesh.h>
38
39namespace Forests {
40
41class GeometryPageManager;
42class PageLoader;
43
45typedef Ogre::TRect<Ogre::Real> TBounds;
46
47//-------------------------------------------------------------------------------------
71{
72public:
92 PagedGeometry(Ogre::Camera *cam = NULL, Ogre::Real pageSize = 100, Ogre::SceneNode* groupingSceneNode = NULL, Ogre::RenderQueueGroupID queue = Ogre::RENDER_QUEUE_6);
93
95
108 void setCamera(Ogre::Camera *cam);
109
113 void setTempDir(Ogre::String dir);
114 Ogre::String getTempdir() { return this->tempdir; };
115
125 inline Ogre::Camera *getCamera() const
126 {
127 return sceneCam;
128 }
129
140 inline Ogre::SceneManager *getSceneManager() const
141 {
142 return sceneMgr;
143 }
144
154 inline Ogre::SceneNode *getSceneNode() const
155 {
156 return m_pagedGroupingNode;
157 }
158
179 void setBounds(const TBounds bounds);
180
200 void setInfinite();
201
220 inline const TBounds &getBounds() const
221 {
222 return m_bounds;
223 }
224
228 TBounds convertAABToTBounds( const Ogre::AxisAlignedBox & aab ) const;
229
241 void setPageSize(Ogre::Real size);
242
249 inline Ogre::Real getPageSize()
250 {
251 return pageSize;
252 }
253
254
348 template <class PageType> inline GeometryPageManager* addDetailLevel(Ogre::Real maxRange, Ogre::Real transitionLength = 0, const Ogre::Any &data = Ogre::Any());
349
358 void removeDetailLevels();
359
368 inline const std::list<GeometryPageManager*> &getDetailLevels() { return managerList; }
369
370
386 void setPageLoader(PageLoader *loader);
387
396 {
397 return pageLoader;
398 }
399
400
409 void update();
410
411
424 void reloadGeometry();
425
446 void reloadGeometryPage(const Ogre::Vector3 &point);
447
472 void reloadGeometryPages(const Ogre::Vector3 &center, Ogre::Real radius);
473
497 void reloadGeometryPages(const TBounds & area);
498
514 void preloadGeometry(const TBounds & area);
515
529
537 void setVisible(bool visible) { geometryAllowedVisible = visible; }
538
546
550 void setShadersEnabled(bool value) { shadersEnabled=value; }
552
553 /*
554 \brief Immediately loads visible geometry.
555 \param maxTime The maximum amount of time (in milliseconds) which cacheGeometry()
556 is allowed to use before returning (roughly).
557 \returns Whether or not everything was cached.
558
559 PagedGeometry automatically loads and caches geometry near the camera in real-time.
560 This function allows you to easily pre-load this geometry outside of your render loop.
561
562 For example, in your loading code, you might call PagedGeometry::cacheGeometry() to
563 load all your trees/etc. managed by PagedGeometry instantly, rather than later on.
564
565 If it takes several seconds to cache geometry, you may want to update a progress bar
566 more often. The maxTime parameter allows you to split up this task into smaller
567 segments for this purpose. Simply call cacheGeometry(maxTime) repeatedly until
568 everything is cached (cacheGeometry() will return true when finished ).
569 */
570 //todo
571 //bool cacheGeometry(unsigned long maxTime = 0);
572
574 Ogre::uint8 getRenderQueue() const { return m_nRenderQueue; }
575
576protected:
577 //Internal function - do not use
578 void _addDetailLevel(GeometryPageManager *mgr, Ogre::Real maxRange, Ogre::Real transitionLength);
579
580 Ogre::SceneManager *sceneMgr;
581 Ogre::SceneNode *m_pagedGroupingNode;
583
584 bool geometryAllowedVisible; //If set to false, all geometry managed by this PagedGeometry is hidden
585
586 //Camera data
587 Ogre::Camera *sceneCam;
588 Ogre::Vector3 oldCamPos;
589
590 Ogre::Camera *lastSceneCam;
591 Ogre::Vector3 lastOldCamPos;
592
593 //This list keeps track of all the GeometryPageManager's added with addPageManager()
594 std::list<GeometryPageManager*> managerList;
595
596 //The assigned PageLoader used to load entities
598
599 //The bounds and page size
601 //The page size
602 Ogre::Real pageSize;
603 Ogre::uint8 m_nRenderQueue;
604
605 //Time-related data
606 Ogre::Timer timer;
607 unsigned long lastTime;
608 Ogre::String tempdir;
609};
610
611
612
613//-------------------------------------------------------------------------------------
672{
674
675public:
696 virtual void init(PagedGeometry *geom, const Ogre::Any &data) = 0;
697
715 virtual void setRegion(Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom) {};
716
732 virtual void addEntity(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color) = 0;
733
744 virtual void build() {}
745
759 virtual void removeEntities() = 0;
760
778 virtual void setFade(bool enabled, Ogre::Real visibleDist = 0, Ogre::Real invisibleDist = 0) = 0;
779
784 virtual void setVisible(bool visible) = 0;
785
795 virtual void update() {}
796
803 inline Ogre::Vector3 &getCenterPoint() { return _centerPoint; }
804
811 inline bool isVisible() { return (_visible && _loaded); }
812
831 virtual const Ogre::AxisAlignedBox &getBoundingBox();
832
842 virtual void addEntityToBoundingBox(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale);
843
853 virtual void clearBoundingBox();
854
860 virtual ~GeometryPage() {}
861
866 GeometryPage();
867
868private:
869 //These values and functions are used by the GeometryPageManager internally.
870 Ogre::Vector3 _centerPoint; //The central point of this page (used to visibility calculation)
871 int _xIndex, _zIndex; //The absolute grid position of this page
872 unsigned long _inactiveTime; //How long this page has been inactive (used to calculate expired pages)
873 bool _visible; //Flag indicating if page is visible
874 bool _fadeEnable; //Flag indicating if page fading is enabled
875
876 bool _pending; //Flag indicating if page needs loading
877 bool _loaded; //Flag indicating if page is loaded
878 bool _needsUnload; //Flag indicating if page needs unloading before next load
879 bool _keepLoaded; //Flag indicating if the page should not be unloaded
880 std::list<GeometryPage*>::iterator _iter; //Iterator in loadedList
881
882 Ogre::AxisAlignedBox _trueBounds; //Actual bounding box of the 3D geometry added to this page
883 bool _trueBoundsUndefined; //Flag indicating if _trueBounds has not been defined yet
884};
885
886
887
888//-------------------------------------------------------------------------------------
899{
914
920 Ogre::Vector3 centerPoint;
921
933
945
946 std::vector<Ogre::Mesh*> meshList;
947};
948
999{
1000public:
1020 virtual void loadPage(PageInfo &page) = 0;
1021
1037 virtual void unloadPage(PageInfo &page) {}
1038
1052 virtual void frameUpdate() {}
1053
1059 virtual ~PageLoader() {}
1060
1061protected:
1081 void addEntity(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale = Ogre::Vector3::UNIT_SCALE, const Ogre::ColourValue &color = Ogre::ColourValue::White)
1082 {
1083 geomPage->addEntity(ent, position, rotation, scale, color);
1084 geomPage->addEntityToBoundingBox(ent, position, rotation, scale);
1085 }
1086
1087private:
1089
1090 //Do NOT modify or use this variable - it is used internally by addEntity()
1092};
1093
1094
1095
1096//-------------------------------------------------------------------------------------
1117{
1118public:
1120 typedef std::list<GeometryPage*> TPGeometryPages;
1121
1124
1127
1136 inline void setNearRange(Ogre::Real nearRange)
1137 {
1138 nearDist = nearRange;
1140 }
1141
1150 inline void setFarRange(Ogre::Real farRange)
1151 {
1152 farDist = farRange;
1154
1157 }
1158
1165 inline Ogre::Real getNearRange() const
1166 {
1167 return nearDist;
1168 }
1169
1176 inline Ogre::Real getFarRange() const
1177 {
1178 return farDist;
1179 }
1180
1210
1211 inline void setTransition(Ogre::Real transitionLength)
1212 {
1213 if (transitionLength > 0) {
1214 //Setup valid transition
1215 fadeLength = transitionLength;
1217 fadeEnabled = true;
1218 } else {
1219 //<= 0 indicates disabled transition
1220 fadeLength = 0;
1221 fadeLengthSq = 0;
1222 fadeEnabled = false;
1223 }
1224
1227 }
1228
1229 inline Ogre::Real getTransition() const
1230 {
1231 return fadeLength;
1232 }
1233
1234
1236 inline TPGeometryPages getLoadedPages() const { return loadedList; }
1237
1239 template <class PageType> void initPages(const TBounds& bounds, const Ogre::Any &data = Ogre::Any());
1240
1242 void update(unsigned long deltaTime, Ogre::Vector3 &camPos, Ogre::Vector3 &camSpeed, bool &enableCache, GeometryPageManager *prevManager);
1243
1245 void reloadGeometry();
1246
1248 void reloadGeometryPage(const Ogre::Vector3 &point);
1249
1251 void reloadGeometryPages(const Ogre::Vector3 &center, Ogre::Real radius);
1252
1254 void reloadGeometryPages(const TBounds & area);
1255
1257 void preloadGeometry(const TBounds & area);
1258
1261
1262private:
1264
1265 //geomGrid is a 2D array storing all the GeometryPage instances managed by this object.
1266 GeometryPage **geomGrid; //A dynamic 2D array of pointers (2D grid of GeometryPage's)
1267 GeometryPage **scrollBuffer; //A dynamic 1D array of pointers (temporary GeometryPage's used in scrolling geomGrid)
1268 int geomGridX, geomGridZ; //The dimensions of the dynamic array
1269 TBounds gridBounds; //Current grid bounds
1270
1271 //Fade transitions
1274
1275 //Inline function used to get geometry page tiles
1276 inline GeometryPage *_getGridPage(const int x, const int z)
1277 {
1278 #ifdef _DEBUG
1279 if(x >= geomGridX || z >= geomGridZ )
1280 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
1281 "Grid dimension is out of bounds",
1282 "GeometryPageManager::_getGridPage()");
1283 #endif
1284
1285 return geomGrid[z * geomGridX + x];
1286 }
1287 inline void _setGridPage(const int x, const int z, GeometryPage *page)
1288 {
1289 #ifdef _DEBUG
1290 if(x >= geomGridX || z >= geomGridZ )
1291 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
1292 "Grid dimension is out of bounds",
1293 "GeometryPageManager::_setGridPage()");
1294 #endif
1295
1296 geomGrid[z * geomGridX + x] = page;
1297 }
1298
1299 //Utility functions for loading/unloading geometry pages (see source for detailed descriptions)
1300 void _loadPage(GeometryPage *page);
1301 void _unloadPage(GeometryPage *page);
1302 void _unloadPageDelayed(GeometryPage *page);
1303
1304 //Utility function for scrolling pages in the grid by the given amount
1305 void _scrollGridPages(int shiftX, int shiftZ);
1306
1307
1308 //Timer counting how long it has been since the last page has been cached
1309 unsigned long cacheTimer;
1310
1311 TPGeometryPages pendingList; //Pages of geometry to be loaded
1312 TPGeometryPages loadedList; //Pages of geometry already loaded
1313
1314 //Cache settings
1315 unsigned long maxCacheInterval;
1316 unsigned long inactivePageLife;
1317
1318 //Near and far visibility ranges for this type of geometry
1320 Ogre::Real farDist, farDistSq;
1321 Ogre::Real farTransDist, farTransDistSq; //farTransDist = farDist + fadeLength
1322};
1323
1324
1325
1326//-------------------------------------------------------------------------------------
1327
1328template <class PageType> inline GeometryPageManager* PagedGeometry::addDetailLevel(Ogre::Real maxRange, Ogre::Real transitionLength, const Ogre::Any &data)
1329{
1330 //Create a new page manager
1332
1333 //If vertex shaders aren't supported, don't use transitions
1334 Ogre::Root *root = root->getSingletonPtr(); //Work-around for Linux compiler bug
1335 if (!root->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_VERTEX_PROGRAM))
1336 transitionLength = 0;
1337
1338 //Add it to the list (also initializing maximum viewing distance)
1339 _addDetailLevel(mgr, maxRange, transitionLength);
1340
1341 //And initialize the paged (dependent on maximum viewing distance)
1342 mgr->initPages<PageType>(getBounds(), data);
1343
1344 return mgr;
1345}
1346
1347template <class PageType> inline void GeometryPageManager::initPages(const TBounds& bounds, const Ogre::Any &data)
1348{
1349 // Calculate grid size, if left is Real minimum, it means that bounds are infinite
1350 // scrollBuffer is used as a flag. If it is allocated than infinite bounds are used
1351 // !!! Two cases are required because of the way scrolling is implemented
1352 // if it is redesigned it would allow to use the same functionality.
1353 if(bounds.width() < 0.00001)
1354 {
1355 // In case of infinite bounds bounding rect needs to be calculated in a different manner, since
1356 // it represents local bounds, which are shifted along with the player's movements around the world.
1357 geomGridX = (2 * farTransDist / mainGeom->getPageSize()) + 4;
1358 gridBounds.top = 0;
1359 gridBounds.left = 0;
1362 // Allocate scroll buffer (used in scrolling the grid)
1364
1365 //Note: All this padding and transition preparation is performed because even in infinite
1366 //mode, a local grid size must be chosen. Unfortunately, this also means that view ranges
1367 //and transition lengths cannot be exceeded dynamically with set functions.
1368 }
1369 else
1370 {
1371 //Bounded mode
1372 gridBounds = bounds;
1373 // In case the devision does not give the round number use the next largest integer
1374 geomGridX = std::ceil(gridBounds.width() / mainGeom->getPageSize());
1375 }
1376 geomGridZ = geomGridX; //Note: geomGridX == geomGridZ; Need to merge.
1377
1378
1379 //Allocate grid array
1381
1382 int xioffset = Ogre::Math::Floor(gridBounds.left / mainGeom->getPageSize());
1383 int zioffset = Ogre::Math::Floor(gridBounds.top / mainGeom->getPageSize());
1384 for (int x = 0; x < geomGridX; ++x)
1385 {
1386 for (int z = 0; z < geomGridZ; ++z)
1387 {
1388 GeometryPage* page = new PageType();
1389 page->init(mainGeom, data);
1390 // 0,0 page is located at (gridBounds.left,gridBounds.top) corner of the bounds
1391 page->_centerPoint.x = ((x + 0.5f) * mainGeom->getPageSize()) + gridBounds.left;
1392 page->_centerPoint.z = ((z + 0.5f) * mainGeom->getPageSize()) + gridBounds.top;
1393 page->_centerPoint.y = 0.0f;
1394 page->_xIndex = x + xioffset;
1395 page->_zIndex = z + zioffset;
1396 page->_inactiveTime = 0;
1397 page->_loaded = false;
1398 page->_needsUnload = false;
1399 page->_pending = false;
1400 page->_keepLoaded = false;
1401 page->_visible = false;
1402 page->_fadeEnable = false;
1403
1404 page->clearBoundingBox();
1405
1406 _setGridPage(x, z, page);
1407 }
1408 }
1409}
1410
1411
1412}
1413
1414
1415
1416
1417#endif
This base-class can be extended to provide different ways of representing entities.
virtual void setFade(bool enabled, Ogre::Real visibleDist=0, Ogre::Real invisibleDist=0)=0
Sets fade behavior for this page.
Ogre::Vector3 _centerPoint
Ogre::AxisAlignedBox _trueBounds
virtual void removeEntities()=0
Remove all geometry/entities from the page completely.
virtual void init(PagedGeometry *geom, const Ogre::Any &data)=0
Prepare a geometry page for use.
virtual void clearBoundingBox()
Advanced: Reset the bounding box used by addEntityToBoundingBox()
virtual void build()
Perform any final steps to make added entities appear in the scene.
virtual void setVisible(bool visible)=0
Toggle the entire page's visibility.
virtual void update()
Do whatever needs to be done to keep the page geometry up-to-date.
std::list< GeometryPage * >::iterator _iter
virtual const Ogre::AxisAlignedBox & getBoundingBox()
Advanced: Return the bounding box computed with addEntityToBoundingBox()
virtual void addEntity(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color)=0
Add an entity to the page, at the specified position, rotation, and scale.
virtual ~GeometryPage()
Destructor This is defined here so the destructors of derived classes are called properly.
Ogre::Vector3 & getCenterPoint()
Gets the center point of the page.
bool isVisible()
Return the current visibility status of the page.
GeometryPage()
Constructor Initialise everything to zero, false or NULL except for _trueBoundsUndefined that is set ...
unsigned long _inactiveTime
virtual void addEntityToBoundingBox(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale)
Advanced: Expand the current bounding box to include the given entity.
virtual void setRegion(Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom)
Prepare a geometry page for entities.
Manages the rendering of geometry for a detail level type.
void setTransition(Ogre::Real transitionLength)
Ogre::Real getTransition() const
void update(unsigned long deltaTime, Ogre::Vector3 &camPos, Ogre::Vector3 &camSpeed, bool &enableCache, GeometryPageManager *prevManager)
Internal function - DO NOT USE.
void reloadGeometryPage(const Ogre::Vector3 &point)
Internal function - DO NOT USE.
void _scrollGridPages(int shiftX, int shiftZ)
GeometryPage * _getGridPage(const int x, const int z)
void initPages(const TBounds &bounds, const Ogre::Any &data=Ogre::Any())
Internal function - DO NOT USE.
void _unloadPage(GeometryPage *page)
void setFarRange(Ogre::Real farRange)
Sets the far viewing range of this page manager.
void setCacheSpeed(unsigned long maxCacheInterval=200, unsigned long inactivePageLife=2000)
Customizes the cache behaviour (advanced).
~GeometryPageManager()
Internal function - DO NOT USE.
void setNearRange(Ogre::Real nearRange)
Sets the near viewing range of this page manager.
void preloadGeometry(const TBounds &area)
Internal function - DO NOT USE.
TPGeometryPages getLoadedPages() const
Internal function - DO NOT USE.
void _setGridPage(const int x, const int z, GeometryPage *page)
void resetPreloadedGeometry()
Internal function - DO NOT USE.
Ogre::Real getNearRange() const
Gets the near viewing range of this page manager.
void _loadPage(GeometryPage *page)
Ogre::Real getFarRange() const
Gets the far viewing range of this page manager.
void reloadGeometryPages(const Ogre::Vector3 &center, Ogre::Real radius)
Internal function - DO NOT USE.
std::list< GeometryPage * > TPGeometryPages
A std::list of pointers to geometry pages.
void _unloadPageDelayed(GeometryPage *page)
void reloadGeometry()
Internal function - DO NOT USE.
A class which you extend to provide a callback function for loading entities.
virtual void unloadPage(PageInfo &page)
This may be overridden (optional) to unload custom data associated with a page.
GeometryPage * geomPage
virtual void frameUpdate()
Provides a method for you to perform per-frame tasks for your PageLoader if overridden (optional)
virtual void loadPage(PageInfo &page)=0
This should be overridden to load a specified region of entities.
virtual ~PageLoader()
Destructor This is defined here so the destructors of derived classes are called properly.
void addEntity(Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE, const Ogre::ColourValue &color=Ogre::ColourValue::White)
Call this from loadPage() to add an entity to the page being loaded.
A class providing highly optimized methods for rendering massive amounts of geometry.
Ogre::Real getPageSize()
Gets the current page size.
std::list< GeometryPageManager * > managerList
void reloadGeometryPages(const Ogre::Vector3 &center, Ogre::Real radius)
Reloads geometry in the given radius area.
void removeDetailLevels()
Removes all detail levels from the PagedGeometry object.
const TBounds & getBounds() const
Gets the current geometry boundary.
void setCamera(Ogre::Camera *cam)
Sets the camera to use when calculating levels of detail.
void setTempDir(Ogre::String dir)
Sets the output directory for the imposter pages.
void setVisible(bool visible)
Hides or unhides all geometry managed by this PagedGeometry instance \params visible Whether or not y...
void preloadGeometry(const TBounds &area)
Preloads a region of geometry (loads once and never loads again)
Ogre::uint8 getRenderQueue() const
Returns the rendering queue that paged geometry was constructed with.
Ogre::Camera * sceneCam
void reloadGeometryPage(const Ogre::Vector3 &point)
Reloads geometry at the given location.
void setPageLoader(PageLoader *loader)
Assigns a PageLoader object for the PagedGeometry.
GeometryPageManager * addDetailLevel(Ogre::Real maxRange, Ogre::Real transitionLength=0, const Ogre::Any &data=Ogre::Any())
Adds a detail level to the PagedGeometry object.
const std::list< GeometryPageManager * > & getDetailLevels()
Returns a reference to a list of all added detail levels.
Ogre::SceneManager * sceneMgr
bool getVisible()
Returns whether or not geometry managed by this PagedGeometry instance is visible.
Ogre::SceneNode * getSceneNode() const
Gets the scene node to which all PagedGeometry geometry is attached.
void setInfinite()
Switches to infinite mode.
Ogre::Vector3 lastOldCamPos
Ogre::String getTempdir()
Ogre::SceneManager * getSceneManager() const
Gets the scene manager which is being used to display the geometry.
Ogre::uint8 m_nRenderQueue
The used rendering queue.
Ogre::Camera * getCamera() const
Gets the camera which is used to calculate levels of detail.
PageLoader * getPageLoader()
Gets the PageLoader currently being used to load geometry.
void setShadersEnabled(bool value)
disables the use of shaders
Ogre::Camera * lastSceneCam
void resetPreloadedGeometry()
Releases geometry preloaded with preloadGeometry() to be unloaded if necessary.
void setPageSize(Ogre::Real size)
Sets the page size.
Ogre::SceneNode * m_pagedGroupingNode
void _addDetailLevel(GeometryPageManager *mgr, Ogre::Real maxRange, Ogre::Real transitionLength)
void update()
Updates this PagedGeometry object.
void setBounds(const TBounds bounds)
Switches to bounded mode and uses the given boundaries.
TBounds convertAABToTBounds(const Ogre::AxisAlignedBox &aab) const
Convert an Ogre::AxisAlignedBox to a TBounds coplanar to the plane defined by the UP axis.
void reloadGeometry()
Reloads all visible geometry.
Ogre::TRect< Ogre::Real > TBounds
Define TBounds as a TRect using Real numeric units.
Useful page information supplied to a pageloader.
int zIndex
The Z index of the page tile.
Ogre::Vector3 centerPoint
The center of the page (simply the middle of the bounds).
TBounds bounds
The page boundaries in which all entities should be placed.
int xIndex
The X index of the page tile.
std::vector< Ogre::Mesh * > meshList