DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source.
More...
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.
|
Detailed Description
DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source.
Constructor & Destructor Documentation
| DtOsgEarthTerrainSourcePager::DtOsgEarthTerrainSourcePager |
( |
DtVantageTerrainEngine * |
terrainEngine, |
|
|
osgEarth::MapNode * |
mapNode |
|
) |
| |
| virtual DtOsgEarthTerrainSourcePager::~DtOsgEarthTerrainSourcePager |
( |
| ) |
|
|
virtual |
Member Function Documentation
| virtual bool DtOsgEarthTerrainSourcePager::pageInTiles |
( |
DtTileKeyList & |
tileIds, |
|
|
const unsigned int |
intersectId = 0 |
|
) |
| |
|
virtual |
Iterates over tileIds and calls pageInTile on each one.
- Parameters
-
| 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. |
- Returns
- True if all tiles are paged in.
| 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.
- Parameters
-
| tilesToRemove | List of tileIds to page out. |
- Returns
- True if all tiles are removed successfully.
| virtual void DtOsgEarthTerrainSourcePager::updatePageTracker |
( |
const unsigned int |
intersectId = 0 | ) |
|
|
virtual |
| virtual bool DtOsgEarthTerrainSourcePager::addCollisionObject |
( |
osg::ref_ptr< osg::Node > |
node, |
|
|
unsigned int & |
numTrianglesOut |
|
) |
| |
|
protectedvirtual |
Creates a collision object from the given terrain tile and adds it to the collision world.
- Parameters
-
| 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. |
- Returns
- True if the collision object was created successfully and added to the collision world.
| virtual bool DtOsgEarthTerrainSourcePager::pageInTile |
( |
const osgEarth::TileKey & |
tileKey, |
|
|
const unsigned int |
intersectId = 0 |
|
) |
| |
|
protectedvirtual |
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.
- Parameters
-
| tileIds | The tileKey to create heightfield for. |
| intersectId | Optional parameter to create the tiles with a starting "lastUsed" value of intersectId. |
- Returns
- True if the heightfield is created, the collision object is created and added to the collision world, and the tracking info is added to the terrainSourceTracker.
| virtual bool DtOsgEarthTerrainSourcePager::pageOutTile |
( |
const osgEarth::TileKey & |
tileKey | ) |
|
|
protectedvirtual |
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.
- Returns
- True if all data is successfully removed.
| virtual DtTileData* DtOsgEarthTerrainSourcePager::createTileData |
( |
const osgEarth::TileKey & |
tileKey, |
|
|
const unsigned int & |
numTriangles, |
|
|
const unsigned int |
intersectId = 0 |
|
) |
| const |
|
protectedvirtual |
Sets up and returns a new DtTileData object.
- Parameters
-
| 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. |
- Returns
- Newly created DtTileData.
| virtual const unsigned int DtOsgEarthTerrainSourcePager::determineTrackerLod |
( |
| ) |
|
|
protectedvirtual |
Called by createTerrainSourceTracker.
Determines lod to use for terrrain source tracker, based on myMapNode.
| virtual DtNodeId DtOsgEarthTerrainSourcePager::osgNodeId |
( |
osg::Node * |
node | ) |
|
|
protectedvirtual |
| virtual osg::Node* DtOsgEarthTerrainSourcePager::nodeFromId |
( |
DtNodeId |
nodeId | ) |
|
|
protectedvirtual |
| virtual void DtOsgEarthTerrainSourcePager::createEmptyTile |
( |
const osgEarth::TileKey & |
tileKey, |
|
|
const unsigned int |
intersectId = 0 |
|
) |
| |
|
protectedvirtual |
Used when a tile cannot be created by osgEarth's tileBuilder.
Creates a Terrain Tile with all heights at 0.
Member Data Documentation
| 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.
The documentation for this class was generated from the following file: