Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 © 2000-2003 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 Matrix4 mWorldViewMatrix;
00053         mutable Matrix4 mWorldViewProjMatrix;
00054         mutable Matrix4 mInverseWorldMatrix;
00055         mutable Matrix4 mInverseWorldViewMatrix;
00056         mutable Matrix4 mInverseViewMatrix;
00057         mutable Vector4 mCameraPositionObjectSpace;
00058 
00059         mutable bool mWorldMatrixDirty;
00060         mutable bool mWorldViewMatrixDirty;
00061         mutable bool mWorldViewProjMatrixDirty;
00062         mutable bool mInverseWorldMatrixDirty;
00063         mutable bool mInverseWorldViewMatrixDirty;
00064         mutable bool mInverseViewMatrixDirty;
00065         mutable bool mCameraPositionObjectSpaceDirty;
00066         mutable ColourValue mAmbientLight;
00067 
00068         const Renderable* mCurrentRenderable;
00069         const Camera* mCurrentCamera;
00070         const LightList* mCurrentLightList;
00071 
00072         Light mBlankLight;
00073     public:
00074         AutoParamDataSource();
00075         ~AutoParamDataSource();
00077         void setCurrentRenderable(const Renderable* rend);
00079         void setCurrentCamera(const Camera* cam);
00081         void setCurrentLightList(const LightList* ll);
00082 
00083         const Matrix4& getWorldMatrix(void) const;
00084         const Matrix4& getViewMatrix(void) const;
00085         const Matrix4& getProjectionMatrix(void) const;
00086         const Matrix4& getWorldViewProjMatrix(void) const;
00087         const Matrix4& getWorldViewMatrix(void) const;
00088         const Matrix4& getInverseWorldMatrix(void) const;
00089         const Matrix4& getInverseWorldViewMatrix(void) const;
00090         const Matrix4& getInverseViewMatrix(void) const;
00091         const Vector4& getCameraPositionObjectSpace(void) const;
00093         const Light& getLight(size_t index) const;
00094         void setAmbientLightColour(const ColourValue& ambient);
00095         const ColourValue& getAmbientLightColour(void) const;
00096 
00097 
00098     };
00099 }
00100 
00101 #endif

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