PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNMCameraZoomController.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 __PLENGINE_CONTROLLER_SNMCAMERAZOOMCONTROLLER_H__ 00024 #define __PLENGINE_CONTROLLER_SNMCAMERAZOOMCONTROLLER_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLScene/Scene/SceneNodeModifiers/SNMCameraZoom.h> 00032 #include "PLEngine/PLEngine.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Forward declarations ] 00037 //[-------------------------------------------------------] 00038 namespace PLInput { 00039 class Control; 00040 } 00041 namespace PLEngine { 00042 class CameraZoomController; 00043 } 00044 00045 00046 //[-------------------------------------------------------] 00047 //[ Namespace ] 00048 //[-------------------------------------------------------] 00049 namespace PLEngine { 00050 00051 00052 //[-------------------------------------------------------] 00053 //[ Classes ] 00054 //[-------------------------------------------------------] 00055 /** 00056 * @brief 00057 * Scene node modifier class implementing camera zoom input control 00058 * 00059 * @remarks 00060 * When using the unchanged virtual standard controller: 00061 * Hold the right mouse button to zoom. 00062 * 00063 * @note 00064 * - Primary intended for rapid prototyping 00065 */ 00066 class SNMCameraZoomController : public PLScene::SNMCameraZoom { 00067 00068 00069 //[-------------------------------------------------------] 00070 //[ RTTI interface ] 00071 //[-------------------------------------------------------] 00072 pl_class(PL_RTTI_EXPORT, SNMCameraZoomController, "PLEngine", PLScene::SNMCameraZoom, "Scene node modifier class implementing camera zoom input control") 00073 // Attributes 00074 pl_attribute(InputSemantic, PLCore::String, "", ReadWrite, DirectValue, "Semantic of this input controller (e.g. \"Camera\")", "") 00075 // Constructors 00076 pl_constructor_1(ParameterConstructor, PLScene::SceneNode&, "Parameter constructor", "") 00077 // Slot 00078 pl_slot_1(OnControl, PLInput::Control&, "Called when a control event has occurred, the control causing the event as first parameter", "") 00079 pl_class_end 00080 00081 00082 //[-------------------------------------------------------] 00083 //[ Public functions ] 00084 //[-------------------------------------------------------] 00085 public: 00086 /** 00087 * @brief 00088 * Constructor 00089 * 00090 * @param[in] cSceneNode 00091 * Owner scene node 00092 */ 00093 PL_API SNMCameraZoomController(PLScene::SceneNode &cSceneNode); 00094 00095 /** 00096 * @brief 00097 * Destructor 00098 */ 00099 PL_API virtual ~SNMCameraZoomController(); 00100 00101 00102 //[-------------------------------------------------------] 00103 //[ Public virtual PLScene::SceneNodeModifier functions ] 00104 //[-------------------------------------------------------] 00105 public: 00106 PL_API virtual PLInput::Controller *GetInputController() const override; 00107 00108 00109 //[-------------------------------------------------------] 00110 //[ Protected virtual PLScene::SceneNodeModifier functions ] 00111 //[-------------------------------------------------------] 00112 protected: 00113 PL_API virtual void InformedOnInit() override; 00114 PL_API virtual void OnActivate(bool bActivate) override; 00115 00116 00117 //[-------------------------------------------------------] 00118 //[ Private functions ] 00119 //[-------------------------------------------------------] 00120 private: 00121 /** 00122 * @brief 00123 * Called when a control event has occurred 00124 * 00125 * @param[in] cControl 00126 * The control causing the event 00127 */ 00128 void OnControl(PLInput::Control &cControl); 00129 00130 00131 //[-------------------------------------------------------] 00132 //[ Private data ] 00133 //[-------------------------------------------------------] 00134 private: 00135 CameraZoomController *m_pController; /**< Camera zoom input controller instance, always valid! */ 00136 00137 00138 }; 00139 00140 00141 //[-------------------------------------------------------] 00142 //[ Namespace ] 00143 //[-------------------------------------------------------] 00144 } // PLEngine 00145 00146 00147 #endif // __PLENGINE_CONTROLLER_SNMCAMERAZOOMCONTROLLER_H__
|