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

#include <renderingmanager.hpp>

Inheritance diagram for MWRender::RenderingManager:
Collaboration diagram for MWRender::RenderingManager:

Classes

struct  RayResult
 

Public Member Functions

 RenderingManager (osgViewer::Viewer *viewer, osg::ref_ptr< osg::Group > rootNode, Resource::ResourceSystem *resourceSystem, SceneUtil::WorkQueue *workQueue, const Fallback::Map *fallback, const std::string &resourcePath)
 
 ~RenderingManager ()
 
MWRender::ObjectsgetObjects ()
 
Resource::ResourceSystemgetResourceSystem ()
 
SceneUtil::WorkQueuegetWorkQueue ()
 
SceneUtil::UnrefQueuegetUnrefQueue ()
 
Terrain::WorldgetTerrain ()
 
void preloadCommonAssets ()
 
double getReferenceTime () const
 
osg::Group * getLightRoot ()
 
void setNightEyeFactor (float factor)
 
void setAmbientColour (const osg::Vec4f &colour)
 
void skySetDate (int day, int month)
 
int skyGetMasserPhase () const
 
int skyGetSecundaPhase () const
 
void skySetMoonColour (bool red)
 
void setSunDirection (const osg::Vec3f &direction)
 
void setSunColour (const osg::Vec4f &diffuse, const osg::Vec4f &specular)
 
void configureAmbient (const ESM::Cell *cell)
 
void configureFog (const ESM::Cell *cell)
 
void configureFog (float fogDepth, float underwaterFog, float dlFactor, float dlOffset, const osg::Vec4f &colour)
 
void addCell (const MWWorld::CellStore *store)
 
void removeCell (const MWWorld::CellStore *store)
 
void enableTerrain (bool enable)
 
void updatePtr (const MWWorld::Ptr &old, const MWWorld::Ptr &updated)
 
void rotateObject (const MWWorld::Ptr &ptr, const osg::Quat &rot)
 
void moveObject (const MWWorld::Ptr &ptr, const osg::Vec3f &pos)
 
void scaleObject (const MWWorld::Ptr &ptr, const osg::Vec3f &scale)
 
void removeObject (const MWWorld::Ptr &ptr)
 
void setWaterEnabled (bool enabled)
 
void setWaterHeight (float level)
 
void screenshot (osg::Image *image, int w, int h, osg::Matrixd cameraTransform=osg::Matrixd())
 Take a screenshot of w*h onto the given image, not including the GUI. More...
 
bool screenshot360 (osg::Image *image, std::string settingStr)
 
RayResult castRay (const osg::Vec3f &origin, const osg::Vec3f &dest, bool ignorePlayer, bool ignoreActors=false)
 
RayResult castCameraToViewportRay (const float nX, const float nY, float maxDistance, bool ignorePlayer, bool ignoreActors=false)
 
osg::Vec4f getScreenBounds (const MWWorld::Ptr &ptr)
 Get the bounding box of the given object in screen coordinates as (minX, minY, maxX, maxY), with (0,0) being the top left corner. More...
 
void setSkyEnabled (bool enabled)
 
bool toggleRenderMode (RenderMode mode)
 
SkyManagergetSkyManager ()
 
void spawnEffect (const std::string &model, const std::string &texture, const osg::Vec3f &worldPosition, float scale=1.f, bool isMagicVFX=true)
 
void clear ()
 Clear all savegame-specific data. More...
 
void notifyWorldSpaceChanged ()
 Clear all worldspace-specific data. More...
 
void update (float dt, bool paused)
 
AnimationgetAnimation (const MWWorld::Ptr &ptr)
 
const AnimationgetAnimation (const MWWorld::ConstPtr &ptr) const
 
void addWaterRippleEmitter (const MWWorld::Ptr &ptr)
 
void removeWaterRippleEmitter (const MWWorld::Ptr &ptr)
 
void emitWaterRipple (const osg::Vec3f &pos)
 
void updatePlayerPtr (const MWWorld::Ptr &ptr)
 
void removePlayer (const MWWorld::Ptr &player)
 
void setupPlayer (const MWWorld::Ptr &player)
 
void renderPlayer (const MWWorld::Ptr &player)
 
void rebuildPtr (const MWWorld::Ptr &ptr)
 
void processChangedSettings (const Settings::CategorySettingVector &settings)
 
float getNearClipDistance () const
 
float getTerrainHeightAt (const osg::Vec3f &pos)
 
bool vanityRotateCamera (const float *rot)
 
void setCameraDistance (float dist, bool adjust, bool override)
 
void resetCamera ()
 
float getCameraDistance () const
 
CameragetCamera ()
 
const osg::Vec3f & getCameraPosition () const
 
void togglePOV ()
 
void togglePreviewMode (bool enable)
 
bool toggleVanityMode (bool enable)
 
void allowVanityMode (bool allow)
 
void togglePlayerLooking (bool enable)
 
void changeVanityModeScale (float factor)
 
void overrideFieldOfView (float val)
 temporarily override the field of view with given value. More...
 
void resetFieldOfView ()
 reset a previous overrideFieldOfView() call, i.e. revert to field of view specified in the settings file. More...
 
osg::Vec3f getHalfExtents (const MWWorld::ConstPtr &object) const
 
void exportSceneGraph (const MWWorld::Ptr &ptr, const std::string &filename, const std::string &format)
 
LandManagergetLandManager () const
 
bool toggleBorders ()
 
- Public Member Functions inherited from MWRender::RenderingInterface
virtual ~RenderingInterface ()
 

Public Attributes

osg::Uniform * mUniformNear
 
osg::Uniform * mUniformFar
 

Private Member Functions

void updateProjectionMatrix ()
 
void updateTextureFiltering ()
 
void updateAmbient ()
 
void setFogColor (const osg::Vec4f &color)
 
void reportStats () const
 
void renderCameraToImage (osg::Camera *camera, osg::Image *image, int w, int h)
 
osg::ref_ptr
< osgUtil::IntersectionVisitor > 
getIntersectionVisitor (osgUtil::Intersector *intersector, bool ignorePlayer, bool ignoreActors)
 
void operator= (const RenderingManager &)
 
 RenderingManager (const RenderingManager &)
 

Private Attributes

osg::ref_ptr
< osgUtil::IntersectionVisitor > 
mIntersectionVisitor
 
osg::ref_ptr< osgViewer::Viewer > mViewer
 
osg::ref_ptr< osg::Group > mRootNode
 
osg::ref_ptr< osg::Group > mSceneRoot
 
Resource::ResourceSystemmResourceSystem
 
osg::ref_ptr
< SceneUtil::WorkQueue
mWorkQueue
 
osg::ref_ptr
< SceneUtil::UnrefQueue
mUnrefQueue
 
osg::ref_ptr< osg::Light > mSunLight
 
std::unique_ptr< PathgridmPathgrid
 
std::unique_ptr< ObjectsmObjects
 
std::unique_ptr< WatermWater
 
std::unique_ptr< Terrain::WorldmTerrain
 
TerrainStoragemTerrainStorage
 
std::unique_ptr< SkyManagermSky
 
std::unique_ptr< EffectManagermEffectManager
 
osg::ref_ptr< NpcAnimationmPlayerAnimation
 
osg::ref_ptr
< SceneUtil::PositionAttitudeTransform
mPlayerNode
 
std::unique_ptr< CameramCamera
 
osg::Vec3f mCurrentCameraPos
 
osg::ref_ptr< StateUpdatermStateUpdater
 
float mLandFogStart
 
float mLandFogEnd
 
float mUnderwaterFogStart
 
float mUnderwaterFogEnd
 
osg::Vec4f mUnderwaterColor
 
float mUnderwaterWeight
 
float mUnderwaterIndoorFog
 
osg::Vec4f mFogColor
 
osg::Vec4f mAmbientColor
 
float mNightEyeFactor
 
float mNearClip
 
float mViewDistance
 
bool mDistantFog: 1
 
bool mDistantTerrain: 1
 
bool mFieldOfViewOverridden: 1
 
float mFieldOfViewOverride
 
float mFieldOfView
 
float mFirstPersonFieldOfView
 
bool mBorders
 

Constructor & Destructor Documentation

MWRender::RenderingManager::RenderingManager ( osgViewer::Viewer *  viewer,
osg::ref_ptr< osg::Group >  rootNode,
Resource::ResourceSystem resourceSystem,
SceneUtil::WorkQueue workQueue,
const Fallback::Map fallback,
const std::string &  resourcePath 
)

Here is the call graph for this function:

MWRender::RenderingManager::~RenderingManager ( )
MWRender::RenderingManager::RenderingManager ( const RenderingManager )
private

Member Function Documentation

void MWRender::RenderingManager::addCell ( const MWWorld::CellStore store)

Here is the call graph for this function:

void MWRender::RenderingManager::addWaterRippleEmitter ( const MWWorld::Ptr ptr)

Here is the caller graph for this function:

void MWRender::RenderingManager::allowVanityMode ( bool  allow)
RenderingManager::RayResult MWRender::RenderingManager::castCameraToViewportRay ( const float  nX,
const float  nY,
float  maxDistance,
bool  ignorePlayer,
bool  ignoreActors = false 
)

Return the object under the mouse cursor / crosshair position, given by nX and nY normalized screen coordinates, where (0,0) is the top left corner.

Here is the call graph for this function:

RenderingManager::RayResult MWRender::RenderingManager::castRay ( const osg::Vec3f &  origin,
const osg::Vec3f &  dest,
bool  ignorePlayer,
bool  ignoreActors = false 
)

Here is the call graph for this function:

void MWRender::RenderingManager::changeVanityModeScale ( float  factor)
void MWRender::RenderingManager::clear ( )

Clear all savegame-specific data.

Here is the call graph for this function:

void MWRender::RenderingManager::configureAmbient ( const ESM::Cell cell)

Here is the call graph for this function:

void MWRender::RenderingManager::configureFog ( const ESM::Cell cell)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::configureFog ( float  fogDepth,
float  underwaterFog,
float  dlFactor,
float  dlOffset,
const osg::Vec4f &  colour 
)
void MWRender::RenderingManager::emitWaterRipple ( const osg::Vec3f &  pos)

Here is the caller graph for this function:

void MWRender::RenderingManager::enableTerrain ( bool  enable)
void MWRender::RenderingManager::exportSceneGraph ( const MWWorld::Ptr ptr,
const std::string &  filename,
const std::string &  format 
)

Here is the call graph for this function:

MWRender::Animation * MWRender::RenderingManager::getAnimation ( const MWWorld::Ptr ptr)
const MWRender::Animation * MWRender::RenderingManager::getAnimation ( const MWWorld::ConstPtr ptr) const
Camera * MWRender::RenderingManager::getCamera ( )
float MWRender::RenderingManager::getCameraDistance ( ) const
const osg::Vec3f & MWRender::RenderingManager::getCameraPosition ( ) const
osg::Vec3f MWRender::RenderingManager::getHalfExtents ( const MWWorld::ConstPtr object) const

Here is the call graph for this function:

osg::ref_ptr< osgUtil::IntersectionVisitor > MWRender::RenderingManager::getIntersectionVisitor ( osgUtil::Intersector *  intersector,
bool  ignorePlayer,
bool  ignoreActors 
)
private

Here is the caller graph for this function:

LandManager * MWRender::RenderingManager::getLandManager ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

osg::Group * MWRender::RenderingManager::getLightRoot ( )
float MWRender::RenderingManager::getNearClipDistance ( ) const
MWRender::Objects & MWRender::RenderingManager::getObjects ( )
virtual
double MWRender::RenderingManager::getReferenceTime ( ) const

Here is the caller graph for this function:

Resource::ResourceSystem * MWRender::RenderingManager::getResourceSystem ( )

Here is the caller graph for this function:

osg::Vec4f MWRender::RenderingManager::getScreenBounds ( const MWWorld::Ptr ptr)

Get the bounding box of the given object in screen coordinates as (minX, minY, maxX, maxY), with (0,0) being the top left corner.

Here is the call graph for this function:

SkyManager * MWRender::RenderingManager::getSkyManager ( )

Here is the caller graph for this function:

Terrain::World * MWRender::RenderingManager::getTerrain ( )

Here is the caller graph for this function:

float MWRender::RenderingManager::getTerrainHeightAt ( const osg::Vec3f &  pos)
SceneUtil::UnrefQueue * MWRender::RenderingManager::getUnrefQueue ( )

Here is the caller graph for this function:

SceneUtil::WorkQueue * MWRender::RenderingManager::getWorkQueue ( )

Here is the caller graph for this function:

void MWRender::RenderingManager::moveObject ( const MWWorld::Ptr ptr,
const osg::Vec3f &  pos 
)

Here is the call graph for this function:

void MWRender::RenderingManager::notifyWorldSpaceChanged ( )

Clear all worldspace-specific data.

Here is the caller graph for this function:

void MWRender::RenderingManager::operator= ( const RenderingManager )
private
void MWRender::RenderingManager::overrideFieldOfView ( float  val)

temporarily override the field of view with given value.

Here is the call graph for this function:

void MWRender::RenderingManager::preloadCommonAssets ( )
void MWRender::RenderingManager::processChangedSettings ( const Settings::CategorySettingVector settings)

Here is the call graph for this function:

void MWRender::RenderingManager::rebuildPtr ( const MWWorld::Ptr ptr)

Here is the call graph for this function:

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

Here is the call graph for this function:

void MWRender::RenderingManager::removeObject ( const MWWorld::Ptr ptr)

Here is the caller graph for this function:

void MWRender::RenderingManager::removePlayer ( const MWWorld::Ptr player)
void MWRender::RenderingManager::removeWaterRippleEmitter ( const MWWorld::Ptr ptr)

Here is the caller graph for this function:

void MWRender::RenderingManager::renderCameraToImage ( osg::Camera *  camera,
osg::Image *  image,
int  w,
int  h 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::renderPlayer ( const MWWorld::Ptr player)

Here is the call graph for this function:

void MWRender::RenderingManager::reportStats ( ) const
private

Here is the caller graph for this function:

void MWRender::RenderingManager::resetCamera ( )
void MWRender::RenderingManager::resetFieldOfView ( )

reset a previous overrideFieldOfView() call, i.e. revert to field of view specified in the settings file.

Here is the call graph for this function:

void MWRender::RenderingManager::rotateObject ( const MWWorld::Ptr ptr,
const osg::Quat &  rot 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::scaleObject ( const MWWorld::Ptr ptr,
const osg::Vec3f &  scale 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::screenshot ( osg::Image *  image,
int  w,
int  h,
osg::Matrixd  cameraTransform = osg::Matrixd() 
)

Take a screenshot of w*h onto the given image, not including the GUI.

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWRender::RenderingManager::screenshot360 ( osg::Image *  image,
std::string  settingStr 
)

Here is the call graph for this function:

void MWRender::RenderingManager::setAmbientColour ( const osg::Vec4f &  colour)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::setCameraDistance ( float  dist,
bool  adjust,
bool  override 
)
void MWRender::RenderingManager::setFogColor ( const osg::Vec4f &  color)
private

Here is the caller graph for this function:

void MWRender::RenderingManager::setNightEyeFactor ( float  factor)

Here is the call graph for this function:

void MWRender::RenderingManager::setSkyEnabled ( bool  enabled)

Here is the caller graph for this function:

void MWRender::RenderingManager::setSunColour ( const osg::Vec4f &  diffuse,
const osg::Vec4f &  specular 
)

Here is the caller graph for this function:

void MWRender::RenderingManager::setSunDirection ( const osg::Vec3f &  direction)

Here is the caller graph for this function:

void MWRender::RenderingManager::setupPlayer ( const MWWorld::Ptr player)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::setWaterEnabled ( bool  enabled)
void MWRender::RenderingManager::setWaterHeight ( float  level)
int MWRender::RenderingManager::skyGetMasserPhase ( ) const
int MWRender::RenderingManager::skyGetSecundaPhase ( ) const
void MWRender::RenderingManager::skySetDate ( int  day,
int  month 
)
void MWRender::RenderingManager::skySetMoonColour ( bool  red)
void MWRender::RenderingManager::spawnEffect ( const std::string &  model,
const std::string &  texture,
const osg::Vec3f &  worldPosition,
float  scale = 1.f,
bool  isMagicVFX = true 
)
bool MWRender::RenderingManager::toggleBorders ( )
void MWRender::RenderingManager::togglePlayerLooking ( bool  enable)
void MWRender::RenderingManager::togglePOV ( )
void MWRender::RenderingManager::togglePreviewMode ( bool  enable)
bool MWRender::RenderingManager::toggleRenderMode ( RenderMode  mode)
bool MWRender::RenderingManager::toggleVanityMode ( bool  enable)
void MWRender::RenderingManager::update ( float  dt,
bool  paused 
)

Here is the call graph for this function:

void MWRender::RenderingManager::updateAmbient ( )
private

Here is the caller graph for this function:

void MWRender::RenderingManager::updatePlayerPtr ( const MWWorld::Ptr ptr)

Here is the call graph for this function:

void MWRender::RenderingManager::updateProjectionMatrix ( )
private

Here is the caller graph for this function:

void MWRender::RenderingManager::updatePtr ( const MWWorld::Ptr old,
const MWWorld::Ptr updated 
)
void MWRender::RenderingManager::updateTextureFiltering ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWRender::RenderingManager::vanityRotateCamera ( const float *  rot)

Member Data Documentation

osg::Vec4f MWRender::RenderingManager::mAmbientColor
private
bool MWRender::RenderingManager::mBorders
private
std::unique_ptr<Camera> MWRender::RenderingManager::mCamera
private
osg::Vec3f MWRender::RenderingManager::mCurrentCameraPos
private
bool MWRender::RenderingManager::mDistantFog
private
bool MWRender::RenderingManager::mDistantTerrain
private
std::unique_ptr<EffectManager> MWRender::RenderingManager::mEffectManager
private
float MWRender::RenderingManager::mFieldOfView
private
bool MWRender::RenderingManager::mFieldOfViewOverridden
private
float MWRender::RenderingManager::mFieldOfViewOverride
private
float MWRender::RenderingManager::mFirstPersonFieldOfView
private
osg::Vec4f MWRender::RenderingManager::mFogColor
private
osg::ref_ptr<osgUtil::IntersectionVisitor> MWRender::RenderingManager::mIntersectionVisitor
private
float MWRender::RenderingManager::mLandFogEnd
private
float MWRender::RenderingManager::mLandFogStart
private
float MWRender::RenderingManager::mNearClip
private
float MWRender::RenderingManager::mNightEyeFactor
private
std::unique_ptr<Objects> MWRender::RenderingManager::mObjects
private
std::unique_ptr<Pathgrid> MWRender::RenderingManager::mPathgrid
private
osg::ref_ptr<NpcAnimation> MWRender::RenderingManager::mPlayerAnimation
private
osg::ref_ptr<SceneUtil::PositionAttitudeTransform> MWRender::RenderingManager::mPlayerNode
private
Resource::ResourceSystem* MWRender::RenderingManager::mResourceSystem
private
osg::ref_ptr<osg::Group> MWRender::RenderingManager::mRootNode
private
osg::ref_ptr<osg::Group> MWRender::RenderingManager::mSceneRoot
private
std::unique_ptr<SkyManager> MWRender::RenderingManager::mSky
private
osg::ref_ptr<StateUpdater> MWRender::RenderingManager::mStateUpdater
private
osg::ref_ptr<osg::Light> MWRender::RenderingManager::mSunLight
private
std::unique_ptr<Terrain::World> MWRender::RenderingManager::mTerrain
private
TerrainStorage* MWRender::RenderingManager::mTerrainStorage
private
osg::Vec4f MWRender::RenderingManager::mUnderwaterColor
private
float MWRender::RenderingManager::mUnderwaterFogEnd
private
float MWRender::RenderingManager::mUnderwaterFogStart
private
float MWRender::RenderingManager::mUnderwaterIndoorFog
private
float MWRender::RenderingManager::mUnderwaterWeight
private
osg::Uniform* MWRender::RenderingManager::mUniformFar
osg::Uniform* MWRender::RenderingManager::mUniformNear
osg::ref_ptr<SceneUtil::UnrefQueue> MWRender::RenderingManager::mUnrefQueue
private
float MWRender::RenderingManager::mViewDistance
private
osg::ref_ptr<osgViewer::Viewer> MWRender::RenderingManager::mViewer
private
std::unique_ptr<Water> MWRender::RenderingManager::mWater
private
osg::ref_ptr<SceneUtil::WorkQueue> MWRender::RenderingManager::mWorkQueue
private

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