VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
makVrv::DtTritonDrawable Class Reference

An OSG Drawable representing Triton's infinite ocean. More...

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

Public Types

enum  TritonQuality { TritonQuality_Good, TritonQuality_Better, TritonQuality_Best }

Public Member Functions

 DtTritonDrawable (makVrv::DtDe &de, const DtTritonManager &tritonManager, DtEnvironmentInfo &environmentInfo, bool geocentric, osg::TextureCubeMap *cubeMap=NULL)
 CTOR.
virtual bool isSameKindAs (const Object *obj) const
virtual Object * cloneType () const
virtual Object * clone (const osg::CopyOp &copyop) const
virtual Triton::Ocean * ocean ()
 Return the underlying Triton::Ocean object.
virtual Triton::Environment * environment ()
 Return the underlying Triton::Environment object.
virtual void setBeach (osg::Vec3 beachOrigin, osg::Vec3 normal)
 Pass info to Triton about the local ocean depth and floor slope.
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 Perform drawing of the Ocean from the render thread.
virtual void setPlanarReflections (bool enabled)
 Toggle use of planar reflections of local objects.
virtual bool planarReflections () const
virtual void setBreakingWaveAmplitude (float meters)
 Set height of breaking waves at shorelines. Set to 0 to disable.
virtual float getBreakingWaveAmplitude () const
virtual void setHeightMap (bool enabled)
 Toggle use of automatically generated height maps for coastal effects Only enable if you have bathymetry and no sea-level ocean polygons in the database!
virtual bool heightMap () const
virtual void setQuality (TritonQuality quality)
 Set quality of wave simulation - "good" yields best performance but least detail, "best" favors quality over performance.
virtual TritonQuality getQuality () const
virtual void setBreakingWavesMap (bool enabled)
 Toggle use of shapefile-based breaking wave areas and directions If off, breaking waves will be everywhere and direction determined from bathymetry.
virtual bool breakingWavesMap () const
virtual void setWaveDampingDistance (float meters)
 Sets distance at which waves go away to fight aliasing.
virtual float waveDampingDistance () const
virtual void setMaxReflectionWindSpeed (double metersPerSecond)
 Set the wind speed at which we blend out planar reflections (default 20 m/s)
virtual void setUnderwaterFogColor (const osg::Vec4 &color)
 Set the base (unlit) fog color when underwater.
virtual const osg::Vec4 & getUnderwaterFogColor () const
virtual void setUnderwaterVisibility (double visibility)
 Set the visibility when underwater.
virtual double getUnderwaterVisibility () const
virtual void setWaterVisibility (double visibility)
 The visibility of the water when viewed from above (affects the transparency)
virtual double getWaterVisibility () const
virtual void setSurgeDepth (float depth)
 The depth at which we start dampening wave displacement.
virtual float getSurgeDepth () const
virtual bool getIsInitialized () const
 Whether Triton has been fully initialized (after its first frame.)
void setAllowUnderwaterEffects (bool allow)
 Whether underwater fog etc.
bool getAllowUnderwaterEffects () const
 Whether underwater fog is enabled.
virtual void setHeightMapResolution (float metersPerTexel)
 Get/set the resolution of the height map for shallow water effects (meters per texel)
virtual float getHeightMapResolution () const
virtual void setBreakingWavesMapResolution (float metersPerTexel)
 Get/set the resolution of the breaking waves direction map (meters per texel)
virtual float getBreakingWavesMapResolution () const
virtual void enableReflections (bool enabled)
 Temporarily enable or disable the planar reflection camera(s).
virtual void releaseGLObjects (osg::State *state=0) const
 Destroy the openGL objects.
void heightMapChanged ()
 Notify the drawable of an updated height map.
void breakingWavesMapChanged ()
 Notify the drawable of an updated breaking waves map.

Public Attributes

boost::signal< void()> signal_postInitialize
 Emitted when Triton has been initialized.

Protected Member Functions

void shaderUpdateLightUniforms (osg::RenderInfo &info, osg::State &state, GLint shader, int shaderType) const
void shaderUpdateViewMatrices (osg::State &state, GLint shader, int shaderType, const Matrix4_32 &view_matrix_32, const Matrix4_32 &view_inverse_transpose_matrix_32) const
void updateCloudShadows (osg::State &state, GLint shader, int shaderType, GLboolean bIsCloudShadowActive, unsigned int cloudshadowTextureUnit, unsigned int cloudshadowTextureIndex, osg::Matrixf textureViewProjMatrix) const
void GetShaderUniformHandles (GLint shader, int shaderType) const
osg::ref_ptr< DtPlanarReflectiongetOrCreatePlanarReflection (osg::RenderInfo &renderInfo)
osg::ref_ptr< DtPlanarReflectionsetupPlanarReflections (osg::RenderInfo &renderInfo)
DtTritonHeightMapManagergetOrCreateHeightMapManager (osg::RenderInfo &renderInfo)
DtTritonBreakingWavesMapManagergetOrCreateBreakingWavesMapManager (osg::RenderInfo &renderInfo)
void setup (void)
void cleanup (void)
void removePlanarReflections ()
osg::Node * createReflectionWorldGraph (makVrv::DtOsgRenderer &osgRenderer, const osg::Matrix &localToWorld, const osg::Vec3 currentPos)
void computeReflectionMatrix (const osg::Vec3 &currentPosition)
void GetShaderUniformHandles () const
void applyLighting (osg::RenderInfo &info) const
void applyQuality () const
void updateShader (osg::Node *node, const osg::State &state) const
void computeReflectionBlend (const osg::Vec3 &currentPosition)
void adjustDisplacementDampingDistance ()
void updateReflectionCamFogColor (osg::Camera *reflectionCam) const
 slot for the fog color changing so we can set the clear color on the reflection maps to match
virtual ~DtTritonDrawable ()

Protected Attributes

osg::ref_ptr< osg::TextureCubeMap > myCubeMap
Triton::ResourceLoader * myResourceLoader
Triton::Environment * myEnvironment
Triton::Ocean * myOcean
double myDefaultDampingDistance
osg::Vec3 myOceanFloorNormal
osg::Vec3 myOceanFloorOrigin
bool myGeocentricFlag
bool myPlanarReflectionsFlag
float myReflectionBlend
float myMaxReflectionBlend
float myMaxWindForReflections
bool myReflectionsActive
bool myHeightMapFlag
bool myHeightMapChangedFlag
bool myBreakingWavesMapFlag
bool myBreakingWavesMapChangedFlag
float myDefaultVisibility
float mySurgeDepth
bool myInitializationComplete
bool myPrecipitationOverridden
bool mySavedPrecipitationState
float myHeightMapResolution
float myBreakingWavesMapResolution
bool myAllowUnderwater
float myLightThreshold
bool myPlanarReflectionsEnabled
osg::Vec4 myUnderwaterFogColor
double myUnderwaterVisibility
float myBreakerAmplitude
makVrv::DtEnvironmentInfomyEnvironmentInfo
makVrv::DtDemyDe
std::map< osg::Camera
*, osg::ref_ptr
< makVrv::DtPlanarReflection > > 
myPlanarReflectionCameraMap
std::map< osg::Camera
*, makVrv::DtTritonHeightMapManager * > 
myHeightMapManagerMap
std::map< osg::Camera
*, makVrv::DtTritonBreakingWavesMapManager * > 
myBreakingWavesMapManagerMap
osg::ref_ptr< osg::ClipNode > myClipNode
osg::Plane myReflectionPlane
osg::Matrix myReflectionMatrix
DtVector myLastGeocentricReference
int myViewPortSizeUniform [NUM_TRITON_SHADER_TYPES]
int myLightTextureUniform [NUM_TRITON_SHADER_TYPES]
int myTileLightIndexListTextureUniform [NUM_TRITON_SHADER_TYPES]
int myTileLightGridCountOffsetsTextureUniform [NUM_TRITON_SHADER_TYPES]
int myColorRampTextureUniform [NUM_TRITON_SHADER_TYPES]
int myModelViewMatrixUniform [NUM_TRITON_SHADER_TYPES]
int myModelViewInverseTransposeMatrixUniform [NUM_TRITON_SHADER_TYPES]
int myLightGridTileDimUniform [NUM_TRITON_SHADER_TYPES]
int myLightGridMaxDimUniform [NUM_TRITON_SHADER_TYPES]
int myCloudShadowTextureUniform [NUM_TRITON_SHADER_TYPES]
int myCloudShadowTexGenUniform [NUM_TRITON_SHADER_TYPES]
int myCloudShadowActive [NUM_TRITON_SHADER_TYPES]
std::vector< unsigned intmyUserShaderVector
GLuint myDefaultFragShaderId
GLuint myDefaultVertShaderId
TritonQuality myQuality
const DtTritonManagermyTritonManager
DtSignalConnectionManager myConnections

Detailed Description

An OSG Drawable representing Triton's infinite ocean.

Member Enumeration Documentation

Enumerator:
TritonQuality_Good 
TritonQuality_Better 
TritonQuality_Best 

Constructor & Destructor Documentation

makVrv::DtTritonDrawable::DtTritonDrawable ( makVrv::DtDe de,
const DtTritonManager tritonManager,
DtEnvironmentInfo environmentInfo,
bool  geocentric,
osg::TextureCubeMap *  cubeMap = NULL 
)

CTOR.

Referenced by clone(), and cloneType().

virtual makVrv::DtTritonDrawable::~DtTritonDrawable ( )
protectedvirtual

Member Function Documentation

virtual bool makVrv::DtTritonDrawable::isSameKindAs ( const Object *  obj) const
inlinevirtual
virtual Object* makVrv::DtTritonDrawable::cloneType ( ) const
inlinevirtual
virtual Object* makVrv::DtTritonDrawable::clone ( const osg::CopyOp &  copyop) const
inlinevirtual
virtual Triton::Ocean* makVrv::DtTritonDrawable::ocean ( )
inlinevirtual

Return the underlying Triton::Ocean object.

References myOcean.

virtual Triton::Environment* makVrv::DtTritonDrawable::environment ( )
inlinevirtual

Return the underlying Triton::Environment object.

References myEnvironment.

virtual void makVrv::DtTritonDrawable::setBeach ( osg::Vec3  beachOrigin,
osg::Vec3  normal 
)
virtual

Pass info to Triton about the local ocean depth and floor slope.

virtual void makVrv::DtTritonDrawable::drawImplementation ( osg::RenderInfo &  renderInfo) const
virtual

Perform drawing of the Ocean from the render thread.

virtual void makVrv::DtTritonDrawable::setPlanarReflections ( bool  enabled)
virtual

Toggle use of planar reflections of local objects.

virtual bool makVrv::DtTritonDrawable::planarReflections ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setBreakingWaveAmplitude ( float  meters)
virtual

Set height of breaking waves at shorelines. Set to 0 to disable.

virtual float makVrv::DtTritonDrawable::getBreakingWaveAmplitude ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setHeightMap ( bool  enabled)
virtual

Toggle use of automatically generated height maps for coastal effects Only enable if you have bathymetry and no sea-level ocean polygons in the database!

virtual bool makVrv::DtTritonDrawable::heightMap ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setQuality ( TritonQuality  quality)
virtual

Set quality of wave simulation - "good" yields best performance but least detail, "best" favors quality over performance.

Default is good.

virtual TritonQuality makVrv::DtTritonDrawable::getQuality ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setBreakingWavesMap ( bool  enabled)
virtual

Toggle use of shapefile-based breaking wave areas and directions If off, breaking waves will be everywhere and direction determined from bathymetry.

virtual bool makVrv::DtTritonDrawable::breakingWavesMap ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setWaveDampingDistance ( float  meters)
virtual

Sets distance at which waves go away to fight aliasing.

virtual float makVrv::DtTritonDrawable::waveDampingDistance ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setMaxReflectionWindSpeed ( double  metersPerSecond)
inlinevirtual

Set the wind speed at which we blend out planar reflections (default 20 m/s)

References myMaxWindForReflections.

virtual void makVrv::DtTritonDrawable::setUnderwaterFogColor ( const osg::Vec4 &  color)
inlinevirtual

Set the base (unlit) fog color when underwater.

References myUnderwaterFogColor.

virtual const osg::Vec4& makVrv::DtTritonDrawable::getUnderwaterFogColor ( ) const
inlinevirtual

References myUnderwaterFogColor.

virtual void makVrv::DtTritonDrawable::setUnderwaterVisibility ( double  visibility)
inlinevirtual

Set the visibility when underwater.

References myUnderwaterVisibility.

virtual double makVrv::DtTritonDrawable::getUnderwaterVisibility ( ) const
inlinevirtual
virtual void makVrv::DtTritonDrawable::setWaterVisibility ( double  visibility)
inlinevirtual

The visibility of the water when viewed from above (affects the transparency)

References myDefaultVisibility.

virtual double makVrv::DtTritonDrawable::getWaterVisibility ( ) const
inlinevirtual

References myDefaultVisibility.

virtual void makVrv::DtTritonDrawable::setSurgeDepth ( float  depth)
inlinevirtual

The depth at which we start dampening wave displacement.

References mySurgeDepth.

virtual float makVrv::DtTritonDrawable::getSurgeDepth ( ) const
inlinevirtual

References mySurgeDepth.

virtual bool makVrv::DtTritonDrawable::getIsInitialized ( ) const
inlinevirtual

Whether Triton has been fully initialized (after its first frame.)

References myInitializationComplete.

void makVrv::DtTritonDrawable::setAllowUnderwaterEffects ( bool  allow)
inline

Whether underwater fog etc.

is triggered when eye goes under the water surface

References myAllowUnderwater.

bool makVrv::DtTritonDrawable::getAllowUnderwaterEffects ( ) const
inline

Whether underwater fog is enabled.

References myAllowUnderwater.

virtual void makVrv::DtTritonDrawable::setHeightMapResolution ( float  metersPerTexel)
virtual

Get/set the resolution of the height map for shallow water effects (meters per texel)

virtual float makVrv::DtTritonDrawable::getHeightMapResolution ( ) const
virtual
virtual void makVrv::DtTritonDrawable::setBreakingWavesMapResolution ( float  metersPerTexel)
virtual

Get/set the resolution of the breaking waves direction map (meters per texel)

virtual float makVrv::DtTritonDrawable::getBreakingWavesMapResolution ( ) const
virtual
virtual void makVrv::DtTritonDrawable::enableReflections ( bool  enabled)
virtual

Temporarily enable or disable the planar reflection camera(s).

virtual void makVrv::DtTritonDrawable::releaseGLObjects ( osg::State *  state = 0) const
virtual

Destroy the openGL objects.

void makVrv::DtTritonDrawable::heightMapChanged ( )

Notify the drawable of an updated height map.

void makVrv::DtTritonDrawable::breakingWavesMapChanged ( )

Notify the drawable of an updated breaking waves map.

void makVrv::DtTritonDrawable::shaderUpdateLightUniforms ( osg::RenderInfo &  info,
osg::State &  state,
GLint  shader,
int  shaderType 
) const
protected
void makVrv::DtTritonDrawable::shaderUpdateViewMatrices ( osg::State &  state,
GLint  shader,
int  shaderType,
const Matrix4_32 view_matrix_32,
const Matrix4_32 view_inverse_transpose_matrix_32 
) const
protected
void makVrv::DtTritonDrawable::updateCloudShadows ( osg::State &  state,
GLint  shader,
int  shaderType,
GLboolean  bIsCloudShadowActive,
unsigned int  cloudshadowTextureUnit,
unsigned int  cloudshadowTextureIndex,
osg::Matrixf  textureViewProjMatrix 
) const
protected
void makVrv::DtTritonDrawable::GetShaderUniformHandles ( GLint  shader,
int  shaderType 
) const
protected
osg::ref_ptr<DtPlanarReflection> makVrv::DtTritonDrawable::getOrCreatePlanarReflection ( osg::RenderInfo &  renderInfo)
protected
osg::ref_ptr<DtPlanarReflection> makVrv::DtTritonDrawable::setupPlanarReflections ( osg::RenderInfo &  renderInfo)
protected
DtTritonHeightMapManager* makVrv::DtTritonDrawable::getOrCreateHeightMapManager ( osg::RenderInfo &  renderInfo)
protected
DtTritonBreakingWavesMapManager* makVrv::DtTritonDrawable::getOrCreateBreakingWavesMapManager ( osg::RenderInfo &  renderInfo)
protected
void makVrv::DtTritonDrawable::setup ( void  )
protected
void makVrv::DtTritonDrawable::cleanup ( void  )
protected
void makVrv::DtTritonDrawable::removePlanarReflections ( )
protected
osg::Node* makVrv::DtTritonDrawable::createReflectionWorldGraph ( makVrv::DtOsgRenderer osgRenderer,
const osg::Matrix &  localToWorld,
const osg::Vec3  currentPos 
)
protected
void makVrv::DtTritonDrawable::computeReflectionMatrix ( const osg::Vec3 &  currentPosition)
protected
void makVrv::DtTritonDrawable::GetShaderUniformHandles ( ) const
protected
void makVrv::DtTritonDrawable::applyLighting ( osg::RenderInfo &  info) const
protected
void makVrv::DtTritonDrawable::applyQuality ( ) const
protected
void makVrv::DtTritonDrawable::updateShader ( osg::Node *  node,
const osg::State &  state 
) const
protected
void makVrv::DtTritonDrawable::computeReflectionBlend ( const osg::Vec3 &  currentPosition)
protected
void makVrv::DtTritonDrawable::adjustDisplacementDampingDistance ( )
protected
void makVrv::DtTritonDrawable::updateReflectionCamFogColor ( osg::Camera *  reflectionCam) const
protected

slot for the fog color changing so we can set the clear color on the reflection maps to match

Member Data Documentation

boost::signal<void ()> makVrv::DtTritonDrawable::signal_postInitialize

Emitted when Triton has been initialized.

osg::ref_ptr< osg::TextureCubeMap > makVrv::DtTritonDrawable::myCubeMap
protected
Triton::ResourceLoader* makVrv::DtTritonDrawable::myResourceLoader
protected
Triton::Environment* makVrv::DtTritonDrawable::myEnvironment
protected

Referenced by environment().

Triton::Ocean* makVrv::DtTritonDrawable::myOcean
protected

Referenced by ocean().

double makVrv::DtTritonDrawable::myDefaultDampingDistance
protected
osg::Vec3 makVrv::DtTritonDrawable::myOceanFloorNormal
protected
osg::Vec3 makVrv::DtTritonDrawable::myOceanFloorOrigin
protected
bool makVrv::DtTritonDrawable::myGeocentricFlag
protected

Referenced by clone(), and cloneType().

bool makVrv::DtTritonDrawable::myPlanarReflectionsFlag
protected
float makVrv::DtTritonDrawable::myReflectionBlend
protected
float makVrv::DtTritonDrawable::myMaxReflectionBlend
protected
float makVrv::DtTritonDrawable::myMaxWindForReflections
protected
bool makVrv::DtTritonDrawable::myReflectionsActive
protected
bool makVrv::DtTritonDrawable::myHeightMapFlag
protected
bool makVrv::DtTritonDrawable::myHeightMapChangedFlag
protected
bool makVrv::DtTritonDrawable::myBreakingWavesMapFlag
protected
bool makVrv::DtTritonDrawable::myBreakingWavesMapChangedFlag
protected
float makVrv::DtTritonDrawable::myDefaultVisibility
protected
float makVrv::DtTritonDrawable::mySurgeDepth
protected

Referenced by getSurgeDepth(), and setSurgeDepth().

bool makVrv::DtTritonDrawable::myInitializationComplete
protected

Referenced by getIsInitialized().

bool makVrv::DtTritonDrawable::myPrecipitationOverridden
protected
bool makVrv::DtTritonDrawable::mySavedPrecipitationState
protected
float makVrv::DtTritonDrawable::myHeightMapResolution
protected
float makVrv::DtTritonDrawable::myBreakingWavesMapResolution
protected
bool makVrv::DtTritonDrawable::myAllowUnderwater
protected
float makVrv::DtTritonDrawable::myLightThreshold
protected
bool makVrv::DtTritonDrawable::myPlanarReflectionsEnabled
protected
osg::Vec4 makVrv::DtTritonDrawable::myUnderwaterFogColor
protected
double makVrv::DtTritonDrawable::myUnderwaterVisibility
protected
float makVrv::DtTritonDrawable::myBreakerAmplitude
protected
makVrv::DtEnvironmentInfo& makVrv::DtTritonDrawable::myEnvironmentInfo
protected

Referenced by clone(), and cloneType().

makVrv::DtDe& makVrv::DtTritonDrawable::myDe
protected

Referenced by clone(), and cloneType().

std::map<osg::Camera *, osg::ref_ptr<makVrv::DtPlanarReflection> > makVrv::DtTritonDrawable::myPlanarReflectionCameraMap
protected
std::map<osg::Camera *, makVrv::DtTritonHeightMapManager *> makVrv::DtTritonDrawable::myHeightMapManagerMap
protected
std::map<osg::Camera *, makVrv::DtTritonBreakingWavesMapManager *> makVrv::DtTritonDrawable::myBreakingWavesMapManagerMap
protected
osg::ref_ptr< osg::ClipNode > makVrv::DtTritonDrawable::myClipNode
protected
osg::Plane makVrv::DtTritonDrawable::myReflectionPlane
protected
osg::Matrix makVrv::DtTritonDrawable::myReflectionMatrix
protected
DtVector makVrv::DtTritonDrawable::myLastGeocentricReference
protected
int makVrv::DtTritonDrawable::myViewPortSizeUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myLightTextureUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myTileLightIndexListTextureUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myTileLightGridCountOffsetsTextureUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myColorRampTextureUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myModelViewMatrixUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myModelViewInverseTransposeMatrixUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myLightGridTileDimUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myLightGridMaxDimUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myCloudShadowTextureUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myCloudShadowTexGenUniform[NUM_TRITON_SHADER_TYPES]
mutableprotected
int makVrv::DtTritonDrawable::myCloudShadowActive[NUM_TRITON_SHADER_TYPES]
mutableprotected
std::vector<unsigned int> makVrv::DtTritonDrawable::myUserShaderVector
mutableprotected
GLuint makVrv::DtTritonDrawable::myDefaultFragShaderId
protected
GLuint makVrv::DtTritonDrawable::myDefaultVertShaderId
protected
TritonQuality makVrv::DtTritonDrawable::myQuality
protected
const DtTritonManager& makVrv::DtTritonDrawable::myTritonManager
protected

Referenced by clone(), and cloneType().

DtSignalConnectionManager makVrv::DtTritonDrawable::myConnections
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)