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>

Collaboration diagram for Ogre::AutoParamDataSource:

Collaboration graph
[legend]
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.

const Matrix4getWorldMatrix (void) const
const Matrix4getViewMatrix (void) const
const Matrix4getProjectionMatrix (void) const
const Matrix4getWorldViewProjMatrix (void) const
const Matrix4getWorldViewMatrix (void) const
const Matrix4getInverseWorldMatrix (void) const
const Matrix4getInverseWorldViewMatrix (void) const
const Matrix4getInverseViewMatrix (void) const
const Vector4getCameraPositionObjectSpace (void) const
const LightgetLight (size_t index) const
 Get the light which is 'index'th closest to the current object.

void setAmbientLightColour (const ColourValue &ambient)
const ColourValuegetAmbientLightColour (void) const

Protected Attributes

Matrix4 mWorldMatrix [256]
Matrix4 mWorldViewMatrix
Matrix4 mWorldViewProjMatrix
Matrix4 mInverseWorldMatrix
Matrix4 mInverseWorldViewMatrix
Matrix4 mInverseViewMatrix
Vector4 mCameraPositionObjectSpace
bool mWorldMatrixDirty
bool mWorldViewMatrixDirty
bool mWorldViewProjMatrixDirty
bool mInverseWorldMatrixDirty
bool mInverseWorldViewMatrixDirty
bool mInverseViewMatrixDirty
bool mCameraPositionObjectSpaceDirty
ColourValue mAmbientLight
const RenderablemCurrentRenderable
const CameramCurrentCamera
const LightListmCurrentLightList
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 34 of file OgreAutoParamDataSource.cpp.

References mBlankLight, Ogre::Light::setAttenuation(), Ogre::Light::setDiffuseColour(), and Ogre::Light::setSpecularColour().

Ogre::AutoParamDataSource::~AutoParamDataSource  
 

Definition at line 50 of file OgreAutoParamDataSource.cpp.


Member Function Documentation

const ColourValue & Ogre::AutoParamDataSource::getAmbientLightColour void    const
 

Definition at line 181 of file OgreAutoParamDataSource.cpp.

References mAmbientLight.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Vector4 & Ogre::AutoParamDataSource::getCameraPositionObjectSpace void    const
 

Definition at line 152 of file OgreAutoParamDataSource.cpp.

References Ogre::Camera::getDerivedPosition(), getInverseWorldMatrix(), mCameraPositionObjectSpace, mCameraPositionObjectSpaceDirty, and mCurrentCamera.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights().

const Matrix4 & Ogre::AutoParamDataSource::getInverseViewMatrix void    const
 

Definition at line 142 of file OgreAutoParamDataSource.cpp.

References getViewMatrix(), Ogre::Matrix4::inverse(), mInverseViewMatrix, and mInverseViewMatrixDirty.

const Matrix4 & Ogre::AutoParamDataSource::getInverseWorldMatrix void    const
 

Definition at line 122 of file OgreAutoParamDataSource.cpp.

References getWorldMatrix(), Ogre::Matrix4::inverse(), mInverseWorldMatrix, and mInverseWorldMatrixDirty.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly(), Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), and getCameraPositionObjectSpace().

const Matrix4 & Ogre::AutoParamDataSource::getInverseWorldViewMatrix void    const
 

Definition at line 132 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 163 of file OgreAutoParamDataSource.cpp.

References mBlankLight, and mCurrentLightList.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly().

const Matrix4 & Ogre::AutoParamDataSource::getProjectionMatrix void    const
 

Definition at line 95 of file OgreAutoParamDataSource.cpp.

References Ogre::Camera::getStandardProjectionMatrix(), and mCurrentCamera.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), and getWorldViewProjMatrix().

const Matrix4 & Ogre::AutoParamDataSource::getViewMatrix void    const
 

Definition at line 90 of file OgreAutoParamDataSource.cpp.

References Ogre::Camera::getViewMatrix(), and mCurrentCamera.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getInverseViewMatrix(), and getWorldViewMatrix().

const Matrix4 & Ogre::AutoParamDataSource::getWorldMatrix void    const
 

Definition at line 80 of file OgreAutoParamDataSource.cpp.

References Ogre::Renderable::getWorldTransforms(), mCurrentRenderable, mWorldMatrix, and mWorldMatrixDirty.

Referenced by Ogre::GpuProgramParameters::_updateAutoParamsNoLights(), getInverseWorldMatrix(), and getWorldViewMatrix().

const Matrix4 & Ogre::AutoParamDataSource::getWorldViewMatrix void    const
 

Definition at line 102 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 112 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 176 of file OgreAutoParamDataSource.cpp.

References mAmbientLight.

Referenced by Ogre::SceneManager::_renderScene().

void Ogre::AutoParamDataSource::setCurrentCamera const Camera   cam
 

Updates the current camera.

Definition at line 65 of file OgreAutoParamDataSource.cpp.

References mCameraPositionObjectSpaceDirty, mCurrentCamera, mInverseViewMatrixDirty, mInverseWorldViewMatrixDirty, 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 75 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 54 of file OgreAutoParamDataSource.cpp.

References mCameraPositionObjectSpaceDirty, mCurrentRenderable, mInverseWorldMatrixDirty, mInverseWorldViewMatrixDirty, mWorldMatrixDirty, mWorldViewMatrixDirty, and mWorldViewProjMatrixDirty.

Referenced by Ogre::SceneManager::renderSingleObject().


Member Data Documentation

ColourValue Ogre::AutoParamDataSource::mAmbientLight [protected]
 

Definition at line 66 of file OgreAutoParamDataSource.h.

Referenced by getAmbientLightColour(), and setAmbientLightColour().

Light Ogre::AutoParamDataSource::mBlankLight [protected]
 

Definition at line 72 of file OgreAutoParamDataSource.h.

Referenced by AutoParamDataSource(), and getLight().

Vector4 Ogre::AutoParamDataSource::mCameraPositionObjectSpace [protected]
 

Definition at line 57 of file OgreAutoParamDataSource.h.

Referenced by getCameraPositionObjectSpace().

bool Ogre::AutoParamDataSource::mCameraPositionObjectSpaceDirty [protected]
 

Definition at line 65 of file OgreAutoParamDataSource.h.

Referenced by getCameraPositionObjectSpace(), setCurrentCamera(), and setCurrentRenderable().

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

Definition at line 69 of file OgreAutoParamDataSource.h.

Referenced by getCameraPositionObjectSpace(), getProjectionMatrix(), getViewMatrix(), and setCurrentCamera().

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

Definition at line 70 of file OgreAutoParamDataSource.h.

Referenced by getLight(), and setCurrentLightList().

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

Definition at line 68 of file OgreAutoParamDataSource.h.

Referenced by getWorldMatrix(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mInverseViewMatrix [protected]
 

Definition at line 56 of file OgreAutoParamDataSource.h.

Referenced by getInverseViewMatrix().

bool Ogre::AutoParamDataSource::mInverseViewMatrixDirty [protected]
 

Definition at line 64 of file OgreAutoParamDataSource.h.

Referenced by getInverseViewMatrix(), and setCurrentCamera().

Matrix4 Ogre::AutoParamDataSource::mInverseWorldMatrix [protected]
 

Definition at line 54 of file OgreAutoParamDataSource.h.

Referenced by getInverseWorldMatrix().

bool Ogre::AutoParamDataSource::mInverseWorldMatrixDirty [protected]
 

Definition at line 62 of file OgreAutoParamDataSource.h.

Referenced by getInverseWorldMatrix(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mInverseWorldViewMatrix [protected]
 

Definition at line 55 of file OgreAutoParamDataSource.h.

Referenced by getInverseWorldViewMatrix().

bool Ogre::AutoParamDataSource::mInverseWorldViewMatrixDirty [protected]
 

Definition at line 63 of file OgreAutoParamDataSource.h.

Referenced by getInverseWorldViewMatrix(), setCurrentCamera(), and setCurrentRenderable().

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

Definition at line 51 of file OgreAutoParamDataSource.h.

Referenced by getWorldMatrix().

bool Ogre::AutoParamDataSource::mWorldMatrixDirty [protected]
 

Definition at line 59 of file OgreAutoParamDataSource.h.

Referenced by getWorldMatrix(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mWorldViewMatrix [protected]
 

Definition at line 52 of file OgreAutoParamDataSource.h.

Referenced by getWorldViewMatrix().

bool Ogre::AutoParamDataSource::mWorldViewMatrixDirty [protected]
 

Definition at line 60 of file OgreAutoParamDataSource.h.

Referenced by getWorldViewMatrix(), setCurrentCamera(), and setCurrentRenderable().

Matrix4 Ogre::AutoParamDataSource::mWorldViewProjMatrix [protected]
 

Definition at line 53 of file OgreAutoParamDataSource.h.

Referenced by getWorldViewProjMatrix().

bool Ogre::AutoParamDataSource::mWorldViewProjMatrixDirty [protected]
 

Definition at line 61 of file OgreAutoParamDataSource.h.

Referenced by getWorldViewProjMatrix(), setCurrentCamera(), and setCurrentRenderable().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:16:46 2004