text: /*********************************************************\
   *  File: SNMOrbitingController.h                        *
   *
   *  Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/)
   *
   *  This file is part of PixelLight.
   *
   *  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
   *  and associated documentation files (the "Software"), to deal in the Software without
   *  restriction, including without limitation the rights to use, copy, modify, merge, publish,
   *  distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
   *  Software is furnished to do so, subject to the following conditions:
   *
   *  The above copyright notice and this permission notice shall be included in all copies or
   *  substantial portions of the Software.
   *
   *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
   *  BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   *  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  \*********************************************************/
  
  
  #ifndef __PLENGINE_CONTROLLER_SNMORBITINGCONTROLLER_H__
  #define __PLENGINE_CONTROLLER_SNMORBITINGCONTROLLER_H__
  #pragma once
  
  
  //[-------------------------------------------------------]
  //[ Includes                                              ]
  //[-------------------------------------------------------]
  #include <PLCore/Base/Event/EventHandler.h>
  #include <PLScene/Scene/SceneNodeModifiers/SNMOrbiting.h>
  #include "PLEngine/PLEngine.h"
  
  
  //[-------------------------------------------------------]
  //[ Namespace                                             ]
  //[-------------------------------------------------------]
  namespace PLEngine {
  
  
  //[-------------------------------------------------------]
  //[ Forward declarations                                  ]
  //[-------------------------------------------------------]
  class OrbitingController;
  
  
  //[-------------------------------------------------------]
  //[ Classes                                               ]
  //[-------------------------------------------------------]
  /**
  *  @brief
  *    Scene node modifier class rotating a scene node towards a target scene node using an input controller
  *
  *  @remarks
  *    When using the unchanged virtual standard controller:
  *    Hold the left mouse button to rotate, the right mouse button to zoom and the middle mouse button to pan.
  *
  *  @note
  *    - Primary intended for rapid prototyping
  */
  class SNMOrbitingController : public PLScene::SNMOrbiting {
  
  
  	//[-------------------------------------------------------]
  	//[ RTTI interface                                        ]
  	//[-------------------------------------------------------]
  	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")
  		// Attributes
  		pl_attribute(InputSemantic,	PLCore::String,	"",	ReadWrite,	DirectValue,	"Semantic of this input controller (e.g. \"Camera\")",	"")
  		// Constructors
  		pl_constructor_1(ParameterConstructor,	PLScene::SceneNode&,	"Parameter constructor",	"")
  	pl_class_end
  
  
  	//[-------------------------------------------------------]
  	//[ Public functions                                      ]
  	//[-------------------------------------------------------]
  	public:
  		/**
  		*  @brief
  		*    Constructor
  		*
  		*  @param[in] cSceneNode
  		*    Owner scene node
  		*/
  		PL_API SNMOrbitingController(PLScene::SceneNode &cSceneNode);
  
  		/**
  		*  @brief
  		*    Destructor
  		*/
  		PL_API virtual ~SNMOrbitingController();
  
  
  	//[-------------------------------------------------------]
  	//[ Public virtual PLScene::SceneNodeModifier functions   ]
  	//[-------------------------------------------------------]
  	public:
  		PL_API virtual PLInput::Controller *GetInputController() const override;
  
  
  	//[-------------------------------------------------------]
  	//[ Protected virtual PLScene::SceneNodeModifier functions ]
  	//[-------------------------------------------------------]
  	protected:
  		PL_API virtual void InformedOnInit() override;
  		PL_API virtual void OnActivate(bool bActivate) override;
  
  
  	//[-------------------------------------------------------]
  	//[ Protected virtual SNMOrbitingController functions     ]
  	//[-------------------------------------------------------]
  	protected:
  		/**
  		*  @brief
  		*    Called when the scene node modifier needs to be updated
  		*/
  		PL_API virtual void OnUpdate();
  
  
  	//[-------------------------------------------------------]
  	//[ Private event handlers                                ]
  	//[-------------------------------------------------------]
  	private:
  		PLCore::EventHandler<> EventHandlerUpdate;
  
  
  	//[-------------------------------------------------------]
  	//[ Protected data                                        ]
  	//[-------------------------------------------------------]
  	protected:
  		OrbitingController *m_pController;	/**< Orbiting input controller instance, always valid! */
  
  
  };
  
  
  //[-------------------------------------------------------]
  //[ Namespace                                             ]
  //[-------------------------------------------------------]
  } // PLEngine
  
  
  #endif // __PLENGINE_CONTROLLER_SNMORBITINGCONTROLLER_H__
  