Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

# OgreShadowCameraSetupLiSPSM.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://www.ogre3d.org/
    00006
    00007 Copyright (c) 2006 Torus Knot Software Ltd
    00008 Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>
    00009 Also see acknowledgements in Readme.html
    00010
    00011 This program is free software; you can redistribute it and/or modify it under
    00012 the terms of the GNU Lesser General Public License as published by the Free Software
    00013 Foundation; either version 2 of the License, or (at your option) any later
    00014 version.
    00015
    00016 This program is distributed in the hope that it will be useful, but WITHOUT
    00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00018 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00019
    00020 You should have received a copy of the GNU Lesser General Public License along with
    00021 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00022 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00023 http://www.gnu.org/copyleft/lesser.txt.
    00024
    00025 You may alternatively use this source under the terms of a specific version of
    00026 the OGRE Unrestricted License provided you have obtained such a license from
    00027 Torus Knot Software Ltd.
    00028 -----------------------------------------------------------------------------
    00029 */
    00030 #ifndef __ShadowCameraSetupLiSPSM_H__
    00031 #define __ShadowCameraSetupLiSPSM_H__
    00032
    00033 #include "OgrePrerequisites.h"
    00034 #include "OgreShadowCameraSetupFocused.h"
    00035
    00036
    00037 namespace Ogre
    00038 {
    00039
    00093     class _OgreExport LiSPSMShadowCameraSetup : public FocusedShadowCameraSetup
    00094     {
    00095     protected:
    00097         Real mOptAdjustFactor;
    00099         bool mUseSimpleNOpt;
    00100
    00116         Matrix4 calculateLiSPSM(const Matrix4& lightSpace, const PointListBody& bodyB,
    00117             const PointListBody& bodyLVS, const SceneManager& sm,
    00118             const Camera& cam, const Light& light) const;
    00119
    00144         Real calculateNOpt(const Matrix4& lightSpace, const AxisAlignedBox& bodyBABB_ls,
    00145             const PointListBody& bodyLVS, const Camera& cam) const;
    00146
    00149         Real calculateNOptSimple(const PointListBody& bodyLVS,
    00150             const Camera& cam) const;
    00151
    00162         Vector3 calculateZ0_ls(const Matrix4& lightSpace, const Vector3& e, Real bodyB_zMax_ls,
    00163             const Camera& cam) const;
    00164
    00170         Matrix4 buildFrustumProjection(Real left, Real right, Real bottom,
    00171             Real top, Real near, Real far) const;
    00172
    00173     public:
    00178         LiSPSMShadowCameraSetup(void);
    00179
    00184         virtual ~LiSPSMShadowCameraSetup(void);
    00185
    00192         virtual void getShadowCamera(const SceneManager *sm, const Camera *cam,
    00193             const Viewport *vp, const Light *light, Camera *texCam) const;
    00194
    00207         virtual void setOptimalAdjustFactor(Real n) { mOptAdjustFactor = n; }
    00211         virtual Real getOptimalAdjustFactor() const { return mOptAdjustFactor; }
    00215         virtual void setUseSimpleOptimalAdjust(bool s) { mUseSimpleNOpt = s; }
    00219         virtual bool getUseSimpleOptimalAdjust() const { return mUseSimpleNOpt; }
    00220
    00221     };
    00222
    00223 }
    00224
    00225 #endif
    00226

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Thu Mar 6 09:46:26 2008