# OgreAutoParamDataSource.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org
    00006
    00007 Copyright (c) 2000-2006 Torus Knot Software Ltd
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023
    00024 You may alternatively use this source under the terms of a specific version of
    00025 the OGRE Unrestricted License provided you have obtained such a license from
    00026 Torus Knot Software Ltd.
    00027 -----------------------------------------------------------------------------
    00028 */
    00029 #ifndef __AutoParamDataSource_H_
    00030 #define __AutoParamDataSource_H_
    00031
    00032 #include "OgrePrerequisites.h"
    00033 #include "OgreCommon.h"
    00034 #include "OgreMatrix4.h"
    00035 #include "OgreVector4.h"
    00036 #include "OgreLight.h"
    00037 #include "OgreColourValue.h"
    00038
    00039 namespace Ogre {
    00040
    00041     // forward decls
    00042     struct VisibleObjectsBoundsInfo;
    00043
    00044
    00055     class _OgreExport AutoParamDataSource : public SceneMgtAlloc
    00056     {
    00057     protected:
    00058         const Light& getLight(size_t index) const;
    00059         mutable Matrix4 mWorldMatrix[256];
    00060         mutable size_t mWorldMatrixCount;
    00061         mutable const Matrix4* mWorldMatrixArray;
    00062         mutable Matrix4 mWorldViewMatrix;
    00063         mutable Matrix4 mViewProjMatrix;
    00064         mutable Matrix4 mWorldViewProjMatrix;
    00065         mutable Matrix4 mInverseWorldMatrix;
    00066         mutable Matrix4 mInverseWorldViewMatrix;
    00067         mutable Matrix4 mInverseViewMatrix;
    00068         mutable Matrix4 mInverseTransposeWorldMatrix;
    00069         mutable Matrix4 mInverseTransposeWorldViewMatrix;
    00070         mutable Vector4 mCameraPosition;
    00071         mutable Vector4 mCameraPositionObjectSpace;
    00072         mutable Matrix4 mTextureViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00073         mutable Matrix4 mTextureWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00074         mutable Matrix4 mSpotlightViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00075         mutable Matrix4 mSpotlightWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00076         mutable Vector4 mShadowCamDepthRanges[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00077         mutable Matrix4 mViewMatrix;
    00078         mutable Matrix4 mProjectionMatrix;
    00079         mutable Real mDirLightExtrusionDistance;
    00080         mutable Vector4 mLodCameraPosition;
    00081         mutable Vector4 mLodCameraPositionObjectSpace;
    00082
    00083         mutable bool mWorldMatrixDirty;
    00084         mutable bool mViewMatrixDirty;
    00085         mutable bool mProjMatrixDirty;
    00086         mutable bool mWorldViewMatrixDirty;
    00087         mutable bool mViewProjMatrixDirty;
    00088         mutable bool mWorldViewProjMatrixDirty;
    00089         mutable bool mInverseWorldMatrixDirty;
    00090         mutable bool mInverseWorldViewMatrixDirty;
    00091         mutable bool mInverseViewMatrixDirty;
    00092         mutable bool mInverseTransposeWorldMatrixDirty;
    00093         mutable bool mInverseTransposeWorldViewMatrixDirty;
    00094         mutable bool mCameraPositionDirty;
    00095         mutable bool mCameraPositionObjectSpaceDirty;
    00096         mutable bool mTextureViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00097         mutable bool mTextureWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00098         mutable bool mSpotlightViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00099         mutable bool mSpotlightWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00100         mutable bool mShadowCamDepthRangesDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00101         mutable ColourValue mAmbientLight;
    00102         mutable ColourValue mFogColour;
    00103         mutable Vector4 mFogParams;
    00104         mutable int mPassNumber;
    00105         mutable Vector4 mSceneDepthRange;
    00106         mutable bool mSceneDepthRangeDirty;
    00107         mutable bool mLodCameraPositionDirty;
    00108         mutable bool mLodCameraPositionObjectSpaceDirty;
    00109
    00110         const Renderable* mCurrentRenderable;
    00111         const Camera* mCurrentCamera;
    00112         bool mCameraRelativeRendering;
    00113         Vector3 mCameraRelativePosition;
    00114         const LightList* mCurrentLightList;
    00115         const Frustum* mCurrentTextureProjector[OGRE_MAX_SIMULTANEOUS_LIGHTS];
    00116         const RenderTarget* mCurrentRenderTarget;
    00117         const Viewport* mCurrentViewport;
    00118         const SceneManager* mCurrentSceneManager;
    00119         const VisibleObjectsBoundsInfo* mMainCamBoundsInfo;
    00120         const Pass* mCurrentPass;
    00121
    00122         Light mBlankLight;
    00123     public:
    00124         AutoParamDataSource();
    00125         virtual ~AutoParamDataSource();
    00127         virtual void setCurrentRenderable(const Renderable* rend);
    00129         virtual void setWorldMatrices(const Matrix4* m, size_t count);
    00131         virtual void setCurrentCamera(const Camera* cam, bool useCameraRelative);
    00133         virtual void setCurrentLightList(const LightList* ll);
    00135         virtual void setTextureProjector(const Frustum* frust, size_t index);
    00137         virtual void setCurrentRenderTarget(const RenderTarget* target);
    00139         virtual void setCurrentViewport(const Viewport* viewport);
    00141         virtual void setShadowDirLightExtrusionDistance(Real dist);
    00143         virtual void setMainCamBoundsInfo(VisibleObjectsBoundsInfo* info);
    00145         virtual void setCurrentSceneManager(const SceneManager* sm);
    00147         virtual void setCurrentPass(const Pass* pass);
    00148
    00149
    00150
    00151         virtual const Matrix4& getWorldMatrix(void) const;
    00152         virtual const Matrix4* getWorldMatrixArray(void) const;
    00153         virtual size_t getWorldMatrixCount(void) const;
    00154         virtual const Matrix4& getViewMatrix(void) const;
    00155         virtual const Matrix4& getViewProjectionMatrix(void) const;
    00156         virtual const Matrix4& getProjectionMatrix(void) const;
    00157         virtual const Matrix4& getWorldViewProjMatrix(void) const;
    00158         virtual const Matrix4& getWorldViewMatrix(void) const;
    00159         virtual const Matrix4& getInverseWorldMatrix(void) const;
    00160         virtual const Matrix4& getInverseWorldViewMatrix(void) const;
    00161         virtual const Matrix4& getInverseViewMatrix(void) const;
    00162         virtual const Matrix4& getInverseTransposeWorldMatrix(void) const;
    00163         virtual const Matrix4& getInverseTransposeWorldViewMatrix(void) const;
    00164         virtual const Vector4& getCameraPosition(void) const;
    00165         virtual const Vector4& getCameraPositionObjectSpace(void) const;
    00166         virtual const Vector4& getLodCameraPosition(void) const;
    00167         virtual const Vector4& getLodCameraPositionObjectSpace(void) const;
    00169         virtual float getLightNumber(size_t index) const;
    00170         virtual float getLightCount() const;
    00171         virtual float getLightCastsShadows(size_t index) const;
    00172         virtual const ColourValue& getLightDiffuseColour(size_t index) const;
    00173         virtual const ColourValue& getLightSpecularColour(size_t index) const;
    00174         virtual const ColourValue getLightDiffuseColourWithPower(size_t index) const;
    00175         virtual const ColourValue getLightSpecularColourWithPower(size_t index) const;
    00176         virtual const Vector3& getLightPosition(size_t index) const;
    00177         virtual Vector4 getLightAs4DVector(size_t index) const;
    00178         virtual const Vector3& getLightDirection(size_t index) const;
    00179         virtual Real getLightPowerScale(size_t index) const;
    00180         virtual Vector4 getLightAttenuation(size_t index) const;
    00181         virtual Vector4 getSpotlightParams(size_t index) const;
    00182         virtual void setAmbientLightColour(const ColourValue& ambient);
    00183         virtual const ColourValue& getAmbientLightColour(void) const;
    00184         virtual const ColourValue& getSurfaceAmbientColour(void) const;
    00185         virtual const ColourValue& getSurfaceDiffuseColour(void) const;
    00186         virtual const ColourValue& getSurfaceSpecularColour(void) const;
    00187         virtual const ColourValue& getSurfaceEmissiveColour(void) const;
    00188         virtual Real getSurfaceShininess(void) const;
    00189         virtual ColourValue getDerivedAmbientLightColour(void) const;
    00190         virtual ColourValue getDerivedSceneColour(void) const;
    00191         virtual void setFog(FogMode mode, const ColourValue& colour, Real expDensity, Real linearStart, Real linearEnd);
    00192         virtual const ColourValue& getFogColour(void) const;
    00193         virtual const Vector4& getFogParams(void) const;
    00194         virtual const Matrix4& getTextureViewProjMatrix(size_t index) const;
    00195         virtual const Matrix4& getTextureWorldViewProjMatrix(size_t index) const;
    00196         virtual const Matrix4& getSpotlightViewProjMatrix(size_t index) const;
    00197         virtual const Matrix4& getSpotlightWorldViewProjMatrix(size_t index) const;
    00198         virtual const Matrix4& getTextureTransformMatrix(size_t index) const;
    00199         virtual const RenderTarget* getCurrentRenderTarget(void) const;
    00200         virtual const Renderable* getCurrentRenderable(void) const;
    00201         virtual const Pass* getCurrentPass(void) const;
    00202         virtual Vector4 getTextureSize(size_t index) const;
    00203         virtual Vector4 getInverseTextureSize(size_t index) const;
    00204         virtual Vector4 getPackedTextureSize(size_t index) const;
    00205         virtual Real getShadowExtrusionDistance(void) const;
    00206         virtual const Vector4& getSceneDepthRange() const;
    00207         virtual const Vector4& getShadowSceneDepthRange(size_t index) const;
    00208         virtual const ColourValue& getShadowColour() const;
    00209         virtual Matrix4 getInverseViewProjMatrix(void) const;
    00210         virtual Matrix4 getInverseTransposeViewProjMatrix() const;
    00211         virtual Matrix4 getTransposeViewProjMatrix() const;
    00212         virtual Matrix4 getTransposeViewMatrix() const;
    00213         virtual Matrix4 getInverseTransposeViewMatrix() const;
    00214         virtual Matrix4 getTransposeProjectionMatrix() const;
    00215         virtual Matrix4 getInverseProjectionMatrix() const;
    00216         virtual Matrix4 getInverseTransposeProjectionMatrix() const;
    00217         virtual Matrix4 getTransposeWorldViewProjMatrix() const;
    00218         virtual Matrix4 getInverseWorldViewProjMatrix() const;
    00219         virtual Matrix4 getInverseTransposeWorldViewProjMatrix() const;
    00220         virtual Matrix4 getTransposeWorldViewMatrix() const;
    00221         virtual Matrix4 getTransposeWorldMatrix() const;
    00222         virtual Real getTime(void) const;
    00223         virtual Real getTime_0_X(Real x) const;
    00224         virtual Real getCosTime_0_X(Real x) const;
    00225         virtual Real getSinTime_0_X(Real x) const;
    00226         virtual Real getTanTime_0_X(Real x) const;
    00227         virtual Vector4 getTime_0_X_packed(Real x) const;
    00228         virtual Real getTime_0_1(Real x) const;
    00229         virtual Real getCosTime_0_1(Real x) const;
    00230         virtual Real getSinTime_0_1(Real x) const;
    00231         virtual Real getTanTime_0_1(Real x) const;
    00232         virtual Vector4 getTime_0_1_packed(Real x) const;
    00233         virtual Real getTime_0_2Pi(Real x) const;
    00234         virtual Real getCosTime_0_2Pi(Real x) const;
    00235         virtual Real getSinTime_0_2Pi(Real x) const;
    00236         virtual Real getTanTime_0_2Pi(Real x) const;
    00237         virtual Vector4 getTime_0_2Pi_packed(Real x) const;
    00238         virtual Real getFrameTime(void) const;
    00239         virtual Real getFPS() const;
    00240         virtual Real getViewportWidth() const;
    00241         virtual Real getViewportHeight() const;
    00242         virtual Real getInverseViewportWidth() const;
    00243         virtual Real getInverseViewportHeight() const;
    00244         virtual Vector3 getViewDirection() const;
    00245         virtual Vector3 getViewSideVector() const;
    00246         virtual Vector3 getViewUpVector() const;
    00247         virtual Real getFOV() const;
    00248         virtual Real getNearClipDistance() const;
    00249         virtual Real getFarClipDistance() const;
    00250         virtual int getPassNumber(void) const;
    00251         virtual void setPassNumber(const int passNumber);
    00252         virtual void incPassNumber(void);
    00253     };
    00254 }
    00255
    00256 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:46:39 2009