OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MWRender::Water Class Reference

Water rendering. More...

#include <water.hpp>

Collaboration diagram for MWRender::Water:

Public Member Functions

 Water (osg::Group *parent, osg::Group *sceneRoot, Resource::ResourceSystem *resourceSystem, osgUtil::IncrementalCompileOperation *ico, const Fallback::Map *fallback, const std::string &resourcePath)
 
 ~Water ()
 
void listAssetsToPreload (std::vector< std::string > &textures)
 
void setEnabled (bool enabled)
 
bool toggle ()
 
bool isUnderwater (const osg::Vec3f &pos) const
 
void addEmitter (const MWWorld::Ptr &ptr, float scale=1.f, float force=1.f)
 adds an emitter, position will be tracked automatically using its scene node More...
 
void removeEmitter (const MWWorld::Ptr &ptr)
 
void updateEmitterPtr (const MWWorld::Ptr &old, const MWWorld::Ptr &ptr)
 
void emitRipple (const osg::Vec3f &pos)
 
void removeCell (const MWWorld::CellStore *store)
 remove all emitters in this cell More...
 
void clearRipples ()
 
void changeCell (const MWWorld::CellStore *store)
 
void setHeight (const float height)
 
void update (float dt)
 
void processChangedSettings (const Settings::CategorySettingVector &settings)
 

Private Member Functions

osg::Vec3f getSceneNodeCoordinates (int gridX, int gridY)
 
void updateVisible ()
 
void createSimpleWaterStateSet (osg::Node *node, float alpha)
 
void createShaderWaterStateSet (osg::Node *node, Reflection *reflection, Refraction *refraction)
 
void updateWaterMaterial ()
 

Private Attributes

osg::ref_ptr< osg::Group > mParent
 
osg::ref_ptr< osg::Group > mSceneRoot
 
osg::ref_ptr
< osg::PositionAttitudeTransform > 
mWaterNode
 
osg::ref_ptr< osg::Geometry > mWaterGeom
 
Resource::ResourceSystemmResourceSystem
 
const Fallback::MapmFallback
 
osg::ref_ptr
< osgUtil::IncrementalCompileOperation > 
mIncrementalCompileOperation
 
std::auto_ptr< RippleSimulationmSimulation
 
osg::ref_ptr< RefractionmRefraction
 
osg::ref_ptr< ReflectionmReflection
 
const std::string mResourcePath
 
bool mEnabled
 
bool mToggled
 
float mTop
 

Static Private Attributes

static const int CELL_SIZE = 8192
 

Detailed Description

Water rendering.

Constructor & Destructor Documentation

MWRender::Water::Water ( osg::Group *  parent,
osg::Group *  sceneRoot,
Resource::ResourceSystem resourceSystem,
osgUtil::IncrementalCompileOperation *  ico,
const Fallback::Map fallback,
const std::string &  resourcePath 
)

Here is the call graph for this function:

MWRender::Water::~Water ( )

Member Function Documentation

void MWRender::Water::addEmitter ( const MWWorld::Ptr ptr,
float  scale = 1.f,
float  force = 1.f 
)

adds an emitter, position will be tracked automatically using its scene node

void MWRender::Water::changeCell ( const MWWorld::CellStore store)

Here is the call graph for this function:

void MWRender::Water::clearRipples ( )
void MWRender::Water::createShaderWaterStateSet ( osg::Node *  node,
Reflection reflection,
Refraction refraction 
)
private
Parameters
reflectionthe reflection camera (required)
refractionthe refraction camera (optional)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Water::createSimpleWaterStateSet ( osg::Node *  node,
float  alpha 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Water::emitRipple ( const osg::Vec3f &  pos)
osg::Vec3f MWRender::Water::getSceneNodeCoordinates ( int  gridX,
int  gridY 
)
private

Here is the caller graph for this function:

bool MWRender::Water::isUnderwater ( const osg::Vec3f &  pos) const
void MWRender::Water::listAssetsToPreload ( std::vector< std::string > &  textures)

Here is the call graph for this function:

void MWRender::Water::processChangedSettings ( const Settings::CategorySettingVector settings)

Here is the call graph for this function:

void MWRender::Water::removeCell ( const MWWorld::CellStore store)

remove all emitters in this cell

void MWRender::Water::removeEmitter ( const MWWorld::Ptr ptr)
void MWRender::Water::setEnabled ( bool  enabled)

Here is the call graph for this function:

void MWRender::Water::setHeight ( const float  height)

Here is the caller graph for this function:

bool MWRender::Water::toggle ( )

Here is the call graph for this function:

void MWRender::Water::update ( float  dt)
void MWRender::Water::updateEmitterPtr ( const MWWorld::Ptr old,
const MWWorld::Ptr ptr 
)
void MWRender::Water::updateVisible ( )
private

Here is the caller graph for this function:

void MWRender::Water::updateWaterMaterial ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const int MWRender::Water::CELL_SIZE = 8192
staticprivate
bool MWRender::Water::mEnabled
private
const Fallback::Map* MWRender::Water::mFallback
private
osg::ref_ptr<osgUtil::IncrementalCompileOperation> MWRender::Water::mIncrementalCompileOperation
private
osg::ref_ptr<osg::Group> MWRender::Water::mParent
private
osg::ref_ptr<Reflection> MWRender::Water::mReflection
private
osg::ref_ptr<Refraction> MWRender::Water::mRefraction
private
const std::string MWRender::Water::mResourcePath
private
Resource::ResourceSystem* MWRender::Water::mResourceSystem
private
osg::ref_ptr<osg::Group> MWRender::Water::mSceneRoot
private
std::auto_ptr<RippleSimulation> MWRender::Water::mSimulation
private
bool MWRender::Water::mToggled
private
float MWRender::Water::mTop
private
osg::ref_ptr<osg::Geometry> MWRender::Water::mWaterGeom
private
osg::ref_ptr<osg::PositionAttitudeTransform> MWRender::Water::mWaterNode
private

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