OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | 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, 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, const osg::Vec4f &colour)
 
void addCell (const MWWorld::CellStore *store)
 
void removeCell (const MWWorld::CellStore *store)
 
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)
 Take a screenshot of w*h onto the given image, not including the GUI. More...
 
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...
 
- Public Member Functions inherited from MWRender::RenderingInterface
virtual ~RenderingInterface ()
 

Private Member Functions

void updateProjectionMatrix ()
 
void updateTextureFiltering ()
 
void updateAmbient ()
 
void setFogColor (const osg::Vec4f &color)
 
void operator= (const RenderingManager &)
 
 RenderingManager (const RenderingManager &)
 

Private Attributes

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::auto_ptr< PathgridmPathgrid
 
std::auto_ptr< ObjectsmObjects
 
std::auto_ptr< WatermWater
 
std::auto_ptr< Terrain::WorldmTerrain
 
std::auto_ptr< SkyManagermSky
 
std::auto_ptr< EffectManagermEffectManager
 
std::auto_ptr< NpcAnimationmPlayerAnimation
 
osg::ref_ptr
< SceneUtil::PositionAttitudeTransform
mPlayerNode
 
std::auto_ptr< CameramCamera
 
osg::Vec3f mCurrentCameraPos
 
osg::ref_ptr< StateUpdatermStateUpdater
 
float mFogDepth
 
osg::Vec4f mUnderwaterColor
 
float mUnderwaterWeight
 
float mUnderwaterFog
 
float mUnderwaterIndoorFog
 
osg::Vec4f mFogColor
 
osg::Vec4f mAmbientColor
 
float mNightEyeFactor
 
float mNearClip
 
float mViewDistance
 
float mFieldOfViewOverride
 
bool mFieldOfViewOverridden
 
float mFieldOfView
 
float mFirstPersonFieldOfView
 

Constructor & Destructor Documentation

MWRender::RenderingManager::RenderingManager ( osgViewer::Viewer *  viewer,
osg::ref_ptr< osg::Group >  rootNode,
Resource::ResourceSystem resourceSystem,
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)

Here is the caller graph for this function:

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:

Here is the caller 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:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

void MWRender::RenderingManager::clear ( )

Clear all savegame-specific data.

Here is the call graph for this function:

Here is the caller 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,
const osg::Vec4f &  colour 
)
void MWRender::RenderingManager::emitWaterRipple ( const osg::Vec3f &  pos)

Here is the caller graph for this function:

MWRender::Animation * MWRender::RenderingManager::getAnimation ( const MWWorld::Ptr ptr)

Here is the caller graph for this function:

const MWRender::Animation * MWRender::RenderingManager::getAnimation ( const MWWorld::ConstPtr ptr) const
Camera * MWRender::RenderingManager::getCamera ( )

Here is the caller graph for this function:

float MWRender::RenderingManager::getCameraDistance ( ) const

Here is the caller graph for this function:

const osg::Vec3f & MWRender::RenderingManager::getCameraPosition ( ) const

Here is the caller graph for this function:

osg::Group * MWRender::RenderingManager::getLightRoot ( )

Here is the caller graph for this function:

float MWRender::RenderingManager::getNearClipDistance ( ) const

Here is the caller graph for this function:

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:

Here is the caller 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)

Here is the caller graph for this function:

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:

Here is the caller 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:

Here is the caller graph for this function:

void MWRender::RenderingManager::preloadCommonAssets ( )

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller 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)

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::RenderingManager::resetCamera ( )

Here is the caller graph for this function:

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:

Here is the caller 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 
)

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

Here is the caller 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 
)

Here is the caller graph for this function:

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:

Here is the caller 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)

Here is the caller graph for this function:

int MWRender::RenderingManager::skyGetMasserPhase ( ) const

Here is the caller graph for this function:

int MWRender::RenderingManager::skyGetSecundaPhase ( ) const

Here is the caller graph for this function:

void MWRender::RenderingManager::skySetDate ( int  day,
int  month 
)

Here is the caller graph for this function:

void MWRender::RenderingManager::skySetMoonColour ( bool  red)

Here is the caller graph for this function:

void MWRender::RenderingManager::spawnEffect ( const std::string &  model,
const std::string &  texture,
const osg::Vec3f &  worldPosition,
float  scale = 1.f,
bool  isMagicVFX = true 
)

Here is the caller graph for this function:

void MWRender::RenderingManager::togglePlayerLooking ( bool  enable)

Here is the caller graph for this function:

void MWRender::RenderingManager::togglePOV ( )

Here is the caller graph for this function:

void MWRender::RenderingManager::togglePreviewMode ( bool  enable)

Here is the caller graph for this function:

bool MWRender::RenderingManager::toggleRenderMode ( RenderMode  mode)

Here is the caller graph for this function:

bool MWRender::RenderingManager::toggleVanityMode ( bool  enable)

Here is the caller graph for this function:

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)
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 
)

Here is the caller graph for this function:

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)

Here is the caller graph for this function:

Member Data Documentation

osg::Vec4f MWRender::RenderingManager::mAmbientColor
private
std::auto_ptr<Camera> MWRender::RenderingManager::mCamera
private
osg::Vec3f MWRender::RenderingManager::mCurrentCameraPos
private
std::auto_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
float MWRender::RenderingManager::mFogDepth
private
float MWRender::RenderingManager::mNearClip
private
float MWRender::RenderingManager::mNightEyeFactor
private
std::auto_ptr<Objects> MWRender::RenderingManager::mObjects
private
std::auto_ptr<Pathgrid> MWRender::RenderingManager::mPathgrid
private
std::auto_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::auto_ptr<SkyManager> MWRender::RenderingManager::mSky
private
osg::ref_ptr<StateUpdater> MWRender::RenderingManager::mStateUpdater
private
osg::ref_ptr<osg::Light> MWRender::RenderingManager::mSunLight
private
std::auto_ptr<Terrain::World> MWRender::RenderingManager::mTerrain
private
osg::Vec4f MWRender::RenderingManager::mUnderwaterColor
private
float MWRender::RenderingManager::mUnderwaterFog
private
float MWRender::RenderingManager::mUnderwaterIndoorFog
private
float MWRender::RenderingManager::mUnderwaterWeight
private
osg::ref_ptr<SceneUtil::UnrefQueue> MWRender::RenderingManager::mUnrefQueue
private
float MWRender::RenderingManager::mViewDistance
private
osg::ref_ptr<osgViewer::Viewer> MWRender::RenderingManager::mViewer
private
std::auto_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: