OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreAutoParamDataSource.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __AutoParamDataSource_H_
29 #define __AutoParamDataSource_H_
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreCommon.h"
33 #include "OgreMatrix4.h"
34 #include "OgreVector4.h"
35 #include "OgreLight.h"
36 #include "OgreColourValue.h"
37 
38 namespace Ogre {
39 
40  // forward decls
41  struct VisibleObjectsBoundsInfo;
61  {
62  protected:
63  const Light& getLight(size_t index) const;
64  mutable Matrix4 mWorldMatrix[256];
65  mutable size_t mWorldMatrixCount;
66  mutable const Matrix4* mWorldMatrixArray;
77  mutable Matrix4 mTextureViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
78  mutable Matrix4 mTextureWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
79  mutable Matrix4 mSpotlightViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
80  mutable Matrix4 mSpotlightWorldViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
81  mutable Vector4 mShadowCamDepthRanges[OGRE_MAX_SIMULTANEOUS_LIGHTS];
87 
88  mutable bool mWorldMatrixDirty;
89  mutable bool mViewMatrixDirty;
90  mutable bool mProjMatrixDirty;
91  mutable bool mWorldViewMatrixDirty;
92  mutable bool mViewProjMatrixDirty;
99  mutable bool mCameraPositionDirty;
101  mutable bool mTextureViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
102  mutable bool mTextureWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
103  mutable bool mSpotlightViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
104  mutable bool mSpotlightWorldViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
105  mutable bool mShadowCamDepthRangesDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
109  mutable int mPassNumber;
111  mutable bool mSceneDepthRangeDirty;
114 
120  const Frustum* mCurrentTextureProjector[OGRE_MAX_SIMULTANEOUS_LIGHTS];
126 
128  public:
130  virtual ~AutoParamDataSource();
132  virtual void setCurrentRenderable(const Renderable* rend);
134  virtual void setWorldMatrices(const Matrix4* m, size_t count);
136  virtual void setCurrentCamera(const Camera* cam, bool useCameraRelative);
138  virtual void setCurrentLightList(const LightList* ll);
140  virtual void setTextureProjector(const Frustum* frust, size_t index);
142  virtual void setCurrentRenderTarget(const RenderTarget* target);
144  virtual void setCurrentViewport(const Viewport* viewport);
146  virtual void setShadowDirLightExtrusionDistance(Real dist);
148  virtual void setMainCamBoundsInfo(VisibleObjectsBoundsInfo* info);
150  virtual void setCurrentSceneManager(const SceneManager* sm);
152  virtual void setCurrentPass(const Pass* pass);
153 
154 
155 
156  virtual const Matrix4& getWorldMatrix(void) const;
157  virtual const Matrix4* getWorldMatrixArray(void) const;
158  virtual size_t getWorldMatrixCount(void) const;
159  virtual const Matrix4& getViewMatrix(void) const;
160  virtual const Matrix4& getViewProjectionMatrix(void) const;
161  virtual const Matrix4& getProjectionMatrix(void) const;
162  virtual const Matrix4& getWorldViewProjMatrix(void) const;
163  virtual const Matrix4& getWorldViewMatrix(void) const;
164  virtual const Matrix4& getInverseWorldMatrix(void) const;
165  virtual const Matrix4& getInverseWorldViewMatrix(void) const;
166  virtual const Matrix4& getInverseViewMatrix(void) const;
167  virtual const Matrix4& getInverseTransposeWorldMatrix(void) const;
168  virtual const Matrix4& getInverseTransposeWorldViewMatrix(void) const;
169  virtual const Vector4& getCameraPosition(void) const;
170  virtual const Vector4& getCameraPositionObjectSpace(void) const;
171  virtual const Vector4& getLodCameraPosition(void) const;
172  virtual const Vector4& getLodCameraPositionObjectSpace(void) const;
173  virtual bool hasLightList() const { return mCurrentLightList != 0; }
175  virtual float getLightNumber(size_t index) const;
176  virtual float getLightCount() const;
177  virtual float getLightCastsShadows(size_t index) const;
178  virtual const ColourValue& getLightDiffuseColour(size_t index) const;
179  virtual const ColourValue& getLightSpecularColour(size_t index) const;
180  virtual const ColourValue getLightDiffuseColourWithPower(size_t index) const;
181  virtual const ColourValue getLightSpecularColourWithPower(size_t index) const;
182  virtual const Vector3& getLightPosition(size_t index) const;
183  virtual Vector4 getLightAs4DVector(size_t index) const;
184  virtual const Vector3& getLightDirection(size_t index) const;
185  virtual Real getLightPowerScale(size_t index) const;
186  virtual Vector4 getLightAttenuation(size_t index) const;
187  virtual Vector4 getSpotlightParams(size_t index) const;
188  virtual void setAmbientLightColour(const ColourValue& ambient);
189  virtual const ColourValue& getAmbientLightColour(void) const;
190  virtual const ColourValue& getSurfaceAmbientColour(void) const;
191  virtual const ColourValue& getSurfaceDiffuseColour(void) const;
192  virtual const ColourValue& getSurfaceSpecularColour(void) const;
193  virtual const ColourValue& getSurfaceEmissiveColour(void) const;
194  virtual Real getSurfaceShininess(void) const;
195  virtual Real getSurfaceAlphaRejectionValue(void) const;
196  virtual ColourValue getDerivedAmbientLightColour(void) const;
197  virtual ColourValue getDerivedSceneColour(void) const;
198  virtual void setFog(FogMode mode, const ColourValue& colour, Real expDensity, Real linearStart, Real linearEnd);
199  virtual const ColourValue& getFogColour(void) const;
200  virtual const Vector4& getFogParams(void) const;
201  virtual const Matrix4& getTextureViewProjMatrix(size_t index) const;
202  virtual const Matrix4& getTextureWorldViewProjMatrix(size_t index) const;
203  virtual const Matrix4& getSpotlightViewProjMatrix(size_t index) const;
204  virtual const Matrix4& getSpotlightWorldViewProjMatrix(size_t index) const;
205  virtual const Matrix4& getTextureTransformMatrix(size_t index) const;
206  virtual const RenderTarget* getCurrentRenderTarget(void) const;
207  virtual const Renderable* getCurrentRenderable(void) const;
208  virtual const Pass* getCurrentPass(void) const;
209  virtual Vector4 getTextureSize(size_t index) const;
210  virtual Vector4 getInverseTextureSize(size_t index) const;
211  virtual Vector4 getPackedTextureSize(size_t index) const;
212  virtual Real getShadowExtrusionDistance(void) const;
213  virtual const Vector4& getSceneDepthRange() const;
214  virtual const Vector4& getShadowSceneDepthRange(size_t index) const;
215  virtual const ColourValue& getShadowColour() const;
216  virtual Matrix4 getInverseViewProjMatrix(void) const;
217  virtual Matrix4 getInverseTransposeViewProjMatrix() const;
218  virtual Matrix4 getTransposeViewProjMatrix() const;
219  virtual Matrix4 getTransposeViewMatrix() const;
220  virtual Matrix4 getInverseTransposeViewMatrix() const;
221  virtual Matrix4 getTransposeProjectionMatrix() const;
222  virtual Matrix4 getInverseProjectionMatrix() const;
223  virtual Matrix4 getInverseTransposeProjectionMatrix() const;
224  virtual Matrix4 getTransposeWorldViewProjMatrix() const;
225  virtual Matrix4 getInverseWorldViewProjMatrix() const;
226  virtual Matrix4 getInverseTransposeWorldViewProjMatrix() const;
227  virtual Matrix4 getTransposeWorldViewMatrix() const;
228  virtual Matrix4 getTransposeWorldMatrix() const;
229  virtual Real getTime(void) const;
230  virtual Real getTime_0_X(Real x) const;
231  virtual Real getCosTime_0_X(Real x) const;
232  virtual Real getSinTime_0_X(Real x) const;
233  virtual Real getTanTime_0_X(Real x) const;
234  virtual Vector4 getTime_0_X_packed(Real x) const;
235  virtual Real getTime_0_1(Real x) const;
236  virtual Real getCosTime_0_1(Real x) const;
237  virtual Real getSinTime_0_1(Real x) const;
238  virtual Real getTanTime_0_1(Real x) const;
239  virtual Vector4 getTime_0_1_packed(Real x) const;
240  virtual Real getTime_0_2Pi(Real x) const;
241  virtual Real getCosTime_0_2Pi(Real x) const;
242  virtual Real getSinTime_0_2Pi(Real x) const;
243  virtual Real getTanTime_0_2Pi(Real x) const;
244  virtual Vector4 getTime_0_2Pi_packed(Real x) const;
245  virtual Real getFrameTime(void) const;
246  virtual Real getFPS() const;
247  virtual Real getViewportWidth() const;
248  virtual Real getViewportHeight() const;
249  virtual Real getInverseViewportWidth() const;
250  virtual Real getInverseViewportHeight() const;
251  virtual Vector3 getViewDirection() const;
252  virtual Vector3 getViewSideVector() const;
253  virtual Vector3 getViewUpVector() const;
254  virtual Real getFOV() const;
255  virtual Real getNearClipDistance() const;
256  virtual Real getFarClipDistance() const;
257  virtual int getPassNumber(void) const;
258  virtual void setPassNumber(const int passNumber);
259  virtual void incPassNumber(void);
260  virtual void updateLightCustomGpuParameter(const GpuProgramParameters::AutoConstantEntry& constantEntry, GpuProgramParameters *params) const;
261  };
264 }
265 
266 #endif
A 'canvas' which can receive the results of a rendering operation.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:260
const VisibleObjectsBoundsInfo * mMainCamBoundsInfo
FogMode
Fog modes.
Definition: OgreCommon.h:121
const SceneManager * mCurrentSceneManager
Class representing colour.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:85
Manages the organisation and rendering of a 'scene' i.e.
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
Abstract class defining the interface all renderable objects must implement.
#define OGRE_MAX_SIMULTANEOUS_LIGHTS
Define max number of lights allowed per pass.
Definition: OgreConfig.h:76
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
Structure recording the use of an automatic parameter.
virtual bool hasLightList() const
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Collects together the program parameters used for a GpuProgram.
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
const RenderTarget * mCurrentRenderTarget
4-dimensional homogeneous vector.
Definition: OgreVector4.h:45
Structure collecting together information about the visible objects that have been discovered in a sc...
This utility class is used to hold the information used to generate the matrices and other informatio...