VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes
DtOsgEarthTerrainSourcePager Class Reference

DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source. More...

Inheritance diagram for DtOsgEarthTerrainSourcePager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtOsgEarthTerrainSourcePager (DtVantageTerrainEngine *terrainEngine, osgEarth::MapNode *mapNode)
virtual ~DtOsgEarthTerrainSourcePager ()
virtual DtTerrainSourceTrackercreateTerrainSourceTracker ()
 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 DtTileDatacreateTileData (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.

Detailed Description

DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source.


Constructor & Destructor Documentation

DtOsgEarthTerrainSourcePager::DtOsgEarthTerrainSourcePager ( DtVantageTerrainEngine terrainEngine,
osgEarth::MapNode *  mapNode 
)

Member Function Documentation

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.

Parameters:
tileIdsList of tileIds to page in. When a tile is successfuly paged in, it is removed from this list.
intersectIdOptional 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:
tilesToRemoveList 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 
) [protected, virtual]

Creates a collision object from the given terrain tile and adds it to the collision world.

Parameters:
terrainTileThe terrain tile to create a collision object for.
numTrianglesOutThe 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 
) [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.

Parameters:
tileIdsThe tileKey to create heightfield for.
intersectIdOptional 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) [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.

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 [protected, virtual]

Sets up and returns a new DtTileData object.

Parameters:
tileKeyThe tile key of the terrain to create tile data for.
heightFieldThe heightfield, used to get the corner heights.
numTrianglesThe number of triangles contained in this patch of data.
intersectIdOptional intersectId to seed the tileData with for page-out priority.
Returns:
Newly created DtTileData.
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.


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:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)