Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# Ogre::AutoParamDataSource Class Reference

This utility class is used to hold the information used to generate the matrices and other information required to automatically populate GpuProgramParameters. More...

`#include <OgreAutoParamDataSource.h>`

List of all members.

## Public Methods

| AutoParamDataSource ()
| ~AutoParamDataSource ()
void | setCurrentRenderable (const Renderable *rend)
| Updates the current renderable.
void | setCurrentCamera (const Camera *cam)
| Updates the current camera.
void | setCurrentLightList (const LightList *ll)
| Sets the light list that should be used.
void | setTextureProjector (const Frustum *frust)
| Sets the current texture projector.
void | setCurrentRenderTarget (const RenderTarget *target)
| Sets the current render target.
void | setShadowDirLightExtrusionDistance (Real dist)
| Sets the shadow extrusion distance to be used for point lights.
const Matrix4 & | getWorldMatrix (void) const
const Matrix4 * | getWorldMatrixArray (void) const
size_t | getWorldMatrixCount (void) const
const Matrix4 & | getViewMatrix (void) const
const Matrix4 & | getViewProjectionMatrix (void) const
const Matrix4 & | getProjectionMatrix (void) const
const Matrix4 & | getWorldViewProjMatrix (void) const
const Matrix4 & | getWorldViewMatrix (void) const
const Matrix4 & | getInverseWorldMatrix (void) const
const Matrix4 & | getInverseWorldViewMatrix (void) const
const Matrix4 & | getInverseViewMatrix (void) const
const Vector4 & | getCameraPositionObjectSpace (void) const
const Light & | getLight (size_t index) const
| Get the light which is 'index'th closest to the current object.
void | setAmbientLightColour (const ColourValue &ambient)
const ColourValue & | getAmbientLightColour (void) const
const Matrix4 & | getTextureViewProjMatrix (void) const
const RenderTarget * | getCurrentRenderTarget (void) const
const Renderable * | getCurrentRenderable (void) const
Real | getShadowExtrusionDistance (void) const

## Protected Attributes

Matrix4 | mWorldMatrix [256]
size_t | mWorldMatrixCount
Matrix4 | mWorldViewMatrix
Matrix4 | mViewProjMatrix
Matrix4 | mWorldViewProjMatrix
Matrix4 | mInverseWorldMatrix
Matrix4 | mInverseWorldViewMatrix
Matrix4 | mInverseViewMatrix
Vector4 | mCameraPositionObjectSpace
Matrix4 | mTextureViewProjMatrix
Matrix4 | mProjectionMatrix
Real | mDirLightExtrusionDistance
bool | mWorldMatrixDirty
bool | mWorldViewMatrixDirty
bool | mViewProjMatrixDirty
bool | mWorldViewProjMatrixDirty
bool | mInverseWorldMatrixDirty
bool | mInverseWorldViewMatrixDirty
bool | mInverseViewMatrixDirty
bool | mCameraPositionObjectSpaceDirty
bool | mTextureViewProjMatrixDirty
ColourValue | mAmbientLight
const Renderable * | mCurrentRenderable
const Camera * | mCurrentCamera
const LightList * | mCurrentLightList
const Frustum * | mCurrentTextureProjector
const RenderTarget * | mCurrentRenderTarget
Light | mBlankLight

## Detailed Description

This utility class is used to hold the information used to generate the matrices and other information required to automatically populate GpuProgramParameters.

Remarks:
  This class exercises a lazy-update scheme in order to avoid having to update all the information a GpuProgramParameters class could possibly want all the time. It relies on the SceneManager to update it when the base data has changed, and will calculate concatenated matrices etc only when required, passing back precalculated matrices when they are requested more than once when the underlying information has not altered.

Definition at line 48 of file OgreAutoParamDataSource.h.

## Constructor & Destructor Documentation

Ogre::AutoParamDataSource::AutoParamDataSource | ( |  | ) |

| Definition at line 40 of file OgreAutoParamDataSource.cpp. References mBlankLight, Ogre::Light::setAttenuation(), Ogre::Light::setDiffuseColour(), and Ogre::Light::setSpecularColour().

Ogre::AutoParamDataSource::~AutoParamDataSource | ( |  | ) |

| Definition at line 60 of file OgreAutoParamDataSource.cpp.

## Member Function Documentation

const ColourValue & Ogre::AutoParamDataSource::getAmbientLightColour | ( | void |  | ) | const

| Definition at line 232 of file OgreAutoParamDataSource.cpp. References mAmbientLight. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Vector4 & Ogre::AutoParamDataSource::getCameraPositionObjectSpace | ( | void |  | ) | const

| Definition at line 203 of file OgreAutoParamDataSource.cpp. References Ogre::Camera::getDerivedPosition(), getInverseWorldMatrix(), mCameraPositionObjectSpace, mCameraPositionObjectSpaceDirty, and mCurrentCamera. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Renderable * Ogre::AutoParamDataSource::getCurrentRenderable | ( | void |  | ) | const

| Definition at line 291 of file OgreAutoParamDataSource.cpp. References mCurrentRenderable. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const RenderTarget * Ogre::AutoParamDataSource::getCurrentRenderTarget | ( | void |  | ) | const

| Definition at line 263 of file OgreAutoParamDataSource.cpp. References mCurrentRenderTarget.

const Matrix4 & Ogre::AutoParamDataSource::getInverseViewMatrix | ( | void |  | ) | const

| Definition at line 193 of file OgreAutoParamDataSource.cpp. References getViewMatrix(), Ogre::Matrix4::inverse(), mInverseViewMatrix, and mInverseViewMatrixDirty.

const Matrix4 & Ogre::AutoParamDataSource::getInverseWorldMatrix | ( | void |  | ) | const

| Definition at line 173 of file OgreAutoParamDataSource.cpp. References getWorldMatrix(), Ogre::Matrix4::inverse(), mInverseWorldMatrix, and mInverseWorldMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly(), Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getCameraPositionObjectSpace(), and getShadowExtrusionDistance().

const Matrix4 & Ogre::AutoParamDataSource::getInverseWorldViewMatrix | ( | void |  | ) | const

| Definition at line 183 of file OgreAutoParamDataSource.cpp. References getWorldViewMatrix(), Ogre::Matrix4::inverse(), mInverseWorldViewMatrix, and mInverseWorldViewMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Light & Ogre::AutoParamDataSource::getLight | ( | size_t | index | ) | const

| Get the light which is 'index'th closest to the current object. Definition at line 214 of file OgreAutoParamDataSource.cpp. References mBlankLight, and mCurrentLightList. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly(), and getShadowExtrusionDistance().

const Matrix4 & Ogre::AutoParamDataSource::getProjectionMatrix | ( | void |  | ) | const

| Definition at line 140 of file OgreAutoParamDataSource.cpp. References Ogre::Frustum::getStandardProjectionMatrix(), mCurrentCamera, mCurrentRenderTarget, mProjectionMatrix, and Ogre::RenderTarget::requiresTextureFlipping(). Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getViewProjectionMatrix(), and getWorldViewProjMatrix().

Real Ogre::AutoParamDataSource::getShadowExtrusionDistance | ( | void |  | ) | const

| Definition at line 273 of file OgreAutoParamDataSource.cpp. References Ogre::Light::getAttenuationRange(), Ogre::Light::getDerivedPosition(), getInverseWorldMatrix(), getLight(), Ogre::Light::getType(), Ogre::Vector3::length(), mDirLightExtrusionDistance, and Ogre::Real. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly().

const Matrix4 & Ogre::AutoParamDataSource::getTextureViewProjMatrix | ( | void |  | ) | const

| Definition at line 245 of file OgreAutoParamDataSource.cpp. References Ogre::Frustum::getStandardProjectionMatrix(), Ogre::Frustum::getViewMatrix(), mCurrentTextureProjector, mTextureViewProjMatrix, mTextureViewProjMatrixDirty, and Ogre::PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE(). Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Matrix4 & Ogre::AutoParamDataSource::getViewMatrix | ( | void |  | ) | const

| Definition at line 125 of file OgreAutoParamDataSource.cpp. References Ogre::Frustum::getViewMatrix(), and mCurrentCamera. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getInverseViewMatrix(), getViewProjectionMatrix(), and getWorldViewMatrix().

const Matrix4 & Ogre::AutoParamDataSource::getViewProjectionMatrix | ( | void |  | ) | const

| Definition at line 130 of file OgreAutoParamDataSource.cpp. References getProjectionMatrix(), getViewMatrix(), mViewProjMatrix, and mViewProjMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Matrix4 & Ogre::AutoParamDataSource::getWorldMatrix | ( | void |  | ) | const

| Definition at line 92 of file OgreAutoParamDataSource.cpp. References Ogre::Renderable::getNumWorldTransforms(), Ogre::Renderable::getWorldTransforms(), mCurrentRenderable, mWorldMatrix, mWorldMatrixCount, and mWorldMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getInverseWorldMatrix(), and getWorldViewMatrix().

const Matrix4 * Ogre::AutoParamDataSource::getWorldMatrixArray | ( | void |  | ) | const

| Definition at line 114 of file OgreAutoParamDataSource.cpp. References Ogre::Renderable::getNumWorldTransforms(), Ogre::Renderable::getWorldTransforms(), mCurrentRenderable, mWorldMatrix, mWorldMatrixCount, and mWorldMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

size_t Ogre::AutoParamDataSource::getWorldMatrixCount | ( | void |  | ) | const

| Definition at line 103 of file OgreAutoParamDataSource.cpp. References Ogre::Renderable::getNumWorldTransforms(), Ogre::Renderable::getWorldTransforms(), mCurrentRenderable, mWorldMatrix, mWorldMatrixCount, and mWorldMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Matrix4 & Ogre::AutoParamDataSource::getWorldViewMatrix | ( | void |  | ) | const

| Definition at line 153 of file OgreAutoParamDataSource.cpp. References getViewMatrix(), getWorldMatrix(), mWorldViewMatrix, and mWorldViewMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getInverseWorldViewMatrix(), and getWorldViewProjMatrix().

const Matrix4 & Ogre::AutoParamDataSource::getWorldViewProjMatrix | ( | void |  | ) | const

| Definition at line 163 of file OgreAutoParamDataSource.cpp. References getProjectionMatrix(), getWorldViewMatrix(), mWorldViewProjMatrix, and mWorldViewProjMatrixDirty. Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

void Ogre::AutoParamDataSource::setAmbientLightColour | ( | const ColourValue & | ambient | ) |

| Definition at line 227 of file OgreAutoParamDataSource.cpp. References mAmbientLight. Referenced by Ogre::SceneManager::_renderScene(), Ogre::SceneManager::renderTextureShadowCasterQueueGroupObjects(), and Ogre::SceneManager::renderTextureShadowReceiverQueueGroupObjects().

void Ogre::AutoParamDataSource::setCurrentCamera | ( | const Camera * | cam | ) |

| Updates the current camera. Definition at line 76 of file OgreAutoParamDataSource.cpp. References mCameraPositionObjectSpaceDirty, mCurrentCamera, mInverseViewMatrixDirty, mInverseWorldViewMatrixDirty, mViewProjMatrixDirty, mWorldViewMatrixDirty, and mWorldViewProjMatrixDirty. Referenced by Ogre::SceneManager::_renderScene().

void Ogre::AutoParamDataSource::setCurrentLightList | ( | const LightList * | ll | ) |

| Sets the light list that should be used. Definition at line 87 of file OgreAutoParamDataSource.cpp. References Ogre::LightList, and mCurrentLightList. Referenced by Ogre::SceneManager::renderSingleObject().

void Ogre::AutoParamDataSource::setCurrentRenderable | ( | const Renderable * | rend | ) |

| Updates the current renderable. Definition at line 64 of file OgreAutoParamDataSource.cpp. References mCameraPositionObjectSpaceDirty, mCurrentRenderable, mInverseWorldMatrixDirty, mInverseWorldViewMatrixDirty, mViewProjMatrixDirty, mWorldMatrixDirty, mWorldViewMatrixDirty, and mWorldViewProjMatrixDirty. Referenced by Ogre::SceneManager::renderSingleObject().

void Ogre::AutoParamDataSource::setCurrentRenderTarget | ( | const RenderTarget * | target | ) |

| Sets the current render target. Definition at line 258 of file OgreAutoParamDataSource.cpp. References mCurrentRenderTarget. Referenced by Ogre::SceneManager::_renderScene().

void Ogre::AutoParamDataSource::setShadowDirLightExtrusionDistance | ( | Real | dist | ) |

| Sets the shadow extrusion distance to be used for point lights. Definition at line 268 of file OgreAutoParamDataSource.cpp. References mDirLightExtrusionDistance, and Ogre::Real. Referenced by Ogre::SceneManager::_renderScene().

void Ogre::AutoParamDataSource::setTextureProjector | ( | const Frustum * | frust | ) |

| Sets the current texture projector. Definition at line 238 of file OgreAutoParamDataSource.cpp. References mCurrentTextureProjector, and mTextureViewProjMatrixDirty. Referenced by Ogre::SceneManager::renderModulativeTextureShadowedQueueGroupObjects().

## Member Data Documentation

ColourValue Ogre::AutoParamDataSource::mAmbientLight`[protected]`

| Definition at line 73 of file OgreAutoParamDataSource.h. Referenced by getAmbientLightColour(), and setAmbientLightColour().

Light Ogre::AutoParamDataSource::mBlankLight`[protected]`

| Definition at line 81 of file OgreAutoParamDataSource.h. Referenced by AutoParamDataSource(), and getLight().

Vector4 Ogre::AutoParamDataSource::mCameraPositionObjectSpace`[protected]`

| Definition at line 59 of file OgreAutoParamDataSource.h. Referenced by getCameraPositionObjectSpace().

bool Ogre::AutoParamDataSource::mCameraPositionObjectSpaceDirty`[protected]`

| Definition at line 71 of file OgreAutoParamDataSource.h. Referenced by getCameraPositionObjectSpace(), setCurrentCamera(), and setCurrentRenderable().

const Camera* Ogre::AutoParamDataSource::mCurrentCamera`[protected]`

| Definition at line 76 of file OgreAutoParamDataSource.h. Referenced by getCameraPositionObjectSpace(), getProjectionMatrix(), getViewMatrix(), and setCurrentCamera().

const LightList* Ogre::AutoParamDataSource::mCurrentLightList`[protected]`

| Definition at line 77 of file OgreAutoParamDataSource.h. Referenced by getLight(), and setCurrentLightList().

const Renderable* Ogre::AutoParamDataSource::mCurrentRenderable`[protected]`

| Definition at line 75 of file OgreAutoParamDataSource.h. Referenced by getCurrentRenderable(), getWorldMatrix(), getWorldMatrixArray(), getWorldMatrixCount(), and setCurrentRenderable().

const RenderTarget* Ogre::AutoParamDataSource::mCurrentRenderTarget`[protected]`

| Definition at line 79 of file OgreAutoParamDataSource.h. Referenced by getCurrentRenderTarget(), getProjectionMatrix(), and setCurrentRenderTarget().

const Frustum* Ogre::AutoParamDataSource::mCurrentTextureProjector`[protected]`

| Definition at line 78 of file OgreAutoParamDataSource.h. Referenced by getTextureViewProjMatrix(), and setTextureProjector().

Real Ogre::AutoParamDataSource::mDirLightExtrusionDistance`[protected]`

| Definition at line 62 of file OgreAutoParamDataSource.h. Referenced by getShadowExtrusionDistance(), and setShadowDirLightExtrusionDistance().

Matrix4 Ogre::AutoParamDataSource::mInverseViewMatrix`[protected]`

| Definition at line 58 of file OgreAutoParamDataSource.h. Referenced by getInverseViewMatrix().

bool Ogre::AutoParamDataSource::mInverseViewMatrixDirty`[protected]`

| Definition at line 70 of file OgreAutoParamDataSource.h. Referenced by getInverseViewMatrix(), and setCurrentCamera().

Matrix4 Ogre::AutoParamDataSource::mInverseWorldMatrix`[protected]`

| Definition at line 56 of file OgreAutoParamDataSource.h. Referenced by getInverseWorldMatrix().

bool Ogre::AutoParamDataSource::mInverseWorldMatrixDirty`[protected]`

| Definition at line 68 of file OgreAutoParamDataSource.h. Referenced by getInverseWorldMatrix(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mInverseWorldViewMatrix`[protected]`

| Definition at line 57 of file OgreAutoParamDataSource.h. Referenced by getInverseWorldViewMatrix().

bool Ogre::AutoParamDataSource::mInverseWorldViewMatrixDirty`[protected]`

| Definition at line 69 of file OgreAutoParamDataSource.h. Referenced by getInverseWorldViewMatrix(), setCurrentCamera(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mProjectionMatrix`[protected]`

| Definition at line 61 of file OgreAutoParamDataSource.h. Referenced by getProjectionMatrix().

Matrix4 Ogre::AutoParamDataSource::mTextureViewProjMatrix`[protected]`

| Definition at line 60 of file OgreAutoParamDataSource.h. Referenced by getTextureViewProjMatrix().

bool Ogre::AutoParamDataSource::mTextureViewProjMatrixDirty`[protected]`

| Definition at line 72 of file OgreAutoParamDataSource.h. Referenced by getTextureViewProjMatrix(), and setTextureProjector().

Matrix4 Ogre::AutoParamDataSource::mViewProjMatrix`[protected]`

| Definition at line 54 of file OgreAutoParamDataSource.h. Referenced by getViewProjectionMatrix().

bool Ogre::AutoParamDataSource::mViewProjMatrixDirty`[protected]`

| Definition at line 66 of file OgreAutoParamDataSource.h. Referenced by getViewProjectionMatrix(), setCurrentCamera(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mWorldMatrix[256]`[protected]`

| Definition at line 51 of file OgreAutoParamDataSource.h. Referenced by getWorldMatrix(), getWorldMatrixArray(), and getWorldMatrixCount().

size_t Ogre::AutoParamDataSource::mWorldMatrixCount`[protected]`

| Definition at line 52 of file OgreAutoParamDataSource.h. Referenced by getWorldMatrix(), getWorldMatrixArray(), and getWorldMatrixCount().

bool Ogre::AutoParamDataSource::mWorldMatrixDirty`[protected]`

| Definition at line 64 of file OgreAutoParamDataSource.h. Referenced by getWorldMatrix(), getWorldMatrixArray(), getWorldMatrixCount(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mWorldViewMatrix`[protected]`

| Definition at line 53 of file OgreAutoParamDataSource.h. Referenced by getWorldViewMatrix().

bool Ogre::AutoParamDataSource::mWorldViewMatrixDirty`[protected]`

| Definition at line 65 of file OgreAutoParamDataSource.h. Referenced by getWorldViewMatrix(), setCurrentCamera(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mWorldViewProjMatrix`[protected]`

| Definition at line 55 of file OgreAutoParamDataSource.h. Referenced by getWorldViewProjMatrix().

bool Ogre::AutoParamDataSource::mWorldViewProjMatrixDirty`[protected]`

| Definition at line 67 of file OgreAutoParamDataSource.h. Referenced by getWorldViewProjMatrix(), setCurrentCamera(), and setCurrentRenderable().

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

- OgreAutoParamDataSource.h
- OgreAutoParamDataSource.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:47 2004