OgreShadowCameraSetupLiSPSM.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>
9
10Permission is hereby granted, free of charge, to any person obtaining a copy
11of this software and associated documentation files (the "Software"), to deal
12in the Software without restriction, including without limitation the rights
13to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14copies of the Software, and to permit persons to whom the Software is
15furnished to do so, subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26THE SOFTWARE.
27-----------------------------------------------------------------------------
28*/
29#ifndef __ShadowCameraSetupLiSPSM_H__
30#define __ShadowCameraSetupLiSPSM_H__
31
32#include "OgrePrerequisites.h"
34#include "OgreHeaderPrefix.h"
35
36namespace Ogre
37{
38
99 {
100 protected:
109
126 const PointListBody& bodyLVS, const SceneManager& sm,
127 const Camera& cam, const Light& light) const;
128
154 const PointListBody& bodyLVS, const Camera& cam) const;
155
159 const Camera& cam) const;
160
172 const Camera& cam) const;
173
180 Real top, Real near, Real far) const;
181
182 public:
188
194
201 virtual void getShadowCamera(const SceneManager *sm, const Camera *cam,
202 const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const;
203
216 virtual void setOptimalAdjustFactor(Real n) { mOptAdjustFactor = n; }
220 virtual Real getOptimalAdjustFactor() const { return mOptAdjustFactor; }
224 virtual void setUseSimpleOptimalAdjust(bool s) { mUseSimpleNOpt = s; }
228 virtual bool getUseSimpleOptimalAdjust() const { return mUseSimpleNOpt; }
229
239
245
246
247 };
251}
252
253#include "OgreHeaderSuffix.h"
254
255#endif
256
#define _OgreExport
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
Definition OgreCamera.h:87
Wrapper class which indicates a given angle value is in Degrees.
Definition OgreMath.h:99
Internal class holding a point list representation of a convex body.
Implements the uniform shadow mapping algorithm in focused mode.
Implements the Light Space Perspective Shadow Mapping Algorithm.
Real calculateNOpt(const Matrix4 &lightSpace, const AxisAlignedBox &bodyBABB_ls, const PointListBody &bodyLVS, const Camera &cam) const
Calculates the distance between camera position and near clipping plane.
Matrix4 buildFrustumProjection(Real left, Real right, Real bottom, Real top, Real near, Real far) const
Builds a frustum matrix.
bool mUseSimpleNOpt
Use simple nopt derivation?
Matrix4 calculateLiSPSM(const Matrix4 &lightSpace, const PointListBody &bodyB, const PointListBody &bodyLVS, const SceneManager &sm, const Camera &cam, const Light &light) const
Calculates the LiSPSM projection matrix P.
virtual void setCameraLightDirectionThreshold(Degree angle)
Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'f...
Vector3 calculateZ0_ls(const Matrix4 &lightSpace, const Vector3 &e, Real bodyB_zMax_ls, const Camera &cam) const
Calculates the visible point on the near plane for the n_opt calculation.
Real mCosCamLightDirThreshold
Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches ...
Real mOptAdjustFactorTweak
Extra calculated warp factor.
LiSPSMShadowCameraSetup(void)
Default constructor.
virtual Real getOptimalAdjustFactor() const
Get the parameter n used to produce optimal shadows.
virtual void getShadowCamera(const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const
Returns a LiSPSM shadow camera.
virtual void setOptimalAdjustFactor(Real n)
Adjusts the parameter n to produce optimal shadows.
virtual ~LiSPSMShadowCameraSetup(void)
Default destructor.
Real mOptAdjustFactor
Warp factor adjustment.
virtual Degree getCameraLightDirectionThreshold() const
Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'f...
virtual bool getUseSimpleOptimalAdjust() const
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is...
Real calculateNOptSimple(const PointListBody &bodyLVS, const Camera &cam) const
Calculates a simpler version than the one above.
virtual void setUseSimpleOptimalAdjust(bool s)
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is...
Representation of a dynamic light source in the scene.
Definition OgreLight.h:74
Class encapsulating a standard 4x4 homogeneous matrix.
Definition OgreMatrix4.h:79
Manages the organisation and rendering of a 'scene' i.e.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 3-dimensional vector.
Definition OgreVector3.h:52
An abstraction of a viewport, i.e.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.