PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNMPositionLinearAnimation.h * 00003 * 00004 * Copyright (C) 2002-2012 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_POSITIONLINEARANIMATION_H__ 00024 #define __PLSCENE_SCENENODEMODIFIER_POSITIONLINEARANIMATION_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 position animation scene node modifier class 00048 * 00049 * @remarks 00050 * Animates the position of the scene nodes over time. 00051 */ 00052 class SNMPositionLinearAnimation : public SNMTransform { 00053 00054 00055 //[-------------------------------------------------------] 00056 //[ Public definitions ] 00057 //[-------------------------------------------------------] 00058 public: 00059 /** 00060 * @brief 00061 * Automatic vector type 00062 */ 00063 enum EAutoVector { 00064 None = 0, /**< No automatic movement vector */ 00065 XAxis = 1, /**< Use the current x (left) axis vector automatically as movement vector */ 00066 YAxis = 2, /**< Use the current y (up) axis vector automatically as movement vector */ 00067 ZAxis = 3 /**< Use the current z (view) axis vector automatically as movement vector */ 00068 }; 00069 pl_enum(EAutoVector) 00070 pl_enum_value(None, "No automatic movement vector") 00071 pl_enum_value(XAxis, "Use the current x (left) axis vector automatically as movement vector") 00072 pl_enum_value(YAxis, "Use the current y (up) axis vector automatically as movement vector") 00073 pl_enum_value(ZAxis, "Use the current z (view) axis vector automatically as movement vector") 00074 pl_enum_end 00075 00076 00077 //[-------------------------------------------------------] 00078 //[ RTTI interface ] 00079 //[-------------------------------------------------------] 00080 pl_class(PLS_RTTI_EXPORT, SNMPositionLinearAnimation, "PLScene", PLScene::SNMTransform, "Linear position animation scene node modifier class") 00081 // Attributes 00082 pl_attribute(AutoVector, pl_enum_type(EAutoVector), None, ReadWrite, DirectValue, "Automatic vector type", "") 00083 pl_attribute(Vector, PLMath::Vector3, PLMath::Vector3::One, ReadWrite, DirectValue, "Movement vector", "") 00084 pl_attribute(Speed, float, 1.0f, ReadWrite, DirectValue, "Movement speed", "") 00085 // Constructors 00086 pl_constructor_1(ParameterConstructor, SceneNode&, "Parameter constructor", "") 00087 pl_class_end 00088 00089 00090 //[-------------------------------------------------------] 00091 //[ Public functions ] 00092 //[-------------------------------------------------------] 00093 public: 00094 /** 00095 * @brief 00096 * Constructor 00097 * 00098 * @param[in] cSceneNode 00099 * Owner scene node 00100 */ 00101 PLS_API SNMPositionLinearAnimation(SceneNode &cSceneNode); 00102 00103 /** 00104 * @brief 00105 * Destructor 00106 */ 00107 PLS_API virtual ~SNMPositionLinearAnimation(); 00108 00109 00110 //[-------------------------------------------------------] 00111 //[ Protected virtual SceneNodeModifier functions ] 00112 //[-------------------------------------------------------] 00113 protected: 00114 PLS_API virtual void OnActivate(bool bActivate) override; 00115 00116 00117 //[-------------------------------------------------------] 00118 //[ Private functions ] 00119 //[-------------------------------------------------------] 00120 private: 00121 /** 00122 * @brief 00123 * Called when the scene node modifier needs to be updated 00124 */ 00125 void OnUpdate(); 00126 00127 00128 //[-------------------------------------------------------] 00129 //[ Private event handlers ] 00130 //[-------------------------------------------------------] 00131 private: 00132 PLCore::EventHandler<> EventHandlerUpdate; 00133 00134 00135 }; 00136 00137 00138 //[-------------------------------------------------------] 00139 //[ Namespace ] 00140 //[-------------------------------------------------------] 00141 } // PLScene 00142 00143 00144 #endif // __PLSCENE_SCENENODEMODIFIER_POSITIONLINEARANIMATION_H__
|