OgreAutoParamDataSource.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __AutoParamDataSource_H_
#define __AutoParamDataSource_H_
#include "OgrePrerequisites.h"
#include "OgreCommon.h"
#include "OgreMatrix4.h"
#include "OgreVector4.h"
#include "OgreLight.h"
#include "OgreColourValue.h"
namespace Ogre {
// forward decls
struct VisibleObjectsBoundsInfo;
class _OgreExport AutoParamDataSource : public SceneMgtAlloc
{
protected:
const Light& getLight(size_t index) const;
mutable Matrix4 mWorldMatrix[256];
mutable size_t mWorldMatrixCount;
mutable const Matrix4* mWorldMatrixArray;
mutable Matrix4 mWorldViewMatrix;
mutable Matrix4 mViewProjMatrix;
mutable Matrix4 mWorldViewProjMatrix;
mutable Matrix4 mInverseWorldMatrix;
mutable Matrix4 mInverseWorldViewMatrix;
mutable Matrix4 mInverseViewMatrix;
mutable Matrix4 mInverseTransposeWorldMatrix;
mutable Matrix4 mInverseTransposeWorldViewMatrix;
mutable Vector4 mCameraPosition;
mutable Vector4 mCameraPositionObjectSpace;
mutable Matrix4 mTextureViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable Matrix4 mTextureWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable Matrix4 mSpotlightViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable Matrix4 mSpotlightWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable Vector4 mShadowCamDepthRanges[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable Matrix4 mViewMatrix;
mutable Matrix4 mProjectionMatrix;
mutable Real mDirLightExtrusionDistance;
mutable Vector4 mLodCameraPosition;
mutable Vector4 mLodCameraPositionObjectSpace;
mutable bool mWorldMatrixDirty;
mutable bool mViewMatrixDirty;
mutable bool mProjMatrixDirty;
mutable bool mWorldViewMatrixDirty;
mutable bool mViewProjMatrixDirty;
mutable bool mWorldViewProjMatrixDirty;
mutable bool mInverseWorldMatrixDirty;
mutable bool mInverseWorldViewMatrixDirty;
mutable bool mInverseViewMatrixDirty;
mutable bool mInverseTransposeWorldMatrixDirty;
mutable bool mInverseTransposeWorldViewMatrixDirty;
mutable bool mCameraPositionDirty;
mutable bool mCameraPositionObjectSpaceDirty;
mutable bool mTextureViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable bool mTextureWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable bool mSpotlightViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable bool mSpotlightWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable bool mShadowCamDepthRangesDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
mutable ColourValue mAmbientLight;
mutable ColourValue mFogColour;
mutable Vector4 mFogParams;
mutable int mPassNumber;
mutable Vector4 mSceneDepthRange;
mutable bool mSceneDepthRangeDirty;
mutable bool mLodCameraPositionDirty;
mutable bool mLodCameraPositionObjectSpaceDirty;
const Renderable* mCurrentRenderable;
const Camera* mCurrentCamera;
bool mCameraRelativeRendering;
Vector3 mCameraRelativePosition;
const LightList* mCurrentLightList;
const Frustum* mCurrentTextureProjector[OGRE_MAX_SIMULTANEOUS_LIGHTS];
const RenderTarget* mCurrentRenderTarget;
const Viewport* mCurrentViewport;
const SceneManager* mCurrentSceneManager;
const VisibleObjectsBoundsInfo* mMainCamBoundsInfo;
const Pass* mCurrentPass;
Light mBlankLight;
public:
AutoParamDataSource();
virtual ~AutoParamDataSource();
virtual void setCurrentRenderable(const Renderable* rend);
virtual void setWorldMatrices(const Matrix4* m, size_t count);
virtual void setCurrentCamera(const Camera* cam, bool useCameraRelative);
virtual void setCurrentLightList(const LightList* ll);
virtual void setTextureProjector(const Frustum* frust, size_t index);
virtual void setCurrentRenderTarget(const RenderTarget* target);
virtual void setCurrentViewport(const Viewport* viewport);
virtual void setShadowDirLightExtrusionDistance(Real dist);
virtual void setMainCamBoundsInfo(VisibleObjectsBoundsInfo* info);
virtual void setCurrentSceneManager(const SceneManager* sm);
virtual void setCurrentPass(const Pass* pass);
virtual const Matrix4& getWorldMatrix(void) const;
virtual const Matrix4* getWorldMatrixArray(void) const;
virtual size_t getWorldMatrixCount(void) const;
virtual const Matrix4& getViewMatrix(void) const;
virtual const Matrix4& getViewProjectionMatrix(void) const;
virtual const Matrix4& getProjectionMatrix(void) const;
virtual const Matrix4& getWorldViewProjMatrix(void) const;
virtual const Matrix4& getWorldViewMatrix(void) const;
virtual const Matrix4& getInverseWorldMatrix(void) const;
virtual const Matrix4& getInverseWorldViewMatrix(void) const;
virtual const Matrix4& getInverseViewMatrix(void) const;
virtual const Matrix4& getInverseTransposeWorldMatrix(void) const;
virtual const Matrix4& getInverseTransposeWorldViewMatrix(void) const;
virtual const Vector4& getCameraPosition(void) const;
virtual const Vector4& getCameraPositionObjectSpace(void) const;
virtual const Vector4& getLodCameraPosition(void) const;
virtual const Vector4& getLodCameraPositionObjectSpace(void) const;
virtual bool hasLightList() const { return mCurrentLightList != 0; }
virtual float getLightNumber(size_t index) const;
virtual float getLightCount() const;
virtual float getLightCastsShadows(size_t index) const;
virtual const ColourValue& getLightDiffuseColour(size_t index) const;
virtual const ColourValue& getLightSpecularColour(size_t index) const;
virtual const ColourValue getLightDiffuseColourWithPower(size_t index) const;
virtual const ColourValue getLightSpecularColourWithPower(size_t index) const;
virtual const Vector3& getLightPosition(size_t index) const;
virtual Vector4 getLightAs4DVector(size_t index) const;
virtual const Vector3& getLightDirection(size_t index) const;
virtual Real getLightPowerScale(size_t index) const;
virtual Vector4 getLightAttenuation(size_t index) const;
virtual Vector4 getSpotlightParams(size_t index) const;
virtual void setAmbientLightColour(const ColourValue& ambient);
virtual const ColourValue& getAmbientLightColour(void) const;
virtual const ColourValue& getSurfaceAmbientColour(void) const;
virtual const ColourValue& getSurfaceDiffuseColour(void) const;
virtual const ColourValue& getSurfaceSpecularColour(void) const;
virtual const ColourValue& getSurfaceEmissiveColour(void) const;
virtual Real getSurfaceShininess(void) const;
virtual Real getSurfaceAlphaRejectionValue(void) const;
virtual ColourValue getDerivedAmbientLightColour(void) const;
virtual ColourValue getDerivedSceneColour(void) const;
virtual void setFog(FogMode mode, const ColourValue& colour, Real expDensity, Real linearStart, Real linearEnd);
virtual const ColourValue& getFogColour(void) const;
virtual const Vector4& getFogParams(void) const;
virtual const Matrix4& getTextureViewProjMatrix(size_t index) const;
virtual const Matrix4& getTextureWorldViewProjMatrix(size_t index) const;
virtual const Matrix4& getSpotlightViewProjMatrix(size_t index) const;
virtual const Matrix4& getSpotlightWorldViewProjMatrix(size_t index) const;
virtual const Matrix4& getTextureTransformMatrix(size_t index) const;
virtual const RenderTarget* getCurrentRenderTarget(void) const;
virtual const Renderable* getCurrentRenderable(void) const;
virtual const Pass* getCurrentPass(void) const;
virtual Vector4 getTextureSize(size_t index) const;
virtual Vector4 getInverseTextureSize(size_t index) const;
virtual Vector4 getPackedTextureSize(size_t index) const;
virtual Real getShadowExtrusionDistance(void) const;
virtual const Vector4& getSceneDepthRange() const;
virtual const Vector4& getShadowSceneDepthRange(size_t index) const;
virtual const ColourValue& getShadowColour() const;
virtual Matrix4 getInverseViewProjMatrix(void) const;
virtual Matrix4 getInverseTransposeViewProjMatrix() const;
virtual Matrix4 getTransposeViewProjMatrix() const;
virtual Matrix4 getTransposeViewMatrix() const;
virtual Matrix4 getInverseTransposeViewMatrix() const;
virtual Matrix4 getTransposeProjectionMatrix() const;
virtual Matrix4 getInverseProjectionMatrix() const;
virtual Matrix4 getInverseTransposeProjectionMatrix() const;
virtual Matrix4 getTransposeWorldViewProjMatrix() const;
virtual Matrix4 getInverseWorldViewProjMatrix() const;
virtual Matrix4 getInverseTransposeWorldViewProjMatrix() const;
virtual Matrix4 getTransposeWorldViewMatrix() const;
virtual Matrix4 getTransposeWorldMatrix() const;
virtual Real getTime(void) const;
virtual Real getTime_0_X(Real x) const;
virtual Real getCosTime_0_X(Real x) const;
virtual Real getSinTime_0_X(Real x) const;
virtual Real getTanTime_0_X(Real x) const;
virtual Vector4 getTime_0_X_packed(Real x) const;
virtual Real getTime_0_1(Real x) const;
virtual Real getCosTime_0_1(Real x) const;
virtual Real getSinTime_0_1(Real x) const;
virtual Real getTanTime_0_1(Real x) const;
virtual Vector4 getTime_0_1_packed(Real x) const;
virtual Real getTime_0_2Pi(Real x) const;
virtual Real getCosTime_0_2Pi(Real x) const;
virtual Real getSinTime_0_2Pi(Real x) const;
virtual Real getTanTime_0_2Pi(Real x) const;
virtual Vector4 getTime_0_2Pi_packed(Real x) const;
virtual Real getFrameTime(void) const;
virtual Real getFPS() const;
virtual Real getViewportWidth() const;
virtual Real getViewportHeight() const;
virtual Real getInverseViewportWidth() const;
virtual Real getInverseViewportHeight() const;
virtual Vector3 getViewDirection() const;
virtual Vector3 getViewSideVector() const;
virtual Vector3 getViewUpVector() const;
virtual Real getFOV() const;
virtual Real getNearClipDistance() const;
virtual Real getFarClipDistance() const;
virtual int getPassNumber(void) const;
virtual void setPassNumber(const int passNumber);
virtual void incPassNumber(void);
virtual void updateLightCustomGpuParameter(const GpuProgramParameters::AutoConstantEntry& constantEntry, GpuProgramParameters *params) const;
};
}
#endif
OgreVector4.h
Ogre::RenderTarget
A &#39;canvas&#39; which can receive the results of a rendering operation.
Definition: OgreRenderTarget.h:65
Ogre::AutoParamDataSource::mBlankLight
Light mBlankLight
Definition: OgreAutoParamDataSource.h:127
Ogre::AutoParamDataSource::mSceneDepthRange
Vector4 mSceneDepthRange
Definition: OgreAutoParamDataSource.h:110
Ogre::FogMode
FogMode
Fog modes.
Definition: OgreCommon.h:121
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:63
Ogre::AutoParamDataSource::mWorldViewMatrix
Matrix4 mWorldViewMatrix
Definition: OgreAutoParamDataSource.h:67
Ogre::Pass
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::AutoParamDataSource::mInverseTransposeWorldViewMatrixDirty
bool mInverseTransposeWorldViewMatrixDirty
Definition: OgreAutoParamDataSource.h:98
Ogre::AutoParamDataSource::mInverseTransposeWorldMatrixDirty
bool mInverseTransposeWorldMatrixDirty
Definition: OgreAutoParamDataSource.h:97
Ogre::AutoParamDataSource::mInverseTransposeWorldViewMatrix
Matrix4 mInverseTransposeWorldViewMatrix
Definition: OgreAutoParamDataSource.h:74
Ogre::AutoParamDataSource::mCurrentLightList
const LightList * mCurrentLightList
Definition: OgreAutoParamDataSource.h:119
Ogre::Vector4
4-dimensional homogeneous vector.
Definition: OgreVector4.h:45
Ogre::AutoParamDataSource::hasLightList
virtual bool hasLightList() const
Definition: OgreAutoParamDataSource.h:173
Ogre::AutoParamDataSource::mLodCameraPositionObjectSpace
Vector4 mLodCameraPositionObjectSpace
Definition: OgreAutoParamDataSource.h:86
Ogre::AutoParamDataSource::mViewProjMatrix
Matrix4 mViewProjMatrix
Definition: OgreAutoParamDataSource.h:68
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::AutoParamDataSource::mCurrentViewport
const Viewport * mCurrentViewport
Definition: OgreAutoParamDataSource.h:122
Ogre::AutoParamDataSource::mLodCameraPositionObjectSpaceDirty
bool mLodCameraPositionObjectSpaceDirty
Definition: OgreAutoParamDataSource.h:113
Ogre::AutoParamDataSource::mSceneDepthRangeDirty
bool mSceneDepthRangeDirty
Definition: OgreAutoParamDataSource.h:111
Ogre::GpuProgramParameters::AutoConstantEntry
Structure recording the use of an automatic parameter.
Definition: OgreGpuProgramParams.h:1215
Ogre::AutoParamDataSource::mCurrentCamera
const Camera * mCurrentCamera
Definition: OgreAutoParamDataSource.h:116
Ogre::AutoParamDataSource::mAmbientLight
ColourValue mAmbientLight
Definition: OgreAutoParamDataSource.h:106
Ogre::AutoParamDataSource::mWorldViewProjMatrix
Matrix4 mWorldViewProjMatrix
Definition: OgreAutoParamDataSource.h:69
Ogre::Viewport
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
Ogre::AutoParamDataSource::mCurrentPass
const Pass * mCurrentPass
Definition: OgreAutoParamDataSource.h:125
OGRE_MAX_SIMULTANEOUS_LIGHTS
#define OGRE_MAX_SIMULTANEOUS_LIGHTS
Define max number of lights allowed per pass.
Definition: OgreConfig.h:76
Ogre::AutoParamDataSource::mMainCamBoundsInfo
const VisibleObjectsBoundsInfo * mMainCamBoundsInfo
Definition: OgreAutoParamDataSource.h:124
Ogre::AutoParamDataSource::mInverseViewMatrixDirty
bool mInverseViewMatrixDirty
Definition: OgreAutoParamDataSource.h:96
Ogre::AutoParamDataSource::mInverseWorldMatrixDirty
bool mInverseWorldMatrixDirty
Definition: OgreAutoParamDataSource.h:94
OgreCommon.h
Ogre::AutoParamDataSource::mCurrentRenderTarget
const RenderTarget * mCurrentRenderTarget
Definition: OgreAutoParamDataSource.h:121
Ogre::AutoParamDataSource::mViewProjMatrixDirty
bool mViewProjMatrixDirty
Definition: OgreAutoParamDataSource.h:92
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::AutoParamDataSource::mInverseTransposeWorldMatrix
Matrix4 mInverseTransposeWorldMatrix
Definition: OgreAutoParamDataSource.h:73
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::AutoParamDataSource::mViewMatrix
Matrix4 mViewMatrix
Definition: OgreAutoParamDataSource.h:82
Ogre::AutoParamDataSource::mWorldMatrixArray
const Matrix4 * mWorldMatrixArray
Definition: OgreAutoParamDataSource.h:66
Ogre::AutoParamDataSource::mCameraRelativeRendering
bool mCameraRelativeRendering
Definition: OgreAutoParamDataSource.h:117
OgrePrerequisites.h
Ogre::AutoParamDataSource::mCameraPositionObjectSpace
Vector4 mCameraPositionObjectSpace
Definition: OgreAutoParamDataSource.h:76
Ogre::AutoParamDataSource::mCameraRelativePosition
Vector3 mCameraRelativePosition
Definition: OgreAutoParamDataSource.h:118
Ogre::HashedVector
A hashed vector.
Definition: OgreCommon.h:332
Ogre::AutoParamDataSource::mInverseWorldMatrix
Matrix4 mInverseWorldMatrix
Definition: OgreAutoParamDataSource.h:70
Ogre::AutoParamDataSource::mInverseWorldViewMatrixDirty
bool mInverseWorldViewMatrixDirty
Definition: OgreAutoParamDataSource.h:95
Ogre::AutoParamDataSource::mWorldMatrixDirty
bool mWorldMatrixDirty
Definition: OgreAutoParamDataSource.h:88
Ogre::AutoParamDataSource::mFogColour
ColourValue mFogColour
Definition: OgreAutoParamDataSource.h:107
Ogre::VisibleObjectsBoundsInfo
Structure collecting together information about the visible objects that have been discovered in a sc...
Definition: OgreSceneManager.h:86
Ogre::AutoParamDataSource::mWorldMatrixCount
size_t mWorldMatrixCount
Definition: OgreAutoParamDataSource.h:65
OgreMatrix4.h
Ogre::AutoParamDataSource::mViewMatrixDirty
bool mViewMatrixDirty
Definition: OgreAutoParamDataSource.h:89
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::AutoParamDataSource::mCameraPositionDirty
bool mCameraPositionDirty
Definition: OgreAutoParamDataSource.h:99
Ogre::AutoParamDataSource::mCameraPosition
Vector4 mCameraPosition
Definition: OgreAutoParamDataSource.h:75
Ogre::AutoParamDataSource::mLodCameraPositionDirty
bool mLodCameraPositionDirty
Definition: OgreAutoParamDataSource.h:112
Ogre::AutoParamDataSource::mCurrentSceneManager
const SceneManager * mCurrentSceneManager
Definition: OgreAutoParamDataSource.h:123
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::AutoParamDataSource::mFogParams
Vector4 mFogParams
Definition: OgreAutoParamDataSource.h:108
Ogre::AutoParamDataSource::mLodCameraPosition
Vector4 mLodCameraPosition
Definition: OgreAutoParamDataSource.h:85
OgreColourValue.h
Ogre::AutoParamDataSource::mWorldViewMatrixDirty
bool mWorldViewMatrixDirty
Definition: OgreAutoParamDataSource.h:91
Ogre::AutoParamDataSource::mInverseWorldViewMatrix
Matrix4 mInverseWorldViewMatrix
Definition: OgreAutoParamDataSource.h:71
Ogre::AutoParamDataSource::mPassNumber
int mPassNumber
Definition: OgreAutoParamDataSource.h:109
Ogre::AutoParamDataSource::mDirLightExtrusionDistance
Real mDirLightExtrusionDistance
Definition: OgreAutoParamDataSource.h:84
Ogre::AutoParamDataSource
This utility class is used to hold the information used to generate the matrices and other informatio...
Definition: OgreAutoParamDataSource.h:60
Ogre::Frustum
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:85
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::AutoParamDataSource::mWorldViewProjMatrixDirty
bool mWorldViewProjMatrixDirty
Definition: OgreAutoParamDataSource.h:93
Ogre::AutoParamDataSource::mCurrentRenderable
const Renderable * mCurrentRenderable
Definition: OgreAutoParamDataSource.h:115
Ogre::Light
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
OgreLight.h
Ogre::AutoParamDataSource::mCameraPositionObjectSpaceDirty
bool mCameraPositionObjectSpaceDirty
Definition: OgreAutoParamDataSource.h:100
Ogre::GpuProgramParameters
Collects together the program parameters used for a GpuProgram.
Definition: OgreGpuProgramParams.h:702
Ogre::AutoParamDataSource::mProjectionMatrix
Matrix4 mProjectionMatrix
Definition: OgreAutoParamDataSource.h:83
Ogre::AutoParamDataSource::mProjMatrixDirty
bool mProjMatrixDirty
Definition: OgreAutoParamDataSource.h:90
Ogre::AutoParamDataSource::mInverseViewMatrix
Matrix4 mInverseViewMatrix
Definition: OgreAutoParamDataSource.h:72

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.