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