PixelLightAPI  .
SNMRotationLinearAnimation.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMRotationLinearAnimation.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_ROTATIONLINEARANIMATION_H__
00024 #define __PLSCENE_SCENENODEMODIFIER_ROTATIONLINEARANIMATION_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/Base/Event/EventHandler.h>
00032 #include <PLMath/Vector3.h>
00033 #include "PLScene/Scene/SceneNodeModifiers/SNMTransform.h"
00034 
00035 
00036 //[-------------------------------------------------------]
00037 //[ Namespace                                             ]
00038 //[-------------------------------------------------------]
00039 namespace PLScene {
00040 
00041 
00042 //[-------------------------------------------------------]
00043 //[ Classes                                               ]
00044 //[-------------------------------------------------------]
00045 /**
00046 *  @brief
00047 *    Linear rotation animation scene node modifier class
00048 *
00049 *  @remarks
00050 *    Animates the rotation of the scene nodes over time.
00051 */
00052 class SNMRotationLinearAnimation : public SNMTransform {
00053 
00054 
00055     //[-------------------------------------------------------]
00056     //[ RTTI interface                                        ]
00057     //[-------------------------------------------------------]
00058     pl_class(PLS_RTTI_EXPORT, SNMRotationLinearAnimation, "PLScene", PLScene::SNMTransform, "Linear rotation animation scene node modifier class")
00059         // Attributes
00060         pl_attribute(Velocity,  PLMath::Vector3,    PLMath::Vector3(0.0f, 10.0f, 0.0f), ReadWrite,  DirectValue,    "Rotation velocity (degree, [0, 360])", "")
00061         // Constructors
00062         pl_constructor_1(ParameterConstructor,  SceneNode&, "Parameter constructor",    "")
00063     pl_class_end
00064 
00065 
00066     //[-------------------------------------------------------]
00067     //[ Public functions                                      ]
00068     //[-------------------------------------------------------]
00069     public:
00070         /**
00071         *  @brief
00072         *    Constructor
00073         *
00074         *  @param[in] cSceneNode
00075         *    Owner scene node
00076         */
00077         PLS_API SNMRotationLinearAnimation(SceneNode &cSceneNode);
00078 
00079         /**
00080         *  @brief
00081         *    Destructor
00082         */
00083         PLS_API virtual ~SNMRotationLinearAnimation();
00084 
00085 
00086     //[-------------------------------------------------------]
00087     //[ Protected virtual SceneNodeModifier functions         ]
00088     //[-------------------------------------------------------]
00089     protected:
00090         PLS_API virtual void OnActivate(bool bActivate) override;
00091 
00092 
00093     //[-------------------------------------------------------]
00094     //[ Private functions                                     ]
00095     //[-------------------------------------------------------]
00096     private:
00097         /**
00098         *  @brief
00099         *    Called when the scene node modifier needs to be updated
00100         */
00101         void OnUpdate();
00102 
00103 
00104     //[-------------------------------------------------------]
00105     //[ Private event handlers                                ]
00106     //[-------------------------------------------------------]
00107     private:
00108         PLCore::EventHandler<> EventHandlerUpdate;
00109 
00110 
00111 };
00112 
00113 
00114 //[-------------------------------------------------------]
00115 //[ Namespace                                             ]
00116 //[-------------------------------------------------------]
00117 } // PLScene
00118 
00119 
00120 #endif // __PLSCENE_SCENENODEMODIFIER_ROTATIONLINEARANIMATION_H__


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