![]() |
VR-Forces 4.0.4 Class Documentation
|
DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source. More...

Public Member Functions | |
| DtOsgEarthTerrainSourcePager (DtVantageTerrainEngine *terrainEngine, osgEarth::MapNode *mapNode) | |
| virtual | ~DtOsgEarthTerrainSourcePager () |
| virtual DtTerrainSourceTracker * | createTerrainSourceTracker () |
| Creates and returns a DtOsgEarthTerrainSourceTracker. | |
| virtual bool | pageInTiles (DtTileKeyList &tileIds, const unsigned int intersectId=0) |
| Iterates over tileIds and calls pageInTile on each one. | |
| virtual bool | pageOutTiles (const DtTileKeyList &tilesToRemove) |
| Pages out the requested tiles, removes the corresponding collision objects from the collision world, decrements the terrainEngine's triangle count, and decrements the terrainEngine's pending removal command count. | |
| virtual void | updatePageTracker (const unsigned int intersectId=0) |
| Updates the DtOsgEarthTerrainSourceTracker. | |
Protected Member Functions | |
| virtual bool | addCollisionObject (osg::ref_ptr< osg::Node > node, unsigned int &numTrianglesOut) |
| Creates a collision object from the given terrain tile and adds it to the collision world. | |
| virtual bool | pageInTile (const osgEarth::TileKey &tileKey, const unsigned int intersectId=0) |
| Creates the requested osg heightfield, adds the heightfield as a collision shape to the bullet collision world, and adds the record of the tile to the pager's terrainSourceTracker for tracking and paging out purposes. | |
| virtual bool | pageOutTile (const osgEarth::TileKey &tileKey) |
| Removes the heightfield and the corresponding collision object from the collision world. | |
| virtual DtTileData * | createTileData (const osgEarth::TileKey &tileKey, const unsigned int &numTriangles, const unsigned int intersectId=0) const |
| Sets up and returns a new DtTileData object. | |
| virtual const unsigned int | determineTrackerLod () |
| Called by createTerrainSourceTracker. | |
| virtual DtNodeId | osgNodeId (osg::Node *node) |
| virtual osg::Node * | nodeFromId (DtNodeId nodeId) |
| virtual void | createEmptyTile (const osgEarth::TileKey &tileKey, const unsigned int intersectId=0) |
| Used when a tile cannot be created by osgEarth's tileBuilder. | |
Protected Attributes | |
| osgEarth::MapNode * | myMapNode |
| Map node which is used to generate heightfields. | |
| DtTerrainTileMap | myPagedInTilesMap |
| Map of tileIds to terrainTiles. | |
| osg::ref_ptr< osgTerrain::Terrain > | myOsgTerrain |
| Used when a heightfield cannot be created to. | |
DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source.
| DtOsgEarthTerrainSourcePager::DtOsgEarthTerrainSourcePager | ( | DtVantageTerrainEngine * | terrainEngine, |
| osgEarth::MapNode * | mapNode | ||
| ) |
| virtual DtOsgEarthTerrainSourcePager::~DtOsgEarthTerrainSourcePager | ( | ) | [virtual] |
| virtual DtTerrainSourceTracker* DtOsgEarthTerrainSourcePager::createTerrainSourceTracker | ( | ) | [virtual] |
Creates and returns a DtOsgEarthTerrainSourceTracker.
Implements DtTerrainSourcePager.
| virtual bool DtOsgEarthTerrainSourcePager::pageInTiles | ( | DtTileKeyList & | tileIds, |
| const unsigned int | intersectId = 0 |
||
| ) | [virtual] |
Iterates over tileIds and calls pageInTile on each one.
| tileIds | List of tileIds to page in. When a tile is successfuly paged in, it is removed from this list. |
| intersectId | Optional intersectId to seed new tiles with. |
| virtual bool DtOsgEarthTerrainSourcePager::pageOutTiles | ( | const DtTileKeyList & | tilesToRemove | ) | [virtual] |
Pages out the requested tiles, removes the corresponding collision objects from the collision world, decrements the terrainEngine's triangle count, and decrements the terrainEngine's pending removal command count.
| tilesToRemove | List of tileIds to page out. |
| virtual void DtOsgEarthTerrainSourcePager::updatePageTracker | ( | const unsigned int | intersectId = 0 | ) | [virtual] |
Updates the DtOsgEarthTerrainSourceTracker.
Implements DtTerrainSourcePager.
| virtual bool DtOsgEarthTerrainSourcePager::addCollisionObject | ( | osg::ref_ptr< osg::Node > | node, |
| unsigned int & | numTrianglesOut | ||
| ) | [protected, virtual] |
Creates a collision object from the given terrain tile and adds it to the collision world.
| terrainTile | The terrain tile to create a collision object for. |
| numTrianglesOut | The number of triangles that were added to the collision world by this terrainTile. |
| virtual bool DtOsgEarthTerrainSourcePager::pageInTile | ( | const osgEarth::TileKey & | tileKey, |
| const unsigned int | intersectId = 0 |
||
| ) | [protected, virtual] |
Creates the requested osg heightfield, adds the heightfield as a collision shape to the bullet collision world, and adds the record of the tile to the pager's terrainSourceTracker for tracking and paging out purposes.
| tileIds | The tileKey to create heightfield for. |
| intersectId | Optional parameter to create the tiles with a starting "lastUsed" value of intersectId. |
| virtual bool DtOsgEarthTerrainSourcePager::pageOutTile | ( | const osgEarth::TileKey & | tileKey | ) | [protected, virtual] |
Removes the heightfield and the corresponding collision object from the collision world.
Also removes the tracker's reference to this tile, decrements the terrainEngine's number of triangles, and number of pending page out commands.
| virtual DtTileData* DtOsgEarthTerrainSourcePager::createTileData | ( | const osgEarth::TileKey & | tileKey, |
| const unsigned int & | numTriangles, | ||
| const unsigned int | intersectId = 0 |
||
| ) | const [protected, virtual] |
Sets up and returns a new DtTileData object.
| tileKey | The tile key of the terrain to create tile data for. |
| heightField | The heightfield, used to get the corner heights. |
| numTriangles | The number of triangles contained in this patch of data. |
| intersectId | Optional intersectId to seed the tileData with for page-out priority. |
| virtual const unsigned int DtOsgEarthTerrainSourcePager::determineTrackerLod | ( | ) | [protected, virtual] |
Called by createTerrainSourceTracker.
Determines lod to use for terrrain source tracker, based on myMapNode.
| virtual DtNodeId DtOsgEarthTerrainSourcePager::osgNodeId | ( | osg::Node * | node | ) | [protected, virtual] |
| virtual osg::Node* DtOsgEarthTerrainSourcePager::nodeFromId | ( | DtNodeId | nodeId | ) | [protected, virtual] |
| virtual void DtOsgEarthTerrainSourcePager::createEmptyTile | ( | const osgEarth::TileKey & | tileKey, |
| const unsigned int | intersectId = 0 |
||
| ) | [protected, virtual] |
Used when a tile cannot be created by osgEarth's tileBuilder.
Creates a Terrain Tile with all heights at 0.
osgEarth::MapNode* DtOsgEarthTerrainSourcePager::myMapNode [protected] |
Map node which is used to generate heightfields.
osg::ref_ptr<osgTerrain::Terrain> DtOsgEarthTerrainSourcePager::myOsgTerrain [protected] |
Used when a heightfield cannot be created to.
Map of tileIds to terrainTiles.