Emergency 20 Dokumentation  4.2.0
Ogre::StableCsmShadowCameraSetup Class Reference

#include <ShadowCameraSetupStableCsm.h>

Inheritance diagram for Ogre::StableCsmShadowCameraSetup:

Public Types

typedef std::vector< Ogre::Real > SplitPointList
 

Public Member Functions

 StableCsmShadowCameraSetup ()
 
 ~StableCsmShadowCameraSetup ()
 
void calculateSplitPoints (size_t cascadeCount, Ogre::Real firstSplitDist, Ogre::Real farDist, Ogre::Real lambda=0.95)
 
void setSplitPoints (const SplitPointList &newSplitPoints)
 
void setSplitPadding (Ogre::Real pad)
 
Ogre::Real getSplitPadding () const
 
size_t getCascadeCount () const
 Get the number of splits. More...
 
virtual void getShadowCamera (const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration) const
 Returns a stable CSM shadow camera for the given iteration. More...
 
const SplitPointListgetSplitPoints () const
 Returns the calculated split points. More...
 

Protected Member Functions

void getShadowCameraForCascade (const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration, Ogre::Real nearSplit, Ogre::Real farSplit) const
 

Protected Attributes

size_t mCascadeCount
 
SplitPointList mSplitPoints
 
Ogre::Real mSplitPadding
 
size_t mCurrentIteration
 

Member Typedef Documentation

typedef std::vector<Ogre::Real> Ogre::StableCsmShadowCameraSetup::SplitPointList

Constructor & Destructor Documentation

Ogre::StableCsmShadowCameraSetup::StableCsmShadowCameraSetup ( )
Ogre::StableCsmShadowCameraSetup::~StableCsmShadowCameraSetup ( )

Member Function Documentation

void Ogre::StableCsmShadowCameraSetup::calculateSplitPoints ( size_t  cascadeCount,
Ogre::Real  firstSplitDist,
Ogre::Real  farDist,
Ogre::Real  lambda = 0.95 
)

Calculate a new splitting scheme.

Parameters
cascadeCountThe number of cascades to use
firstSplitDistdistance of the first split
farDistThe far plane to use for the last split
lambdaValue between 0 (linear splits) and 1 (logarithmic splits)
size_t Ogre::StableCsmShadowCameraSetup::getCascadeCount ( ) const
inline

Get the number of splits.

virtual void Ogre::StableCsmShadowCameraSetup::getShadowCamera ( const Ogre::SceneManager *  sm,
const Ogre::Camera *  cam,
const Ogre::Viewport *  vp,
const Ogre::Light *  light,
Ogre::Camera *  texCam,
size_t  iteration 
) const
virtual

Returns a stable CSM shadow camera for the given iteration.

void Ogre::StableCsmShadowCameraSetup::getShadowCameraForCascade ( const Ogre::SceneManager *  sm,
const Ogre::Camera *  cam,
const Ogre::Viewport *  vp,
const Ogre::Light *  light,
Ogre::Camera *  texCam,
size_t  iteration,
Ogre::Real  nearSplit,
Ogre::Real  farSplit 
) const
protected
Ogre::Real Ogre::StableCsmShadowCameraSetup::getSplitPadding ( ) const
inline

Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.

const SplitPointList& Ogre::StableCsmShadowCameraSetup::getSplitPoints ( ) const
inline

Returns the calculated split points.

void Ogre::StableCsmShadowCameraSetup::setSplitPadding ( Ogre::Real  pad)
inline
void Ogre::StableCsmShadowCameraSetup::setSplitPoints ( const SplitPointList newSplitPoints)

Manually configure a new splitting scheme.

Parameters
newSplitPointsA list which is cascadeCount + 1 entries long, containing the split points. The first value is the near point, the last value is the far point, and each value in between is both a far point of the previous split, and a near point for the next one.

Member Data Documentation

size_t Ogre::StableCsmShadowCameraSetup::mCascadeCount
protected
size_t Ogre::StableCsmShadowCameraSetup::mCurrentIteration
mutableprotected
Ogre::Real Ogre::StableCsmShadowCameraSetup::mSplitPadding
protected
SplitPointList Ogre::StableCsmShadowCameraSetup::mSplitPoints
protected

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