VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
DtVantageTerrainImplementation Class Reference

This terrain implementation is an algorithmic representation of the world as a bald ellipsoid defined by WGS84. More...

Inheritance diagram for DtVantageTerrainImplementation:
Inheritance graph
[legend]

Public Member Functions

 DtVantageTerrainImplementation (DtConsoleCommandManager *cmdMgr)
virtual ~DtVantageTerrainImplementation ()
virtual bool loadTerrain (const makArchives::DtGenericTerrainRecord &record, MAKVRinTerra::DtFeatureLoader &, const TerrainSettings &settings=TerrainSettings())
 Will set the UserDataDirectory and DataDirectory into the De's path configuration.
virtual const Coordinate_SystemcoordinateSystem () const
virtual bool chordIntersect (const DtChord &chord, DtChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Returns topmost intersection of chord with terrain in record.
virtual bool allIntersectsAlongChord (const DtChord &chord, DtChordIntersectRecordList &intList, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Returns all intersections of chord with terrain.
virtual bool sphereIntersect (const DtSphere &sphere, DtSphereIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Returns intersection of a sphere with the terrain.
virtual void preloadTerrainAreas (const DtTerrainPagingGeometryList &preloadGeometry)
 Specifies a list of terrain areas that should be preloaded by the terrain implementation, in the case of a paging or streaming terrain source.
virtual const
DtTerrainCapabilities
terrainCapabilities () const
virtual void loadData (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry, bool *dataAvailable, bool overrideBlockingAssert=false) const
 Verifies that all data is loaded along the specified chord.
virtual const unsigned int lastIntersectId () const
virtual void loadConfigurationFile (const DtFilename &filename)
virtual const
DtTerrainConfigurationOptions
configurationOptions () const
virtual DtPagingMetaDataPtr createMetaData (bool *dataAvailable, int intersectId) const
virtual void setIntersectDataLoadExpireTime (const double &expireTime)
 No-op.
virtual void expireDataLoadRequestsBeforeTime (const double &currentTime)
 No-op.
virtual void processTrianglesInArea (DtTriangleCallbackFcn func, DtTriangleCallbackFinalizeFcn finalize, DtTerrainProcessPolygonsBox &box, void *usr) const
void forceTerrainPagingInBox (DtTerrainProcessPolygonsBox &box) const
virtual void breakUpChords (const MAKVRinTerra::DtProj &, const DtChord &chord, std::vector< DtChord > &chords)
- Public Member Functions inherited from DtTerrainImplementation
 DtTerrainImplementation (DtConsoleCommandManager *cmdManager)
virtual ~DtTerrainImplementation ()
virtual void setAssertOnBlockingTerrainCalls (bool assertBlock)
 Determines if an exception should be thrown if a blocking terrain call is made.
virtual bool assertOnBlockingTerrainCalls () const
 Determines if an exception should be thrown if a blocking terrain call is made.

Static Public Member Functions

static DtTerrainImplementationcreate (DtConsoleCommandManager *cmdMgr)
static
DtVantageTerrainImplementationCreator
creator ()

Protected Attributes

Coordinate_SystemmyCoordinateSystem
DtSharedMemoryBulletDebugDrawermyBulletDebugDrawer
unsigned int myLastIntersectId
DtActivePageTrackermyActivePageTracker
DtCollisionWorldmyCollisionWorld
DtVantageTerrainEnginemyVantageTerrainEngine
DtConsoleCommandOwnermyCommandOwner
DtTerrainCapabilities myCapabilities
DtTerrainConfigurationOptionsmyTerrainOptions
DtFilename myTerrainOptionsFilename
DtPreloadCommandManagermyPreloadCommandManager
double myIntersectDataLoadExpireTime
bool myThreadShutdown
tbb::tbb_thread * myPreloadCommandThread
tbb::mutex myShutdownMutex
- Protected Attributes inherited from DtTerrainImplementation
bool myAssertOnBlockingTerrainCalls
 Determines if an exception should be thrown if a blocking terrain call is made.
TerrainSettings mySettings
 Settings used for this implementation.

Additional Inherited Members

- Public Types inherited from DtTerrainImplementation
typedef std::map< std::string,
std::string > 
TerrainSettings

Detailed Description

This terrain implementation is an algorithmic representation of the world as a bald ellipsoid defined by WGS84.

All soil types are returned as the undefined soil type.

Constructor & Destructor Documentation

DtVantageTerrainImplementation::DtVantageTerrainImplementation ( DtConsoleCommandManager cmdMgr)
virtual DtVantageTerrainImplementation::~DtVantageTerrainImplementation ( )
virtual

Member Function Documentation

virtual bool DtVantageTerrainImplementation::loadTerrain ( const makArchives::DtGenericTerrainRecord record,
MAKVRinTerra::DtFeatureLoader ,
const TerrainSettings settings = TerrainSettings() 
)
virtual

Will set the UserDataDirectory and DataDirectory into the De's path configuration.

Implements DtTerrainImplementation.

virtual const Coordinate_System* DtVantageTerrainImplementation::coordinateSystem ( ) const
virtual
virtual bool DtVantageTerrainImplementation::chordIntersect ( const DtChord chord,
DtChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Returns topmost intersection of chord with terrain in record.

Parameters
Input
chordthe chord to test
irtFlagspecifies what intersection data should be filled in for the record.
Output
recordthe results of the intersection
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If this parameter is specified and the required terrain data is not yet paged in, this call will return immediately and dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.

Implements DtTerrainImplementation.

virtual bool DtVantageTerrainImplementation::allIntersectsAlongChord ( const DtChord chord,
DtChordIntersectRecordList intList,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Returns all intersections of chord with terrain.

Parameters
Input
chordthe chord to test
irtFlagspecifies what intersection data should be filled in for the record.
Output
intListthe results of the intersection
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If this parameter is specified and the required terrain data is not yet paged in, this call will return immediately and dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.

Implements DtTerrainImplementation.

virtual bool DtVantageTerrainImplementation::sphereIntersect ( const DtSphere sphere,
DtSphereIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Returns intersection of a sphere with the terrain.

Parameters
Input
spherethe sphere to test
irtFlagspecifies what intersection data should be filled in for the record.
Output
recordthe results of the intersection
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If this parameter is specified and the required terrain data is not yet paged in, this call will return immediately and dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.

Implements DtTerrainImplementation.

virtual void DtVantageTerrainImplementation::preloadTerrainAreas ( const DtTerrainPagingGeometryList preloadGeometry)
virtual

Specifies a list of terrain areas that should be preloaded by the terrain implementation, in the case of a paging or streaming terrain source.

The typical use of this is to specify parts of the terrain that are expected to be needed in the near future.

The terrain may not be loaded immediately upon making this call, and there is no guarantee that the terrain areas will be available for intersection immediately after making this call.

Parameters
preloadGeometryA list of the geometric areas that should be preloaded. They can be specified using any of the subclasses of DtTerrainPagingGeometry.
Note
The geometry set with this call completely replaces any geometry previously set using this call.
The default implementation for this is a noop.

Reimplemented from DtTerrainImplementation.

virtual const DtTerrainCapabilities* DtVantageTerrainImplementation::terrainCapabilities ( ) const
virtual
Returns
A DtTerrainCapabilites structure that describes the capabilities of the currently loaded terrain.

Implements DtTerrainImplementation.

static DtTerrainImplementation* DtVantageTerrainImplementation::create ( DtConsoleCommandManager cmdMgr)
static
virtual void DtVantageTerrainImplementation::loadData ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry,
bool dataAvailable,
bool  overrideBlockingAssert = false 
) const
virtual

Verifies that all data is loaded along the specified chord.

If not, and dataAvailable is NULL, this function will block while the data is loaded. If dataAvailable non-NULL, then it is set to false, and the function returns. A command to load the data is passed to the terrain engine thread.

virtual const unsigned int DtVantageTerrainImplementation::lastIntersectId ( ) const
inlinevirtual
virtual void DtVantageTerrainImplementation::loadConfigurationFile ( const DtFilename &  filename)
virtual
virtual const DtTerrainConfigurationOptions* DtVantageTerrainImplementation::configurationOptions ( ) const
virtual
virtual DtPagingMetaDataPtr DtVantageTerrainImplementation::createMetaData ( bool dataAvailable,
int  intersectId 
) const
virtual
virtual void DtVantageTerrainImplementation::setIntersectDataLoadExpireTime ( const double &  expireTime)
virtual

No-op.

Override to set the default expiration time for data load requests generated by intersect calls that require data that has not yet been loaded (paged-in).

Parameters
expireTimeThe expiration time to be assigned to load data requests generated by intersect calls on the terrain implementation.

Reimplemented from DtTerrainImplementation.

virtual void DtVantageTerrainImplementation::expireDataLoadRequestsBeforeTime ( const double &  currentTime)
virtual

No-op.

Override to expire data load requests generated before the given time. See comment for #setIntersectLoadDataExpireTime.

Parameters
currentTimeThe time to compare to data load requests to determine if they should be expired rather than executed.

Reimplemented from DtTerrainImplementation.

virtual void DtVantageTerrainImplementation::processTrianglesInArea ( DtTriangleCallbackFcn  func,
DtTriangleCallbackFinalizeFcn  finalize,
DtTerrainProcessPolygonsBox box,
void *  usr 
) const
virtual

Reimplemented from DtTerrainImplementation.

static DtVantageTerrainImplementationCreator* DtVantageTerrainImplementation::creator ( )
static
void DtVantageTerrainImplementation::forceTerrainPagingInBox ( DtTerrainProcessPolygonsBox box) const
virtual void DtVantageTerrainImplementation::breakUpChords ( const MAKVRinTerra::DtProj ,
const DtChord chord,
std::vector< DtChord > &  chords 
)
virtual

Reimplemented from DtTerrainImplementation.

Member Data Documentation

Coordinate_System* DtVantageTerrainImplementation::myCoordinateSystem
protected
DtSharedMemoryBulletDebugDrawer* DtVantageTerrainImplementation::myBulletDebugDrawer
protected
unsigned int DtVantageTerrainImplementation::myLastIntersectId
mutableprotected
DtActivePageTracker* DtVantageTerrainImplementation::myActivePageTracker
protected
DtCollisionWorld* DtVantageTerrainImplementation::myCollisionWorld
protected
DtVantageTerrainEngine* DtVantageTerrainImplementation::myVantageTerrainEngine
protected
DtConsoleCommandOwner* DtVantageTerrainImplementation::myCommandOwner
protected
DtTerrainCapabilities DtVantageTerrainImplementation::myCapabilities
protected
DtTerrainConfigurationOptions* DtVantageTerrainImplementation::myTerrainOptions
protected
DtFilename DtVantageTerrainImplementation::myTerrainOptionsFilename
protected
DtPreloadCommandManager* DtVantageTerrainImplementation::myPreloadCommandManager
protected
double DtVantageTerrainImplementation::myIntersectDataLoadExpireTime
protected
bool DtVantageTerrainImplementation::myThreadShutdown
protected
tbb::tbb_thread* DtVantageTerrainImplementation::myPreloadCommandThread
protected
tbb::mutex DtVantageTerrainImplementation::myShutdownMutex
mutableprotected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)