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 const Viewport* mCurrentViewport; 00087 00088 Light mBlankLight; 00089 public: 00090 AutoParamDataSource(); 00091 ~AutoParamDataSource(); 00093 void setCurrentRenderable(const Renderable* rend); 00095 void setCurrentCamera(const Camera* cam); 00097 void setCurrentLightList(const LightList* ll); 00099 void setTextureProjector(const Frustum* frust); 00101 void setCurrentRenderTarget(const RenderTarget* target); 00103 void setCurrentViewport(const Viewport* viewport); 00105 void setShadowDirLightExtrusionDistance(Real dist); 00106 00107 const Matrix4& getWorldMatrix(void) const; 00108 const Matrix4* getWorldMatrixArray(void) const; 00109 size_t getWorldMatrixCount(void) const; 00110 const Matrix4& getViewMatrix(void) const; 00111 const Matrix4& getViewProjectionMatrix(void) const; 00112 const Matrix4& getProjectionMatrix(void) const; 00113 const Matrix4& getWorldViewProjMatrix(void) const; 00114 const Matrix4& getWorldViewMatrix(void) const; 00115 const Matrix4& getInverseWorldMatrix(void) const; 00116 const Matrix4& getInverseWorldViewMatrix(void) const; 00117 const Matrix4& getInverseViewMatrix(void) const; 00118 const Matrix4& getInverseTransposeWorldMatrix(void) const; 00119 const Matrix4& getInverseTransposeWorldViewMatrix(void) const; 00120 const Vector4& getCameraPosition(void) const; 00121 const Vector4& getCameraPositionObjectSpace(void) const; 00123 const Light& getLight(size_t index) const; 00124 void setAmbientLightColour(const ColourValue& ambient); 00125 const ColourValue& getAmbientLightColour(void) const; 00126 const Matrix4& getTextureViewProjMatrix(void) const; 00127 const RenderTarget* getCurrentRenderTarget(void) const; 00128 const Renderable* getCurrentRenderable(void) const; 00129 Real getShadowExtrusionDistance(void) const; 00130 Matrix4 getInverseViewProjMatrix(void) const; 00131 Matrix4 getInverseTransposeViewProjMatrix() const; 00132 Matrix4 getTransposeViewProjMatrix() const; 00133 Matrix4 getTransposeViewMatrix() const; 00134 Matrix4 getTransposeProjectionMatrix() const; 00135 Matrix4 getInverseProjectionMatrix() const; 00136 Matrix4 getInverseTransposeProjectionMatrix() const; 00137 Matrix4 getTransposeWorldViewProjMatrix() const; 00138 Matrix4 getInverseWorldViewProjMatrix() const; 00139 Matrix4 getInverseTransposeWorldViewProjMatrix() const; 00140 Matrix4 getTransposeWorldViewMatrix() const; 00141 Matrix4 getTransposeWorldMatrix() const; 00142 Real getTime(void) const; 00143 Real getTime_0_X(Real x) const; 00144 Real getCosTime_0_X(Real x) const; 00145 Real getSinTime_0_X(Real x) const; 00146 Real getTanTime_0_X(Real x) const; 00147 Vector4 getTime_0_X_packed(Real x) const; 00148 Real getTime_0_1(Real x) const; 00149 Real getCosTime_0_1(Real x) const; 00150 Real getSinTime_0_1(Real x) const; 00151 Real getTanTime_0_1(Real x) const; 00152 Vector4 getTime_0_1_packed(Real x) const; 00153 Real getTime_0_2Pi(Real x) const; 00154 Real getCosTime_0_2Pi(Real x) const; 00155 Real getSinTime_0_2Pi(Real x) const; 00156 Real getTanTime_0_2Pi(Real x) const; 00157 Vector4 getTime_0_2Pi_packed(Real x) const; 00158 Real getFPS() const; 00159 Real getViewportWidth() const; 00160 Real getViewportHeight() const; 00161 Real getInverseViewportWidth() const; 00162 Real getInverseViewportHeight() const; 00163 Vector3 getViewDirection() const; 00164 Vector3 getViewSideVector() const; 00165 Vector3 getViewUpVector() const; 00166 Real getFOV() const; 00167 Real getNearClipDistance() const; 00168 Real getFarClipDistance() const; 00169 }; 00170 } 00171 00172 #endif
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:41 2006