PixelLightAPI  .
AnimationBase.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: AnimationBase.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 __PLRENDERER_ANIMATIONBASE_H__
00024 #define __PLRENDERER_ANIMATIONBASE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLRenderer/Animation/AnimationInfo.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLRenderer {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Animation base class
00046 */
00047 class AnimationBase : public AnimationInfo {
00048 
00049 
00050     //[-------------------------------------------------------]
00051     //[ Public structures                                     ]
00052     //[-------------------------------------------------------]
00053     public:
00054         /**
00055         *  @brief
00056         *    Animation frame keys
00057         */
00058         class FrameKeys {
00059 
00060 
00061             //[-------------------------------------------------------]
00062             //[ Public data                                           ]
00063             //[-------------------------------------------------------]
00064             public:
00065                 PLCore::Array<float> lstFrameKeys;
00066 
00067 
00068             //[-------------------------------------------------------]
00069             //[ Public functions                                      ]
00070             //[-------------------------------------------------------]
00071             public:
00072                 PLRENDERER_API bool operator ==(const FrameKeys &cKeys) const
00073                 {
00074                     return lstFrameKeys == cKeys.lstFrameKeys;
00075                 }
00076 
00077 
00078         };
00079 
00080 
00081     //[-------------------------------------------------------]
00082     //[ Public functions                                      ]
00083     //[-------------------------------------------------------]
00084     public:
00085         /**
00086         *  @brief
00087         *    Constructor
00088         */
00089         PLRENDERER_API AnimationBase();
00090 
00091         /**
00092         *  @brief
00093         *    Destructor
00094         */
00095         PLRENDERER_API virtual ~AnimationBase();
00096 
00097         /**
00098         *  @brief
00099         *    Returns the frame rate
00100         *
00101         *  @return
00102         *    Frames per second
00103         */
00104         inline float GetFrameRate() const;
00105 
00106         /**
00107         *  @brief
00108         *    Sets the frame rate
00109         *
00110         *  @param[in] fFrameRate
00111         *    Frames per second
00112         */
00113         inline void SetFrameRate(float fFrameRate = 24.0f);
00114 
00115         /**
00116         *  @brief
00117         *    Returns the frame keys
00118         *
00119         *  @return
00120         *    Frame keys
00121         */
00122         inline PLCore::Array<FrameKeys> &GetFrameKeys();
00123 
00124 
00125     //[-------------------------------------------------------]
00126     //[ Protected data                                        ]
00127     //[-------------------------------------------------------]
00128     protected:
00129         float                    m_fFrameRate;      /**< Frame rate */
00130         PLCore::Array<FrameKeys> m_lstFrameKeys;    /**< Frame keys */
00131 
00132 
00133     //[-------------------------------------------------------]
00134     //[ Public virtual AnimationInfo functions                ]
00135     //[-------------------------------------------------------]
00136     public:
00137         PLRENDERER_API virtual AnimationBase &operator =(const AnimationBase &cSource);
00138 
00139 
00140 };
00141 
00142 
00143 //[-------------------------------------------------------]
00144 //[ Namespace                                             ]
00145 //[-------------------------------------------------------]
00146 } // PLRenderer
00147 
00148 
00149 //[-------------------------------------------------------]
00150 //[ Implementation                                        ]
00151 //[-------------------------------------------------------]
00152 #include "PLRenderer/Animation/AnimationBase.inl"
00153 
00154 
00155 #endif // __PLRENDERER_ANIMATIONBASE_H__


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