PixelLightAPI  .
SNMMeshMorph.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMMeshMorph.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_MESHMORPH_H__
00024 #define __PLSCENE_SCENENODEMODIFIER_MESHMORPH_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 morph 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 morph targets, this modifier will have no effect
00050 */
00051 class SNMMeshMorph : public SNMMesh {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ RTTI interface                                        ]
00056     //[-------------------------------------------------------]
00057     pl_class(PLS_RTTI_EXPORT, SNMMeshMorph, "PLScene", PLScene::SNMMesh, "Mesh scene node morph modifier class")
00058         // Constructors
00059         pl_constructor_1(ParameterConstructor, SceneNode&, "Parameter constructor", "")
00060         // Attributes
00061         pl_attribute(Name,      PLCore::String, "",     ReadWrite,  GetSet,         "Name of the morph target",     "")
00062         pl_attribute(Weight,    float,          0.0f,   ReadWrite,  DirectValue,    "Morph target weight",          "")
00063         pl_attribute(MinWeight, float,          0.0f,   ReadWrite,  DirectValue,    "Minimum morph target weight",  "")
00064         pl_attribute(MaxWeight, float,          1.0f,   ReadWrite,  DirectValue,    "Maximum morph target weight",  "")
00065     pl_class_end
00066 
00067 
00068     //[-------------------------------------------------------]
00069     //[ Public RTTI get/set functions                         ]
00070     //[-------------------------------------------------------]
00071     public:
00072         PLS_API PLCore::String GetName() const;
00073         PLS_API void SetName(const PLCore::String &sValue);
00074         PLS_API float GetWeight() const;
00075         PLS_API void SetWeight(float fValue);
00076         PLS_API float GetMinWeight() const;
00077         PLS_API void SetMinWeight(float fValue);
00078         PLS_API float GetMaxWeight() const;
00079         PLS_API void SetMaxWeight(float fValue);
00080 
00081 
00082     //[-------------------------------------------------------]
00083     //[ Public functions                                      ]
00084     //[-------------------------------------------------------]
00085     public:
00086         /**
00087         *  @brief
00088         *    Constructor
00089         *
00090         *  @param[in] cSceneNode
00091         *    Owner scene node
00092         */
00093         PLS_API SNMMeshMorph(SceneNode &cSceneNode);
00094 
00095         /**
00096         *  @brief
00097         *    Destructor
00098         */
00099         PLS_API virtual ~SNMMeshMorph();
00100 
00101 
00102     //[-------------------------------------------------------]
00103     //[ Protected virtual SceneNodeModifier functions         ]
00104     //[-------------------------------------------------------]
00105     protected:
00106         PLS_API virtual void OnActivate(bool bActivate) override;
00107 
00108 
00109     //[-------------------------------------------------------]
00110     //[ Protected functions                                   ]
00111     //[-------------------------------------------------------]
00112     protected:
00113         /**
00114         *  @brief
00115         *    Updates the morph target
00116         */
00117         PLS_API void UpdateMorphTarget();
00118 
00119 
00120     //[-------------------------------------------------------]
00121     //[ Protected data                                        ]
00122     //[-------------------------------------------------------]
00123     protected:
00124         PLCore::String m_sName;         /**< Name of the morph target */
00125         float          m_fWeight;       /**< Morph target weight */
00126         float          m_fMinWeight;    /**< Minimum morph target weight */
00127         float          m_fMaxWeight;    /**< Maximum morph target weight */
00128 
00129 
00130 };
00131 
00132 
00133 //[-------------------------------------------------------]
00134 //[ Namespace                                             ]
00135 //[-------------------------------------------------------]
00136 } // PLScene
00137 
00138 
00139 #endif // __PLSCENE_SCENENODEMODIFIER_MESHMORPH_H__


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