VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
makVrv::DtWaterOnScreen Class Reference

This class provides an OSG-specific implementation of water drops on the screen. More...

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

Public Member Functions

 DtWaterOnScreen (DtDe &de, const std::string &postProcessType, bool handles2D)
 Constructor. More...
 
virtual ~DtWaterOnScreen ()
 Destructor. More...
 
virtual void activateRaindrops (bool on)
 Activates or deactivates the raindrops-on-screen effect. More...
 
virtual void activateSplashes (bool on)
 Activates or deactivates the splashes on screen effect. More...
 
virtual void activateSpray (bool on)
 Activates or deactivates ocean spray on screen effect. More...
 
virtual void setIsUnderwater (bool underwater)
 Tells effect we are underwater, and no screen effects should exist. More...
 
virtual void addRainDrop (float x, float y, float radius)
 Add a single raindrop. More...
 
virtual void addOceanSplash (float intensity)
 Adds one frame's worth of large splashes on the screen, in response to a submerging or surfacing viewpoint. More...
 
virtual void setSplashIntensity (float intensity)
 Sets the overall intensity of the splash effect (0-1) More...
 
virtual void setSprayIntensity (float intensity)
 Sets the overall intensity of the spray effect (0-1) More...
 
virtual bool update (DtChannel *channel)
 Called once per frame from the DtPostProcessManager. More...
 
virtual int numActiveDrops () const
 How many drops are currently on the screen. More...
 
virtual void setWaterOnScreenSize (double size)
 Set the size of the water on screen effect(Rain Splash / Ocean Spray / Wave Splash) in percentage, default is 100(%) More...
 
virtual void addSplashEffects (const DtObserverObject *observer, bool hasWaveSplashEffect)
 Query the DtOsgSkyObject, DtTritonManager, and channel observer to determine whether to draw screen space ocean splash effects. More...
 
virtual void addSprayEffects (const DtObserverObject *observer, bool hasOceanSprayEffect)
 Query the DtOsgSkyObject, DtTritonManager, and channel observer to determine whether to draw screen space ocean spray effects (when near the surface of the ocean) More...
 
- Public Member Functions inherited from makVrv::DtPostProcessor
 DtPostProcessor (const std::string &postProcessType, bool handles2D)
 CTOR. More...
 
virtual ~DtPostProcessor ()
 DTOR. More...
 
virtual void setFragmentShaderSource (const char *source)
 Sets fragment shader source for this post-processor. More...
 
virtual void setVertexShaderSource (const char *source)
 Sets vertex shader source for this post-processor. More...
 
virtual void setFragmentShaderFile (const std::string &fileName)
 Sets fragment shader file for this post-processor. More...
 
virtual void setVertexShaderFile (const std::string &fileName)
 Sets vertex shader file for this post-processor. More...
 
virtual void setInputTexture (const DtChannel *channel, osg::Texture *texture)
 Sets the image that is postprocessed; this may be the 3D scene rendered to a texture, or the output texture of a chained post processor. More...
 
virtual osg::Texture * outputTexture ()
 Gets the output texture of this post processor, for use in chaining processors together. More...
 
virtual void setIsFinalEffect (const DtChannel *channel, bool final)
 Called by the DtPostProcessManager to indicate if this is the last post processor in the chain, and should render to the framebuffer. More...
 
virtual osg::Camera * cameraForChannel (const DtChannel *channel)
 Gets the Camera node associated with this effect and channel. More...
 
virtual void releaseGLObjects ()
 
virtual bool hasEffect (const std::string &effect)
 Does this post processor support this effect? More...
 
virtual bool effectEnabled (const std::string &effect)
 Is this effect (post processor sub-component) enabled? More...
 
virtual bool anyEffectEnabled ()
 Are any effects enabled? More...
 
virtual std::list< std::string > supportedEffects ()
 Get a list of supported effects for this post processor. More...
 
virtual bool handles2D () const
 Retrieves whether this post processor should be used in 2D orthographic views, as specified in its constructor. More...
 
virtual const std::string & type () const
 Gets the type of the post processor. More...
 
virtual bool postProcessorEnabled () const
 Is this post processor enabled? More...
 
virtual bool enableEffect (const std::string &effect)
 Enable a particular post processing technique For example, "wateroncamera" has techniques "rainsplash", "oceanspray", and "wavesplash". More...
 
virtual bool disableEffect (const std::string &effect)
 
virtual void enablePostProcessor ()
 Enable or disable the post processor. More...
 
virtual void disablePostProcessor ()
 

Static Public Member Functions

static double waterOnScreenSize ()
 Get the size of the water on screen effect(Rain Splash / Ocean Spray / Wave Splash) in percentage, default is 100(%) More...
 

Protected Member Functions

virtual void initialize ()
 
virtual void clearNormalMap ()
 
virtual void updateAndDrawDrops (double elapsedTime)
 
virtual void addRaindrops (double time, float heading, float observerVelocity)
 
virtual void addSpray (double time, float heading)
 
virtual void clearDrops ()
 
virtual void reset ()
 
virtual void setActiveStatus ()
 
virtual void slot_windowRemoved (DtWindow *window)
 
virtual void slot_waterOnScreenSizeChanged (double value)
 
- Protected Member Functions inherited from makVrv::DtPostProcessor
virtual bool effectItrEnabled (EffectMap::iterator &effect)
 
virtual void addEffect (std::string effect)
 When constructing a post processor, add the names of the sub-components (effects) that can be enabled and disabled. More...
 
virtual void setEnablePostProcessor (bool enabled)
 Set the post processor enabled state (true = enabled) More...
 

Protected Attributes

osg::ref_ptr< osg::Texture2D > myNormalMap
 
osg::ref_ptr< osg::Image > myNormalImage
 
DtDemyDe
 
double myLastUpdateTime
 
double myLastDropEmissionTime
 
double myLastSprayEmissionTime
 
bool myRaindropsActiveFlag
 
bool mySplashesActiveFlag
 
bool mySprayActiveFlag
 
bool myActiveFlag
 
bool myUnderwaterFlag
 
float mySplashIntensity
 
float mySprayIntensity
 
int myNumActiveDrops
 
DtGridCell myGrid [GRID_DIMENSION][GRID_DIMENSION]
 
unsigned char myNormalMapClearData [TEXSIZE *TEXSIZE *4]
 
bool myNormalMapClearDataInitialized
 
unsigned char myNormalImageData [TEXSIZE *TEXSIZE *4]
 
DtSignalConnectionManager mySignals
 
osg::ref_ptr
< DtWaterOnScreenDrawable
myWaterOnScreenDrawable
 
- Protected Attributes inherited from makVrv::DtPostProcessor
osg::ref_ptr< osg::Texture > myOutputTexture
 
osg::ref_ptr< osg::Texture > myInputTexture
 
osg::ref_ptr< osg::Program > myProgram
 
osg::ref_ptr< osg::Shader > myFragmentShader
 
osg::ref_ptr< osg::Shader > myVertexShader
 
osg::ref_ptr< osg::Geode > myQuad
 
CameraMap myCameraMap
 
bool myHandles2DFlag
 
bool myEnabledFlag
 
std::string myType
 
EffectMap myEffects
 
CallbackMap myCullCallbackMap
 

Static Protected Attributes

static double myWaterOnScreenSize
 

Private Member Functions

 DtWaterOnScreen ()
 private default constructor. not allowed. More...
 
 DtWaterOnScreen (const DtWaterOnScreen &)
 prevent copy-construction More...
 
DtWaterOnScreenoperator= (const DtWaterOnScreen &)
 prevent assignment More...
 

Additional Inherited Members

- Protected Types inherited from makVrv::DtPostProcessor
typedef boost::unordered_map
< std::string, bool
EffectMap
 
typedef std::map< const
DtChannel *, osg::ref_ptr
< osg::Camera > > 
CameraMap
 
typedef osg::ref_ptr
< DtPostProcessorCullVistorCallback
CallbackRefPtr
 
typedef std::map< const
DtChannel *, CallbackRefPtr
CallbackMap
 

Detailed Description

This class provides an OSG-specific implementation of water drops on the screen.

Constructor & Destructor Documentation

makVrv::DtWaterOnScreen::DtWaterOnScreen ( DtDe de,
const std::string &  postProcessType,
bool  handles2D 
)

Constructor.

virtual makVrv::DtWaterOnScreen::~DtWaterOnScreen ( )
virtual

Destructor.

makVrv::DtWaterOnScreen::DtWaterOnScreen ( )
private

private default constructor. not allowed.

makVrv::DtWaterOnScreen::DtWaterOnScreen ( const DtWaterOnScreen )
private

prevent copy-construction

Member Function Documentation

DtWaterOnScreen& makVrv::DtWaterOnScreen::operator= ( const DtWaterOnScreen )
private

prevent assignment

virtual void makVrv::DtWaterOnScreen::activateRaindrops ( bool  on)
virtual

Activates or deactivates the raindrops-on-screen effect.

virtual void makVrv::DtWaterOnScreen::activateSplashes ( bool  on)
virtual

Activates or deactivates the splashes on screen effect.

(From a submerging observer.)

virtual void makVrv::DtWaterOnScreen::activateSpray ( bool  on)
virtual

Activates or deactivates ocean spray on screen effect.

virtual void makVrv::DtWaterOnScreen::setIsUnderwater ( bool  underwater)
virtual

Tells effect we are underwater, and no screen effects should exist.

virtual void makVrv::DtWaterOnScreen::addRainDrop ( float  x,
float  y,
float  radius 
)
virtual

Add a single raindrop.

All parameters are normalized against the viewport dimensions (0-1)

virtual void makVrv::DtWaterOnScreen::addOceanSplash ( float  intensity)
virtual

Adds one frame's worth of large splashes on the screen, in response to a submerging or surfacing viewpoint.

virtual void makVrv::DtWaterOnScreen::setSplashIntensity ( float  intensity)
virtual

Sets the overall intensity of the splash effect (0-1)

virtual void makVrv::DtWaterOnScreen::setSprayIntensity ( float  intensity)
virtual

Sets the overall intensity of the spray effect (0-1)

virtual bool makVrv::DtWaterOnScreen::update ( DtChannel channel)
virtual

Called once per frame from the DtPostProcessManager.

Implements makVrv::DtPostProcessor.

virtual int makVrv::DtWaterOnScreen::numActiveDrops ( ) const
virtual

How many drops are currently on the screen.

virtual void makVrv::DtWaterOnScreen::setWaterOnScreenSize ( double  size)
virtual

Set the size of the water on screen effect(Rain Splash / Ocean Spray / Wave Splash) in percentage, default is 100(%)

virtual void makVrv::DtWaterOnScreen::addSplashEffects ( const DtObserverObject observer,
bool  hasWaveSplashEffect 
)
virtual

Query the DtOsgSkyObject, DtTritonManager, and channel observer to determine whether to draw screen space ocean splash effects.

virtual void makVrv::DtWaterOnScreen::addSprayEffects ( const DtObserverObject observer,
bool  hasOceanSprayEffect 
)
virtual

Query the DtOsgSkyObject, DtTritonManager, and channel observer to determine whether to draw screen space ocean spray effects (when near the surface of the ocean)

static double makVrv::DtWaterOnScreen::waterOnScreenSize ( )
static

Get the size of the water on screen effect(Rain Splash / Ocean Spray / Wave Splash) in percentage, default is 100(%)

virtual void makVrv::DtWaterOnScreen::initialize ( )
protectedvirtual

Reimplemented from makVrv::DtPostProcessor.

virtual void makVrv::DtWaterOnScreen::clearNormalMap ( )
protectedvirtual
virtual void makVrv::DtWaterOnScreen::updateAndDrawDrops ( double  elapsedTime)
protectedvirtual
virtual void makVrv::DtWaterOnScreen::addRaindrops ( double  time,
float  heading,
float  observerVelocity 
)
protectedvirtual
virtual void makVrv::DtWaterOnScreen::addSpray ( double  time,
float  heading 
)
protectedvirtual
virtual void makVrv::DtWaterOnScreen::clearDrops ( )
protectedvirtual
virtual void makVrv::DtWaterOnScreen::reset ( )
protectedvirtual
virtual void makVrv::DtWaterOnScreen::setActiveStatus ( )
protectedvirtual
virtual void makVrv::DtWaterOnScreen::slot_windowRemoved ( DtWindow window)
protectedvirtual
virtual void makVrv::DtWaterOnScreen::slot_waterOnScreenSizeChanged ( double  value)
protectedvirtual

Member Data Documentation

osg::ref_ptr<osg::Texture2D> makVrv::DtWaterOnScreen::myNormalMap
protected
osg::ref_ptr<osg::Image> makVrv::DtWaterOnScreen::myNormalImage
protected
DtDe& makVrv::DtWaterOnScreen::myDe
protected
double makVrv::DtWaterOnScreen::myLastUpdateTime
protected
double makVrv::DtWaterOnScreen::myLastDropEmissionTime
protected
double makVrv::DtWaterOnScreen::myLastSprayEmissionTime
protected
bool makVrv::DtWaterOnScreen::myRaindropsActiveFlag
protected
bool makVrv::DtWaterOnScreen::mySplashesActiveFlag
protected
bool makVrv::DtWaterOnScreen::mySprayActiveFlag
protected
bool makVrv::DtWaterOnScreen::myActiveFlag
protected
bool makVrv::DtWaterOnScreen::myUnderwaterFlag
protected
float makVrv::DtWaterOnScreen::mySplashIntensity
protected
float makVrv::DtWaterOnScreen::mySprayIntensity
protected
int makVrv::DtWaterOnScreen::myNumActiveDrops
protected
double makVrv::DtWaterOnScreen::myWaterOnScreenSize
staticprotected
DtGridCell makVrv::DtWaterOnScreen::myGrid[GRID_DIMENSION][GRID_DIMENSION]
protected
unsigned char makVrv::DtWaterOnScreen::myNormalMapClearData[TEXSIZE *TEXSIZE *4]
protected
bool makVrv::DtWaterOnScreen::myNormalMapClearDataInitialized
protected
unsigned char makVrv::DtWaterOnScreen::myNormalImageData[TEXSIZE *TEXSIZE *4]
protected
DtSignalConnectionManager makVrv::DtWaterOnScreen::mySignals
protected
osg::ref_ptr<DtWaterOnScreenDrawable> makVrv::DtWaterOnScreen::myWaterOnScreenDrawable
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)