PixelLightAPI  .
SNMMeshAnimation.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMMeshAnimation.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_MESHANIMATION_H__
00024 #define __PLSCENE_SCENENODEMODIFIER_MESHANIMATION_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/Scene/SceneNodeModifiers/SNMMesh.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLScene {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Mesh scene node animation modifier class
00046 *
00047 *  @note
00048 *    - Adds automatically a "PLScene::SNMMeshUpdate" scene node modifier (if there's not yet one) in order to frequently update the mesh
00049 *    - If the node has no mesh with animations, this modifier will have no effect
00050 */
00051 class SNMMeshAnimation : public SNMMesh {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ RTTI interface                                        ]
00056     //[-------------------------------------------------------]
00057     pl_class(PLS_RTTI_EXPORT, SNMMeshAnimation, "PLScene", PLScene::SNMMesh, "Mesh scene node animation modifier class")
00058         // Attributes
00059         pl_attribute(Name,      PLCore::String, "",     ReadWrite,  GetSet, "Name of the animation",                                        "")
00060         pl_attribute(Frame,     float,          0.0f,   ReadWrite,  GetSet, "Current animation frame",                                      "")
00061         pl_attribute(Speed,     float,          1.0f,   ReadWrite,  GetSet, "Animation playback speed (multiplied with original speed)",    "")
00062         pl_attribute(Weight,    float,          1.0f,   ReadWrite,  GetSet, "Animation weight",                                             "")
00063         pl_attribute(MinWeight, float,          0.0f,   ReadWrite,  GetSet, "Minimum animation weight",                                     "")
00064         pl_attribute(MaxWeight, float,          1.0f,   ReadWrite,  GetSet, "Maximum animation weight",                                     "")
00065         // Constructors
00066         pl_constructor_1(ParameterConstructor,  SceneNode&, "Parameter constructor",    "")
00067     pl_class_end
00068 
00069 
00070     //[-------------------------------------------------------]
00071     //[ Public RTTI get/set functions                         ]
00072     //[-------------------------------------------------------]
00073     public:
00074         PLS_API PLCore::String GetName() const;
00075         PLS_API void SetName(const PLCore::String &sValue);
00076         PLS_API float GetFrame() const;
00077         PLS_API void SetFrame(float fValue);
00078         PLS_API float GetSpeed() const;
00079         PLS_API void SetSpeed(float fValue);
00080         PLS_API float GetWeight() const;
00081         PLS_API void SetWeight(float fValue);
00082         PLS_API float GetMinWeight() const;
00083         PLS_API void SetMinWeight(float fValue);
00084         PLS_API float GetMaxWeight() const;
00085         PLS_API void SetMaxWeight(float fValue);
00086 
00087 
00088     //[-------------------------------------------------------]
00089     //[ Public functions                                      ]
00090     //[-------------------------------------------------------]
00091     public:
00092         /**
00093         *  @brief
00094         *    Constructor
00095         *
00096         *  @param[in] cSceneNode
00097         *    Owner scene node
00098         */
00099         PLS_API SNMMeshAnimation(SceneNode &cSceneNode);
00100 
00101         /**
00102         *  @brief
00103         *    Destructor
00104         */
00105         PLS_API virtual ~SNMMeshAnimation();
00106 
00107 
00108     //[-------------------------------------------------------]
00109     //[ Private functions                                     ]
00110     //[-------------------------------------------------------]
00111     private:
00112         /**
00113         *  @brief
00114         *    Updates the mesh
00115         */
00116         void UpdateMesh();
00117 
00118 
00119     //[-------------------------------------------------------]
00120     //[ Private data                                          ]
00121     //[-------------------------------------------------------]
00122     private:
00123         PLCore::String m_sName;
00124         float          m_fFrame;
00125         float          m_fSpeed;
00126         float          m_fWeight;
00127         float          m_fMinWeight;
00128         float          m_fMaxWeight;
00129 
00130 
00131 };
00132 
00133 
00134 //[-------------------------------------------------------]
00135 //[ Namespace                                             ]
00136 //[-------------------------------------------------------]
00137 } // PLScene
00138 
00139 
00140 #endif // __PLSCENE_SCENENODEMODIFIER_MESHANIMATION_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:00
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported