PixelLightAPI  .
SNMCameraZoom.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMCameraZoom.h                                *
00003  *
00004  *  Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLSCENE_SCENENODEMODIFIER_CAMERAZOOM_H__
00024 #define __PLSCENE_SCENENODEMODIFIER_CAMERAZOOM_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/Scene/SceneNodeModifier.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLScene {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Scene node modifier class implementing camera zoom
00046 */
00047 class SNMCameraZoom : public SceneNodeModifier {
00048 
00049 
00050     //[-------------------------------------------------------]
00051     //[ RTTI interface                                        ]
00052     //[-------------------------------------------------------]
00053     pl_class(PLS_RTTI_EXPORT, SNMCameraZoom, "PLScene", PLScene::SceneNodeModifier, "Scene node modifier class implementing camera zoom")
00054         // Properties
00055         pl_properties
00056             pl_property("SceneNodeClass",   "PLScene::SNCamera")
00057         pl_properties_end
00058         // Attributes
00059         pl_attribute(ZoomDegree,    float,  30.0f,  ReadWrite,  DirectValue,    "Zoom in degree, added to original camera FOV",                                             "")
00060         pl_attribute(ZoomFactor,    float,  0.0f,   ReadWrite,  DirectValue,    "Target zoom factor [0..1]",                                                                "")
00061         pl_attribute(ZoomSpeed,     float,  4.0f,   ReadWrite,  DirectValue,    "Current zoom factor update speed, if 0, current factor is set to target factor at once",   "")
00062         // Constructors
00063         pl_constructor_1(ParameterConstructor,  SceneNode&, "Parameter constructor",    "")
00064         // Slots
00065         pl_slot_0(OnUpdate, "Called when the scene node modifier needs to be updated",  "")
00066     pl_class_end
00067 
00068 
00069     //[-------------------------------------------------------]
00070     //[ Public functions                                      ]
00071     //[-------------------------------------------------------]
00072     public:
00073         /**
00074         *  @brief
00075         *    Constructor
00076         *
00077         *  @param[in] cSceneNode
00078         *    Owner scene node
00079         */
00080         PLS_API SNMCameraZoom(SceneNode &cSceneNode);
00081 
00082         /**
00083         *  @brief
00084         *    Destructor
00085         */
00086         PLS_API virtual ~SNMCameraZoom();
00087 
00088 
00089     //[-------------------------------------------------------]
00090     //[ Protected virtual SceneNodeModifier functions         ]
00091     //[-------------------------------------------------------]
00092     protected:
00093         PLS_API virtual void OnActivate(bool bActivate) override;
00094 
00095 
00096     //[-------------------------------------------------------]
00097     //[ Private functions                                     ]
00098     //[-------------------------------------------------------]
00099     private:
00100         /**
00101         *  @brief
00102         *    Called when the scene node modifier needs to be updated
00103         */
00104         void OnUpdate();
00105 
00106 
00107     //[-------------------------------------------------------]
00108     //[ Private data                                          ]
00109     //[-------------------------------------------------------]
00110     private:
00111         float m_fOriginalFOV;       /**< Original camera scene node FOV in degree when this modifier was added */
00112         float m_fCurrentZoomFactor; /**< Current zoom factor [0..1] */
00113 
00114 
00115 };
00116 
00117 
00118 //[-------------------------------------------------------]
00119 //[ Namespace                                             ]
00120 //[-------------------------------------------------------]
00121 } // PLScene
00122 
00123 
00124 #endif // __PLSCENE_SCENENODEMODIFIER_CAMERAZOOM_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:02
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported