# 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://ogre.sourceforge.net/
    00006
    00007 Copyright (c) 2000-2005 The OGRE Team
    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 */
    00025 #ifndef __AutoParamDataSource_H_
    00026 #define __AutoParamDataSource_H_
    00027
    00028 #include "OgrePrerequisites.h"
    00029 #include "OgreCommon.h"
    00030 #include "OgreMatrix4.h"
    00031 #include "OgreVector4.h"
    00032 #include "OgreLight.h"
    00033 #include "OgreColourValue.h"
    00034
    00035 namespace Ogre {
    00036
    00037
    00048     class _OgreExport AutoParamDataSource
    00049     {
    00050     protected:
    00051         mutable Matrix4 mWorldMatrix[256];
    00052         mutable size_t mWorldMatrixCount;
    00053         mutable Matrix4 mWorldViewMatrix;
    00054         mutable Matrix4 mViewProjMatrix;
    00055         mutable Matrix4 mWorldViewProjMatrix;
    00056         mutable Matrix4 mInverseWorldMatrix;
    00057         mutable Matrix4 mInverseWorldViewMatrix;
    00058         mutable Matrix4 mInverseViewMatrix;
    00059         mutable Matrix4 mInverseTransposeWorldMatrix;
    00060         mutable Matrix4 mInverseTransposeWorldViewMatrix;
    00061         mutable Vector4 mCameraPositionObjectSpace;
    00062         mutable Matrix4 mTextureViewProjMatrix;
    00063         mutable Matrix4 mProjectionMatrix;
    00064         mutable Real mDirLightExtrusionDistance;
    00065         mutable Vector4 mCameraPosition;
    00066
    00067         mutable bool mWorldMatrixDirty;
    00068         mutable bool mWorldViewMatrixDirty;
    00069         mutable bool mViewProjMatrixDirty;
    00070         mutable bool mWorldViewProjMatrixDirty;
    00071         mutable bool mInverseWorldMatrixDirty;
    00072         mutable bool mInverseWorldViewMatrixDirty;
    00073         mutable bool mInverseViewMatrixDirty;
    00074         mutable bool mInverseTransposeWorldMatrixDirty;
    00075         mutable bool mInverseTransposeWorldViewMatrixDirty;
    00076         mutable bool mCameraPositionObjectSpaceDirty;
    00077         mutable bool mCameraPositionDirty;
    00078         mutable bool mTextureViewProjMatrixDirty;
    00079         mutable ColourValue mAmbientLight;
    00080
    00081         const Renderable* mCurrentRenderable;
    00082         const Camera* mCurrentCamera;
    00083         const LightList* mCurrentLightList;
    00084         const Frustum* mCurrentTextureProjector;
    00085         const RenderTarget* mCurrentRenderTarget;
    00086
    00087         Light mBlankLight;
    00088     public:
    00089         AutoParamDataSource();
    00090         ~AutoParamDataSource();
    00092         void setCurrentRenderable(const Renderable* rend);
    00094         void setCurrentCamera(const Camera* cam);
    00096         void setCurrentLightList(const LightList* ll);
    00098         void setTextureProjector(const Frustum* frust);
    00100         void setCurrentRenderTarget(const RenderTarget* target);
    00102         void setShadowDirLightExtrusionDistance(Real dist);
    00103
    00104         const Matrix4& getWorldMatrix(void) const;
    00105         const Matrix4* getWorldMatrixArray(void) const;
    00106         size_t getWorldMatrixCount(void) const;
    00107         const Matrix4& getViewMatrix(void) const;
    00108         const Matrix4& getViewProjectionMatrix(void) const;
    00109         const Matrix4& getProjectionMatrix(void) const;
    00110         const Matrix4& getWorldViewProjMatrix(void) const;
    00111         const Matrix4& getWorldViewMatrix(void) const;
    00112         const Matrix4& getInverseWorldMatrix(void) const;
    00113         const Matrix4& getInverseWorldViewMatrix(void) const;
    00114         const Matrix4& getInverseViewMatrix(void) const;
    00115         const Matrix4& getInverseTransposeWorldMatrix(void) const;
    00116         const Matrix4& getInverseTransposeWorldViewMatrix(void) const;
    00117         const Vector4& getCameraPosition(void) const;
    00118         const Vector4& getCameraPositionObjectSpace(void) const;
    00120         const Light& getLight(size_t index) const;
    00121         void setAmbientLightColour(const ColourValue& ambient);
    00122         const ColourValue& getAmbientLightColour(void) const;
    00123         const Matrix4& getTextureViewProjMatrix(void) const;
    00124         const RenderTarget* getCurrentRenderTarget(void) const;
    00125         const Renderable* getCurrentRenderable(void) const;
    00126         Real getShadowExtrusionDistance(void) const;
    00127         Matrix4 getInverseViewProjMatrix(void) const;
    00128         Matrix4 getInverseTransposeViewProjMatrix() const;
    00129         Matrix4 getTransposeViewProjMatrix() const;
    00130         Matrix4 getTransposeViewMatrix() const;
    00131         Matrix4 getTransposeProjectionMatrix() const;
    00132         Matrix4 getInverseProjectionMatrix() const;
    00133         Matrix4 getInverseTransposeProjectionMatrix() const;
    00134         Matrix4 getTransposeWorldViewProjMatrix() const;
    00135         Matrix4 getInverseWorldViewProjMatrix() const;
    00136         Matrix4 getInverseTransposeWorldViewProjMatrix() const;
    00137         Matrix4 getTransposeWorldViewMatrix() const;
    00138         Matrix4 getTransposeWorldMatrix() const;
    00139         Real getTime(void) const;
    00140         Real getTime_0_X(Real x) const;
    00141         Real getCosTime_0_X(Real x) const;
    00142         Real getSinTime_0_X(Real x) const;
    00143         Real getTanTime_0_X(Real x) const;
    00144         Vector4 getTime_0_X_packed(Real x) const;
    00145         Real getTime_0_1(Real x) const;
    00146         Real getCosTime_0_1(Real x) const;
    00147         Real getSinTime_0_1(Real x) const;
    00148         Real getTanTime_0_1(Real x) const;
    00149         Vector4 getTime_0_1_packed(Real x) const;
    00150         Real getTime_0_2Pi(Real x) const;
    00151         Real getCosTime_0_2Pi(Real x) const;
    00152         Real getSinTime_0_2Pi(Real x) const;
    00153         Real getTanTime_0_2Pi(Real x) const;
    00154         Vector4 getTime_0_2Pi_packed(Real x) const;
    00155         Real getFPS() const;
    00156         Real getViewportWidth() const;
    00157         Real getViewportHeight() const;
    00158         Real getInverseViewportWidth() const;
    00159         Real getInverseViewportHeight() const;
    00160         Vector3 getViewDirection() const;
    00161         Vector3 getViewSideVector() const;
    00162         Vector3 getViewUpVector() const;
    00163         Real getFOV() const;
    00164         Real getNearClipDistance() const;
    00165         Real getFarClipDistance() const;
    00166     };
    00167 }
    00168
    00169 #endif

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Nov 20 12:35:56 2005