VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes
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]

Classes

class  GridCell
 Internal class for one cell of our grid of glass properties. More...

Public Member Functions

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

Protected Member Functions

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

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
GridCell grid [GRID_DIMENSION][GRID_DIMENSION]
unsigned char normalMapClearData [TEXSIZE *TEXSIZE *4]
bool normalMapClearDataInitialized
unsigned char normalImageData [TEXSIZE *TEXSIZE *4]
- Protected Attributes inherited from makVrv::DtPostProcessor
osg::ref_ptr< osg::Texture2D > myOutputTexture
osg::ref_ptr< osg::Texture2D > myInputTexture
osg::ref_ptr< osg::Program > myProgram
osg::ref_ptr< osg::Shader > myFragmentShader
osg::ref_ptr< osg::Geode > myQuad
charmyCustomFragmentSource
CameraMap myCameraMap
bool myHandles2DFlag
bool myEnabledFlag
std::string myType
EffectMap myEffects

Additional Inherited Members

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

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.

Member Function Documentation

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

Activates or deactivates the raindrops-on-screen effect.

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

Activates or deactivates the splashes on screen effect.

(From a submerging observer.)

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

Activates or deactivates ocean spray on screen effect.

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

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

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

Add a single raindrop.

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

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

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

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

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

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

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

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

Called once per frame from the DtOsgPostProcessManager.

Implements makVrv::DtPostProcessor.

int makVrv::DtWaterOnScreen::getNumActiveDrops ( ) const

How many drops are currently on the screen.

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

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

void makVrv::DtWaterOnScreen::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)

void makVrv::DtWaterOnScreen::initialize ( )
protected

Reimplemented from makVrv::DtPostProcessor.

void makVrv::DtWaterOnScreen::clearNormalMap ( )
protected
void makVrv::DtWaterOnScreen::updateAndDrawDrops ( double  elapsedTime)
protected
void makVrv::DtWaterOnScreen::addRaindrops ( double  time,
float  heading,
float  observerVelocity 
)
protected
void makVrv::DtWaterOnScreen::addSpray ( double  time,
float  heading 
)
protected
void makVrv::DtWaterOnScreen::clearDrops ( )
protected
void makVrv::DtWaterOnScreen::setActiveStatus ( )
protected
void makVrv::DtWaterOnScreen::slot_windowRemoved ( DtWindow window)
protected

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
GridCell makVrv::DtWaterOnScreen::grid[GRID_DIMENSION][GRID_DIMENSION]
protected
unsigned char makVrv::DtWaterOnScreen::normalMapClearData[TEXSIZE *TEXSIZE *4]
protected
bool makVrv::DtWaterOnScreen::normalMapClearDataInitialized
protected
unsigned char makVrv::DtWaterOnScreen::normalImageData[TEXSIZE *TEXSIZE *4]
protected

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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)