VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtHeightMapManager Class Reference

A class to manage automatic periodic updating of a height map generated from the database dynamically.

Inheritance diagram for makVrv::DtHeightMapManager:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtHeightMapManager ()
 
virtual void setupHeightMap (void)
 
virtual float heightMapResolution () const
 
virtual void updateHeightCamera (unsigned int frameNum, const osg::Vec3d &currentPosition, osg::State &state)
 
virtual void enableHeightMapCamera (bool enable)
 
virtual bool heightCameraEnabled () const
 
virtual const osg::Matrix & heightMapMatrix () const
 
virtual const osg::ref_ptr
< osg::Texture2D > 
heightMapTexture () const
 
virtual osg::Camera * heightCamera ()
 
virtual void postDrawFBOCallback (osg::RenderInfo &renderInfo)
 
virtual bool heightMapChanged (void) const
 
virtual const osg::View * osgView () const
 
virtual void notifyOfReleasedObjects ()
 
- Public Member Functions inherited from makVrv::DtKeyedDataUserData
 DtKeyedDataUserData (DtDe &de, const std::string &name)
 
virtual ~DtKeyedDataUserData ()
 

Protected Member Functions

 DtHeightMapManager (DtDe &de, const std::string &name, osg::View *&view)
 
virtual void clearHeightmap ()
 
virtual void updateHeightMapMatrix ()
 
virtual osg::Matrixd oglRevDepthOrtho (double left, double right, double bottom, double top, double zNear, double zFar)
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 
virtual void computeHeightCameraTransform (double cameraHeight, const osg::Vec3d &axisX, const osg::Vec3d &axisZ)
 
virtual void computeCameraHeightAndEarthRadii (const osg::Vec3d &updatePosition, double &outCameraHeight, osg::Vec3d &outEarthRadii, double &outErrorAdjustment) const
 
virtual void updateShaderUniforms (const osg::Vec3d &earthRadii, const double errorAdjustment)
 
virtual void slot_oceanHeightMapTextureSizeChanged (int pixels)
 
virtual void slot_oceanHeightMapResolutionChanged (float resolution)
 
virtual void slot_terrainDataChanged (DtTerrainPatchObject &tpo)
 
virtual void slot_wireframeModeChanged ()
 
virtual void slot_coordinateSystemChanged ()
 
virtual int heightMapTextureSize () const
 
virtual void slot_preTick ()
 
virtual void validateHeightMapTexture (unsigned int osgContextID)
 

Protected Attributes

friend DtHeightMapManagerCreator
 
osg::Vec3d myLastHeightReferencePos
 
osg::Matrixd myHeightReferenceBasis
 
osg::Vec3d myLastHeightUpdatePos
 
unsigned int myHeightUpdateFrame
 
bool myForceUpdate
 
float myResolution
 
bool mySavedPerfOverlayOn
 
double myLastUpdateTime
 
const bool myShadingRateIsSupported
 
osg::ref_ptr< osg::Texture2D > myHeightMap
 
osg::ref_ptr< osg::Texture2D > myDepthTexture
 
osg::Matrix myHeightMapMatrix
 
int myHeightMapDimension
 
osg::ref_ptr< osg::Camera > myHeightCamera
 
DtSignalConnectionManager myConnections
 
osg::View * myOsgView
 
DtCoordinateSystemmyCoordinateSystem = nullptr
 
bool myHeightMapChanged = false
 
const unsigned int myHeightCameraNodeMask
 
bool myValidateHeightMapTexture
 
- Protected Attributes inherited from makVrv::DtKeyedDataUserData
DtDemyDe
 
const std::string myName
 

Private Member Functions

 DtHeightMapManager ()=delete
 
 DtHeightMapManager (const DtHeightMapManager &other)=delete
 
DtHeightMapManageroperator= (const DtHeightMapManager &other)=delete
 

Additional Inherited Members

- Static Protected Attributes inherited from makVrv::DtKeyedDataUserData
static std::atomic< inttheCount
 

Constructor & Destructor Documentation

virtual makVrv::DtHeightMapManager::~DtHeightMapManager ( )
virtual

destructor

makVrv::DtHeightMapManager::DtHeightMapManager ( DtDe de,
const std::string &  name,
osg::View *&  view 
)
protected

constructor

makVrv::DtHeightMapManager::DtHeightMapManager ( )
privatedelete

Default Constructor not implemented.

makVrv::DtHeightMapManager::DtHeightMapManager ( const DtHeightMapManager other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtHeightMapManager& makVrv::DtHeightMapManager::operator= ( const DtHeightMapManager other)
privatedelete

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtHeightMapManager::setupHeightMap ( void  )
virtual

Sets up the height map's resources.

virtual float makVrv::DtHeightMapManager::heightMapResolution ( ) const
virtual

Gets the meters represented by one texel of the height map.

virtual void makVrv::DtHeightMapManager::updateHeightCamera ( unsigned int  frameNum,
const osg::Vec3d &  currentPosition,
osg::State &  state 
)
virtual

Updates the height map as needed; call once per frame. Returns true if there is a new height map ready.

virtual void makVrv::DtHeightMapManager::enableHeightMapCamera ( bool  enable)
virtual

enable/disable height map camera

virtual bool makVrv::DtHeightMapManager::heightCameraEnabled ( ) const
virtual

Returns the height camera attatched state.

virtual const osg::Matrix& makVrv::DtHeightMapManager::heightMapMatrix ( ) const
virtual

Retrieve the matrix to transform world coordinate to texture coords.

virtual const osg::ref_ptr<osg::Texture2D> makVrv::DtHeightMapManager::heightMapTexture ( ) const
virtual

Retrieve the height map itself.

virtual osg::Camera* makVrv::DtHeightMapManager::heightCamera ( )
virtual

get the height camera being used by this height map manager

virtual void makVrv::DtHeightMapManager::postDrawFBOCallback ( osg::RenderInfo &  renderInfo)
virtual

Called from DtHeightMapPostDrawFBOCallback for post draw.

virtual bool makVrv::DtHeightMapManager::heightMapChanged ( void  ) const
virtual

Returns whether the height map changed this tick.

virtual const osg::View* makVrv::DtHeightMapManager::osgView ( ) const
virtual

view for the camera

virtual void makVrv::DtHeightMapManager::notifyOfReleasedObjects ( )
virtual

Called from DtHeightMapSuperManager when a channel has been destroyed and so objects have been released. This will internally flag the FBO as needing to re-initialize GL texture objects due to texture sharing.

virtual void makVrv::DtHeightMapManager::clearHeightmap ( )
protectedvirtual

clean up this manager, called via destructor and slot_oceanHeightMapTextureSizeChanged

virtual void makVrv::DtHeightMapManager::updateHeightMapMatrix ( )
protectedvirtual

Helper function for updating the height map matrix.

virtual osg::Matrixd makVrv::DtHeightMapManager::oglRevDepthOrtho ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
protectedvirtual

get the reverse depth buffer setup for an orthographic camera. used when reverse z is turned on.

virtual void makVrv::DtHeightMapManager::computeBasis ( const osg::Vec3d &  inGeocentricPos,
osg::Matrixd &  rotOut 
)
protectedvirtual

Computes a round earth basis rotation matrix for the given geocentric position.

Parameters
inGeocentricPosThe geocentric reference position.
rotOutThe computed basis rotation transform.
virtual void makVrv::DtHeightMapManager::computeHeightCameraTransform ( double  cameraHeight,
const osg::Vec3d &  axisX,
const osg::Vec3d &  axisZ 
)
protectedvirtual

Computes the height camera view and projection matrices based on the given camera height and the current heightmap settings.

Parameters
cameraHeightThe height of the camera above mean sea level.
axisXThe X axis of the topo plane.
axisZThe Z axis of the topo plane.
virtual void makVrv::DtHeightMapManager::computeCameraHeightAndEarthRadii ( const osg::Vec3d &  updatePosition,
double outCameraHeight,
osg::Vec3d &  outEarthRadii,
double outErrorAdjustment 
) const
protectedvirtual

Computes the camera height and earth radii based on the current coordinate system and given update position.

Parameters
updatePositionThe position to compute the camera height and earth radii for.
outCameraHeightThe computed camera height above mean sea level.
outEarthRadiiThe computed earth radii at the given position.
outErrorAdjustmentThe computed topo vs round earth error adjustment value for the given position.
virtual void makVrv::DtHeightMapManager::updateShaderUniforms ( const osg::Vec3d &  earthRadii,
const double  errorAdjustment 
)
protectedvirtual

Updates the shader uniforms for the height map camera.

Parameters
earthRadiiThe earth radii at the current heightmap camera position.
errorAdjustmentThe topo vs round earth error adjustment value for the current position.
virtual void makVrv::DtHeightMapManager::slot_oceanHeightMapTextureSizeChanged ( int  pixels)
protectedvirtual

Set the texture size length and width. The pixel value will be.

virtual void makVrv::DtHeightMapManager::slot_oceanHeightMapResolutionChanged ( float  resolution)
protectedvirtual

slot for when ocean height map resolution changes

virtual void makVrv::DtHeightMapManager::slot_terrainDataChanged ( DtTerrainPatchObject tpo)
protectedvirtual

Handles the terrain data changed signal.

virtual void makVrv::DtHeightMapManager::slot_wireframeModeChanged ( )
protectedvirtual

Handles the wireframe mode changed signal.

virtual void makVrv::DtHeightMapManager::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

virtual int makVrv::DtHeightMapManager::heightMapTextureSize ( ) const
protectedvirtual

Get the texture size length and width.

virtual void makVrv::DtHeightMapManager::slot_preTick ( )
protectedvirtual

clears the height map changed status

virtual void makVrv::DtHeightMapManager::validateHeightMapTexture ( unsigned int  osgContextID)
protectedvirtual

Checks to see if the height map texture object is not valid. If it's not,.

Member Data Documentation

friend makVrv::DtHeightMapManager::DtHeightMapManagerCreator
protected
osg::Vec3d makVrv::DtHeightMapManager::myLastHeightReferencePos
protected
osg::Matrixd makVrv::DtHeightMapManager::myHeightReferenceBasis
protected
osg::Vec3d makVrv::DtHeightMapManager::myLastHeightUpdatePos
protected
unsigned int makVrv::DtHeightMapManager::myHeightUpdateFrame
protected
bool makVrv::DtHeightMapManager::myForceUpdate
protected
float makVrv::DtHeightMapManager::myResolution
protected
bool makVrv::DtHeightMapManager::mySavedPerfOverlayOn
protected
double makVrv::DtHeightMapManager::myLastUpdateTime
protected
const bool makVrv::DtHeightMapManager::myShadingRateIsSupported
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtHeightMapManager::myHeightMap
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtHeightMapManager::myDepthTexture
protected
osg::Matrix makVrv::DtHeightMapManager::myHeightMapMatrix
protected
int makVrv::DtHeightMapManager::myHeightMapDimension
protected
osg::ref_ptr<osg::Camera> makVrv::DtHeightMapManager::myHeightCamera
protected
DtSignalConnectionManager makVrv::DtHeightMapManager::myConnections
protected
osg::View* makVrv::DtHeightMapManager::myOsgView
protected
DtCoordinateSystem* makVrv::DtHeightMapManager::myCoordinateSystem = nullptr
protected

local clone of the system wide coordinate system. for thread safety.

bool makVrv::DtHeightMapManager::myHeightMapChanged = false
protected
const unsigned int makVrv::DtHeightMapManager::myHeightCameraNodeMask
protected
bool makVrv::DtHeightMapManager::myValidateHeightMapTexture
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)