![]() |
VR-Forces Developer's Guide
|
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a terrain certain post processing steps can be taken. For example, the static trees can be extracted and replaced by dynamically generated trees.

Classes | |
| struct | ExtractSpeedTreeOp |
Public Types | |
| enum | AlphaToCoverageState { USE_GLOBAL, FORCE_OFF, FORCE_ON } |
Public Member Functions | |
| DtOsgTerrainPatchObject (DtDe &de, DtUniqueID elementId) | |
| virtual | ~DtOsgTerrainPatchObject () |
| virtual void | setTerrainDefinition (const std::string &modelDefinitionName) |
| virtual void | slot_atcGlobalTerrainEnableChanged () |
| virtual void | slot_terrainInstancesReadyToRender (const DtPagedTilesIndirectManager &pagedTilesIndirectManager) |
| virtual void | enableOverlay (int type, const std::string &definition) |
| virtual void | disableOverlay (int type) |
| virtual void | disableAllOverlays () |
| virtual void | setOverlayScale (int type, double x, double y) |
| virtual void | setWrapMode (int type, int) |
| virtual void | setBlendMode (int type, int) |
| virtual void | setOverlayOffset (int type, double x, double y) |
| virtual void | setLayerEnabled (const std::string &rule, bool status) |
| virtual void | setRasterLayerPosition (int type, int pos) |
| virtual std::string | overlayDefinition (int type) |
| virtual std::vector< double > | overlayScale (int type) |
| virtual std::vector< double > | overlayOffset (int type) |
| virtual DtTerrainOverlayOperation | defaultOverlay (int type) |
| virtual DtTerrainOverlayOperation | currentOverlay (int type) |
| virtual void | getBoundingBoxMinMax (DtVector &min, DtVector &max) const |
| virtual void | getTerrainExtents (DtVector &nw, DtVector &ne, DtVector &sw, DtVector &se) const |
| virtual DtVector | getDatabaseOrigin () const |
| virtual void | getBoundingBoxCenter (float &x, float &y, float &z) const |
| osg::Group * | terrainGroupNode () |
| virtual void | extractNodes (const std::string &ruleset, bool isRegEx) override |
| virtual void | extractOceanNodes (const std::string &ruleset, bool isRegEx) override |
| virtual void | extractSpeedTreeNodes (const std::string &rule, bool isRegEx, const std::string &modelDefinition) override |
| virtual void | realizeExtractedSpeedTrees (const DtVectorTreeRecords &trees) |
| virtual bool | haveExtractedOcean () const |
| virtual bool | canExtractOceanInIndirect (void) const |
| virtual int | countNodes (const std::string &rule) const |
| virtual bool | getExtractedNodePosition (const std::string &rule, unsigned int index, double &x, double &y, double &z) const |
| virtual bool | getExtractedNodeOrientation (const std::string &rule, unsigned int index, double &x, double &y, double &z, double &w) const |
| virtual void | moveNode (DtSceneObject *object, DtModel *model, const std::string &rule, unsigned int index) |
| virtual osg::Node * | findNode (const std::string &rule, unsigned int index) |
| virtual bool | isGlobalScaleTerrain () const |
| virtual bool | getTerrainIntersection (double x, double y, double z, double vx, double vy, double vz, double &retX, double &retY, double &retZ) |
| virtual void | clearElevationCache () |
| bool | isOsgEarth () const |
| osgEarth::MapNode * | mapNode () |
| const osgEarth::MapNode * | mapNode () const |
| void | installOsgEarthFeatureDataCallback (const std::string &featureName, DtOsgEarthFeatureDataBroker::Callback *callback) |
| virtual const DtTextureVisitor::TextureMap & | foundTextures () const |
| virtual void | setOsgEarthMaterialValues (float ambient, float diffuse, float specular, float shininess) |
| virtual void | getOsgEarthMaterialValues (float &ambient, float &diffuse, float &specular, float &shininess) |
| DtMetaFileManager::LinkageValueVec & | terrainPatchMetaFileFeatures () |
| std::vector < DtVirtualBaseClass * > & | terrainAttachments () |
| virtual void | setTerrainTreeScaleRandomization (bool isRandomized) |
| virtual bool | isTerrainTreeScaleRandomizationEnabled () const |
| virtual void | setTerrainTreeMinScale (double minScale) |
| virtual double | terrainTreeMinScale () const |
| virtual void | setTerrainTreeMaxScale (double maxScale) |
| virtual double | terrainTreeMaxScale () const |
| virtual void | setTerrainTreeOrientationRandomization (bool isRandomized) |
| virtual bool | isTerrainTreeOrientationRandomizationEnabled () const |
| bool | isDestructing () |
| virtual void | useICO (bool enable) |
| virtual void | setMaxPagedLODs (unsigned int maxPagedLODs) |
| virtual void | updateMaxPagedLODs () |
| virtual void | slot_channelCreated () |
| virtual void | slot_windowCreated () |
| virtual void | slot_channelToBeDestroyed () |
| virtual bool | alphaToCoverageEnabled () |
| virtual void | postExtractionProcessing () |
| virtual bool | indirectEnabled () |
| virtual void | toggleVisibility (bool visibility) |
| virtual DtOsgEarthFeatureDataBroker * | getOsgEarthFeatureDataBroker () |
| virtual bool | isMetaFlight (void) const |
| virtual void | setIsMinimapOnly (bool isForMinimap) |
| virtual bool | isMinimapOnly () const |
| virtual void | setIsPageable (bool isPageable) |
| virtual bool | isPageable () const |
| virtual void | setPageableCenterPosition (const DtVector &pageableCenter) |
| virtual DtVector | pageableCenterPosition () const |
| virtual void | setPageableRadius (double radius) |
| virtual double | pageableRadius () const |
| virtual void | setPageOutDistance (double pageOutDistance) |
| virtual double | pageOutDistance () const |
Public Member Functions inherited from makVrv::DtTerrainPatchObject | |
| DtTerrainPatchObject (DtDe &de, DtUniqueID id) | |
| virtual | ~DtTerrainPatchObject () |
| const std::string & | terrainDefinitionName () const |
| virtual DtUniqueID | uniqueID () const |
Static Public Member Functions | |
| static void | authorizeBingImageryLayer (osgEarth::BingImageLayer *bingImageLayer, bool openLayer=true) |
Protected Types | |
| typedef osg::ref_ptr< osg::Node > | RefNode |
Protected Member Functions | |
| void | removeChildNodesAndCache () |
| void | clearStateGraphForAllChannels (void) |
| void | removeEmptyParent (osg::Node *node) |
| void | updateBounds () |
| virtual void | updatePageablePropertiesBasedOnNode (osg::Node *node) |
| virtual bool | getElevation (double lonRadians, double latRadians, double &retElevation) |
| virtual void | slot_perPixelLightingChanged (bool newVal) |
| virtual void | slot_usePixelShaderForOsgEarthModelsChanged () |
| virtual void | slot_postUpdate () |
| virtual void | setOsgEarthMaterial (float ambient, float diffuse, float specular, float shininess) |
| virtual void | setOsgEarthMaterialOnNode (osg::Node &node, float ambient, float diffuse, float specular, float shininess) |
| virtual void | setOsgEarthMaterialOnStateSet (osg::StateSet &ss, float ambient, float diffuse, float specular, float shininess) |
| virtual void | slot_terrainPaged () |
| osgEarth::Util::ElevationQuery * | getOrCreateElevationQuery () |
| void | installOsgEarthFeatureDataProcessors () |
| virtual void | configureOsgEarthFeatureGeometryCompiler () |
| virtual void | setupMapNodeIntersectFlag () |
| virtual void | setGlobalWindSpeed (float metersPerSecond) |
| virtual void | setGlobalWindDirection (float radians) |
| virtual void | setupMapNode (void) |
| virtual void | setupOsgEarthBlendingForHbao (osgEarth::Map *map) |
| virtual void | setupOsgEarthLayersForHeightmapRendering (osgEarth::Map *map) |
| virtual void | setupNonMapNode (osg::ref_ptr< osg::Node > node) |
| virtual void | slot_coordinateSystemChanged () |
| virtual void | extractNodesExecute (osg::Node *node, const std::string &ruleset, bool isRegEx) |
| virtual void | extractOceanNodesExecute (osg::Node *node, const std::string &ruleset, bool isRegEx) |
| virtual void | extractSpeedTreeNodesExecute (osg::Node *node, const std::string &rule, bool isRegEx, const std::string &modelDefinition) |
| virtual void | postExtractionProcessingExecute (void) |
| virtual void | parseDynamicTerrain (void) |
| virtual void | executeExtractionOperationsDeferred (osg::Node *node) |
| virtual void | setupOsgEarthTextureLimits () |
Static Protected Member Functions | |
| static void | graphBoundingBox (const osg::Node *node, osg::BoundingBox &bbox) |
Private Member Functions | |
| DtOsgTerrainPatchObject (const DtOsgTerrainPatchObject &) | |
| DtOsgTerrainPatchObject & | operator= (const DtOsgTerrainPatchObject &) |
Friends | |
| class | DtOsgNodesExtractor |
| class | DtPagedTilesIndirectManager |
Additional Inherited Members | |
Static Public Attributes inherited from makVrv::DtTerrainPatchObject | |
| static const double | TheEarthRadius |
|
protected |
| makVrv::DtOsgTerrainPatchObject::DtOsgTerrainPatchObject | ( | DtDe & | de, |
| DtUniqueID | elementId | ||
| ) |
CTOR.
|
virtual |
DTOR.
|
private |
Not implemented.
|
virtual |
Distributed methods:
The model definition will be loaded and post processing will occur.
Reimplemented from makVrv::DtTerrainPatchObject.
|
virtual |
slot to listen in on a2c settings changes
|
virtual |
slot to listen in on when instances in paged tiles indirect manager are ready to render (were rendered at least once)
|
virtual |
Enable specified overlay with specified definition.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Disable specified overlay.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Disable all overlays.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Set scale of specified overlay.
Implements makVrv::DtTerrainPatchObject.
Set wrap mode of specified overlay. Default is REPEAT.
Implements makVrv::DtTerrainPatchObject.
Set blend mode of specified overlay. Default is MODULATE.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Set offset of specified overlay.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Toggle layers on or off by rule regexp.
Implements makVrv::DtTerrainPatchObject.
Sets the position of the raster layer to draw.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Should this patch object be placed under the special minimap modelset?
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Should this patch object be placed under the special minimap modelset?
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Should this patch object be pageable or not? NOTE: Changing the pageable status of a terrain patch requires that the terrain patch is reloaded.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Should this patch object be pageable or not? NOTE: Changing the pageable status of a terrain patch requires that the terrain patch is reloaded.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The center position to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the center position is calculated based on the model for the terrain patch.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The center position to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the center position is calculated based on the model for the terrain patch.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The radius to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the center position is calculated based on the model for the terrain patch.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The radius to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the center position is calculated based on the model for the terrain patch.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The page out distance to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the page out distance is set to be three times the pageableRadius.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
The page out distance to use when setting up the Paged LOD for this terrain patch. This is only used if setIsPageable(true). If this is not defined when the pageable terrain patch is loaded, then the page out distance is set to be three times the pageableRadius.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Local functions.
Implements makVrv::DtTerrainPatchObject.
Non bound methods:
Implements makVrv::DtTerrainPatchObject.
Non bound methods:
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Non bound methods:
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Non bound methods:
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Returns the min/max bounding points of the terrain.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Return the corners of the terrain, useful for calculating draping parameters.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Return the origin of the database in database coordinates.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get the bounding box center of the terrain patch.
| osg::Group* makVrv::DtOsgTerrainPatchObject::terrainGroupNode | ( | ) |
|
overridevirtual |
Move nodes via a ruleset.
Implements makVrv::DtTerrainPatchObject.
|
overridevirtual |
Extract ocean nodes to the static ocean root.
Implements makVrv::DtTerrainPatchObject.
|
overridevirtual |
Extract osg nodes from the terrain patch and replace them as speed trees.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Send Tree Records to the speed tree manager.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Does this patch have extracted ocean nodes?
|
virtual |
|
virtual |
Count nodes via a rule. This checks the current terrain contents without modifying it.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get the extracted node position.
| false | if the node is not found. |
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get the extracted node orientation.
| false | if the node is not found. |
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Moves a node to the model and sets the location of an object by its location.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get a particular node found with a rule & it's index.
|
virtual |
Get if the terrain patch is a global scale.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get a terrain intersection.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
If the patch object is using an elevation cache, clear it (otherwise do nothing). Use after making a large number of successive calls, such as while extracting props from a shape file.
Implements makVrv::DtTerrainPatchObject.
| bool makVrv::DtOsgTerrainPatchObject::isOsgEarth | ( | ) | const |
Returns whether the terrain 'patch' is really osg earth streamed terrain.
| osgEarth::MapNode* makVrv::DtOsgTerrainPatchObject::mapNode | ( | ) |
Returns the underlying osgEarth Map Node if any.
| const osgEarth::MapNode* makVrv::DtOsgTerrainPatchObject::mapNode | ( | ) | const |
| void makVrv::DtOsgTerrainPatchObject::installOsgEarthFeatureDataCallback | ( | const std::string & | featureName, |
| DtOsgEarthFeatureDataBroker::Callback * | callback | ||
| ) |
|
virtual |
Returns the list of (unique) found textures.
|
virtual |
|
virtual |
| DtMetaFileManager::LinkageValueVec& makVrv::DtOsgTerrainPatchObject::terrainPatchMetaFileFeatures | ( | ) |
Return the list of node names/annotations and corresponding JSON info.
| std::vector<DtVirtualBaseClass*>& makVrv::DtOsgTerrainPatchObject::terrainAttachments | ( | ) |
Get the list of tickables for this model (created by .meta files)
|
virtual |
Should speed tree scale be randomized on the terrain.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Is speed tree random scale enabled.
|
virtual |
Set the minimum scale for randomization of scale.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get the minimum scale for randomization of scale.
|
virtual |
Set the maximum scale for randomization of scale.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Get the maximum scale for randomization of scale.
|
virtual |
Should speed trees be randomly oriented.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
Is speed tree random orientation enabled.
| bool makVrv::DtOsgTerrainPatchObject::isDestructing | ( | ) |
Is the DtOsgTerrainPatchObject in the destructor.
|
virtual |
Enable/Disable Incremental Compile Option. This calls into the windowmanager which controls ICO.
Implements makVrv::DtTerrainPatchObject.
Set the target max number of paged lods for this terrain (patch)
Implements makVrv::DtTerrainPatchObject.
|
virtual |
send the current max paged lods down to the channel manager
|
virtual |
handle the signal for channel created so that the terrain can send the max paged lods down to the channel manager
|
virtual |
handle the signal for window is created so that the terrain can send the max paged lods down to the channel manager
|
virtual |
handle the signal for channel to be destroyed so that the terrain can send the max paged lods down to the channel manager
|
virtual |
Gets whether or not alpha to coverage is enabled for this terrain patch.
|
virtual |
called by the terrain patch after the extraction operations used to indirect a non paging terrain patch.
Implements makVrv::DtTerrainPatchObject.
|
virtual |
get whether or not indirect is enabled for this terrain patch. Based on setting at load.
|
virtual |
Toggle the visibility of this terrain patch object.
| visibility | Whether show the terrain patch or not. |
Implements makVrv::DtTerrainPatchObject.
|
static |
Authorize a Bing Imagery Layer using a MAK provided key.
| bingImageLayer | The bing imagery layer to authorize. |
|
virtual |
get the feature data broker for this terrain patch
|
virtual |
is mft?
|
private |
|
protected |
Unload the terrain.
|
protected |
clear osg's internal state graph
|
staticprotected |
|
protected |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
get an osg earth elevation
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Returns the patch's elevation query object, creating it on.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
utility function for setting up the osgEarth terrain skin only intersection flag on the terrain engine.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
set up map node, if the definition contains a map node
|
protectedvirtual |
custom blend for hbao
|
protectedvirtual |
modify layer flags for visiblity in heightmap rendering
|
protectedvirtual |
set up map node, if the definition does not contain a map node
|
protectedvirtual |
slot for when the coordinate system changes
|
protectedvirtual |
actual execution
|
protectedvirtual |
actual execution
|
protectedvirtual |
actual execution
|
protectedvirtual |
actual execution
|
protectedvirtual |
internal
|
protectedvirtual |
For paged osgs only. Called via DtPagedTilesIndirectManager from a background thread It is likely possible to do this via ordering the various signals for loaded/paged in properly.
|
protectedvirtual |
called once when terrain is loaded called also when limits change
|
friend |
|
friend |
|
protected |
The OSG Hierarchy starts with myRoot and has one child: myTerrainGroup.
|
protected |
The myTerrainGroup node holds all the terrain polygons except for reforested trees.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Object used to sample the elevation model at various resolutions.
|
protected |
notifies subscribers of feature data loading via an osgEarth layer.
|
protected |
Tree randomization settings.
|
protected |
|
protected |
|
protected |
|
protected |
keeps track of when the object is in the destructor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
connection to listen in on when instances were added to the terrain skin only for non-metaflight
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
local clone of the system wide coordinate system. for thread safety.
|
protected |
|
protected |
|
protected |
used to defer extraction of nodes (only for paged osgs)
|
protected |
|
protected |
used to defer extraction of ocean (only for paged osgs)