PagedGeometry
1.3.0
|
Manages the rendering of geometry for a detail level type. More...
#include <PagedGeometry.h>
Public Types | |
typedef std::list< GeometryPage * > | TPGeometryPages |
A std::list of pointers to geometry pages. | |
Public Member Functions | |
GeometryPageManager (PagedGeometry *mainGeom) | |
Internal function - DO NOT USE. | |
~GeometryPageManager () | |
Internal function - DO NOT USE. | |
void | setNearRange (Ogre::Real nearRange) |
Sets the near viewing range of this page manager. More... | |
void | setFarRange (Ogre::Real farRange) |
Sets the far viewing range of this page manager. More... | |
Ogre::Real | getNearRange () const |
Gets the near viewing range of this page manager. More... | |
Ogre::Real | getFarRange () const |
Gets the far viewing range of this page manager. More... | |
void | setCacheSpeed (unsigned long maxCacheInterval=200, unsigned long inactivePageLife=2000) |
Customizes the cache behaviour (advanced). More... | |
void | setTransition (Ogre::Real transitionLength) |
Ogre::Real | getTransition () const |
TPGeometryPages | getLoadedPages () const |
Internal function - DO NOT USE. | |
template<class PageType > | |
void | initPages (const TBounds &bounds, const Ogre::Any &data=Ogre::Any(), Ogre::uint32 queryFlag=0) |
Internal function - DO NOT USE. | |
void | update (unsigned long deltaTime, Ogre::Vector3 &camPos, Ogre::Vector3 &camSpeed, bool &enableCache, GeometryPageManager *prevManager) |
Internal function - DO NOT USE. | |
void | reloadGeometry () |
Internal function - DO NOT USE. | |
void | reloadGeometryPage (const Ogre::Vector3 &point) |
Internal function - DO NOT USE. | |
void | reloadGeometryPages (const Ogre::Vector3 ¢er, Ogre::Real radius) |
Internal function - DO NOT USE. | |
void | reloadGeometryPages (const TBounds &area) |
Internal function - DO NOT USE. | |
void | preloadGeometry (const TBounds &area) |
Internal function - DO NOT USE. | |
void | resetPreloadedGeometry () |
Internal function - DO NOT USE. | |
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.
|
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.
|
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.
|
inline |
Gets the near viewing range of this page manager.
|
inline |
Gets the far viewing range of this page manager.
|
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.
Referenced by GeometryPageManager().