![]() |
Rigs of Rods 2026.01
Soft-body Physics Simulation
|
Manages the rendering of geometry for a detail level type.
This class manages pages of geometry, cacheing, deleting, etc. them as necessary. It analyzes the motion of the camera to determine how fast pages need to be cached, and deletes obsolete pages which have been invisible for a certain amount of time.
When you call PagedGeometry::addDetailLevel(), a GeometryPageManager is created to manage the new detail level. addDetailLevel() returns a pointer to this page manager, allowing you access to some useful functions, documented below.
Definition at line 1116 of file PagedGeometry.h.
Public Types | |
| typedef std::list< GeometryPage * > | TPGeometryPages |
Public Member Functions | |
| GeometryPageManager (PagedGeometry *mainGeom) | |
| ~GeometryPageManager () | |
| void | setNearRange (Ogre::Real nearRange) |
| void | setFarRange (Ogre::Real farRange) |
| Ogre::Real | getNearRange () const |
| Ogre::Real | getFarRange () const |
| void | setCacheSpeed (unsigned long maxCacheInterval=200, unsigned long inactivePageLife=2000) |
| void | setTransition (Ogre::Real transitionLength) |
| Ogre::Real | getTransition () const |
| TPGeometryPages | getLoadedPages () const |
| template<class PageType > | |
| void | initPages (const TBounds &bounds, const Ogre::Any &data=Ogre::Any()) |
| void | update (unsigned long deltaTime, Ogre::Vector3 &camPos, Ogre::Vector3 &camSpeed, bool &enableCache, GeometryPageManager *prevManager) |
| void | reloadGeometry () |
| void | reloadGeometryPage (const Ogre::Vector3 &point) |
| void | reloadGeometryPages (const Ogre::Vector3 ¢er, Ogre::Real radius) |
| void | reloadGeometryPages (const TBounds &area) |
| void | preloadGeometry (const TBounds &area) |
| void | resetPreloadedGeometry () |
Private Member Functions | |
| GeometryPage * | _getGridPage (const int x, const int z) |
| void | _setGridPage (const int x, const int z, GeometryPage *page) |
| void | _loadPage (GeometryPage *page) |
| void | _unloadPage (GeometryPage *page) |
| void | _unloadPageDelayed (GeometryPage *page) |
| void | _scrollGridPages (int shiftX, int shiftZ) |
Private Attributes | |
| PagedGeometry * | mainGeom |
| GeometryPage ** | geomGrid |
| GeometryPage ** | scrollBuffer |
| int | geomGridX |
| int | geomGridZ |
| TBounds | gridBounds |
| Ogre::Real | fadeLength |
| Ogre::Real | fadeLengthSq |
| bool | fadeEnabled |
| unsigned long | cacheTimer |
| TPGeometryPages | pendingList |
| TPGeometryPages | loadedList |
| unsigned long | maxCacheInterval |
| unsigned long | inactivePageLife |
| Ogre::Real | nearDist |
| Ogre::Real | nearDistSq |
| Ogre::Real | farDist |
| Ogre::Real | farDistSq |
| Ogre::Real | farTransDist |
| Ogre::Real | farTransDistSq |
| typedef std::list<GeometryPage*> Forests::GeometryPageManager::TPGeometryPages |
A std::list of pointers to geometry pages.
Definition at line 1120 of file PagedGeometry.h.
| Forests::GeometryPageManager::GeometryPageManager | ( | PagedGeometry * | mainGeom | ) |
Internal function - DO NOT USE.
Definition at line 306 of file PagedGeometry.cpp.
| Forests::GeometryPageManager::~GeometryPageManager | ( | ) |
Internal function - DO NOT USE.
Definition at line 321 of file PagedGeometry.cpp.
|
inlineprivate |
Definition at line 1276 of file PagedGeometry.h.
|
private |
Definition at line 743 of file PagedGeometry.cpp.
|
private |
Definition at line 818 of file PagedGeometry.cpp.
|
inlineprivate |
Definition at line 1287 of file PagedGeometry.h.
|
private |
Definition at line 782 of file PagedGeometry.cpp.
|
private |
Definition at line 810 of file PagedGeometry.cpp.
|
inline |
Gets the far viewing range of this page manager.
Definition at line 1176 of file PagedGeometry.h.
|
inline |
Internal function - DO NOT USE.
Definition at line 1236 of file PagedGeometry.h.
|
inline |
Gets the near viewing range of this page manager.
Definition at line 1165 of file PagedGeometry.h.
|
inline |
Definition at line 1229 of file PagedGeometry.h.
|
inline |
Internal function - DO NOT USE.
Definition at line 1347 of file PagedGeometry.h.
| void Forests::GeometryPageManager::preloadGeometry | ( | const TBounds & | area | ) |
Internal function - DO NOT USE.
Definition at line 684 of file PagedGeometry.cpp.
| void Forests::GeometryPageManager::reloadGeometry | ( | ) |
Internal function - DO NOT USE.
Definition at line 590 of file PagedGeometry.cpp.
| void Forests::GeometryPageManager::reloadGeometryPage | ( | const Ogre::Vector3 & | point | ) |
Internal function - DO NOT USE.
Definition at line 602 of file PagedGeometry.cpp.
| void Forests::GeometryPageManager::reloadGeometryPages | ( | const Ogre::Vector3 & | center, |
| Ogre::Real | radius | ||
| ) |
Internal function - DO NOT USE.
| void Forests::GeometryPageManager::reloadGeometryPages | ( | const TBounds & | area | ) |
Internal function - DO NOT USE.
Definition at line 655 of file PagedGeometry.cpp.
| void Forests::GeometryPageManager::resetPreloadedGeometry | ( | ) |
Internal function - DO NOT USE.
Definition at line 729 of file PagedGeometry.cpp.
|
inline |
Customizes the cache behaviour (advanced).
| maxCacheInterval | The maximum period of time (milliseconds) before another page is loaded. |
| inactivePageLife | The maximum period of time (milliseconds) a inactive (invisible) page is allowed to stay loaded. |
The GeometryPageManager automatically determines how fast pages should be cached to keep everything running as smooth as possible, but there are a few options that are adjustable. This function allows you to adjust these variables to fine-tune cache performance.
The maxCacheInterval is basically a minimum rate at which pages are cached. Normally, a stopped camera would cause the cache rate prediction algorithm to say 0 pages-per-second must be cached. However, this is not optimal, since idle time should be taken advantage of to finish loading. By adjusting this value, you can set how much caching you want going on when the camera is stopped or moving very slowly.
The inactivePageLife allows you to set how long inactive pages remain in memory. An inactive page is one that is out of the cache range and may not be immediately needed. By allowing these pages to remain in memory for a short period of time, the camera can return to it's previous position with no need to reload anything.
Definition at line 1205 of file PagedGeometry.h.
|
inline |
Sets the far viewing range of this page manager.
| farRange | The distance where this page manager stops displaying geometry. |
All geometry displayed by this page manager is confined within a certain radius gap from the camera. This function sets the farthest distance geometry is allowed from the camera.
Definition at line 1150 of file PagedGeometry.h.
|
inline |
Sets the near viewing range of this page manager.
| nearRange | The distance where this page manager starts displaying geometry. |
All geometry displayed by this page manager is confined within a certain radius gap from the camera. This function sets the closest distance geometry is allowed near the camera.
Definition at line 1136 of file PagedGeometry.h.
|
inline |
Definition at line 1211 of file PagedGeometry.h.
| void Forests::GeometryPageManager::update | ( | unsigned long | deltaTime, |
| Ogre::Vector3 & | camPos, | ||
| Ogre::Vector3 & | camSpeed, | ||
| bool & | enableCache, | ||
| GeometryPageManager * | prevManager | ||
| ) |
Internal function - DO NOT USE.
Definition at line 335 of file PagedGeometry.cpp.
|
private |
Definition at line 1309 of file PagedGeometry.h.
|
private |
Definition at line 1273 of file PagedGeometry.h.
|
private |
Definition at line 1272 of file PagedGeometry.h.
|
private |
Definition at line 1272 of file PagedGeometry.h.
|
private |
Definition at line 1320 of file PagedGeometry.h.
|
private |
Definition at line 1320 of file PagedGeometry.h.
|
private |
Definition at line 1321 of file PagedGeometry.h.
|
private |
Definition at line 1321 of file PagedGeometry.h.
|
private |
Definition at line 1266 of file PagedGeometry.h.
|
private |
Definition at line 1268 of file PagedGeometry.h.
|
private |
Definition at line 1268 of file PagedGeometry.h.
|
private |
Definition at line 1269 of file PagedGeometry.h.
|
private |
Definition at line 1316 of file PagedGeometry.h.
|
private |
Definition at line 1312 of file PagedGeometry.h.
|
private |
Definition at line 1263 of file PagedGeometry.h.
|
private |
Definition at line 1315 of file PagedGeometry.h.
|
private |
Definition at line 1319 of file PagedGeometry.h.
|
private |
Definition at line 1319 of file PagedGeometry.h.
|
private |
Definition at line 1311 of file PagedGeometry.h.
|
private |
Definition at line 1267 of file PagedGeometry.h.