00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2005 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 00026 #ifndef __AnimationSet_H__ 00027 #define __AnimationSet_H__ 00028 00029 #include "OgrePrerequisites.h" 00030 00031 #include "OgreString.h" 00032 #include "OgreController.h" 00033 #include "OgreIteratorWrappers.h" 00034 00035 namespace Ogre { 00036 00044 class _OgreExport AnimationState : public ControllerValue<Real> 00045 { 00046 public: 00048 AnimationState(); 00052 virtual ~AnimationState(); 00053 00055 AnimationState(const String& animName, Real timePos, Real length, Real weight = 1.0, bool enabled = false); 00057 const String& getAnimationName() const; 00059 void setAnimationName(const String& name); 00061 Real getTimePosition(void) const; 00063 void setTimePosition(Real timePos); 00065 Real getLength() const; 00067 void setLength(Real len); 00069 Real getWeight(void) const; 00071 void setWeight(Real weight); 00076 void addTime(Real offset); 00077 00079 bool getEnabled(void) const; 00081 void setEnabled(bool enabled); 00082 00084 bool operator==(const AnimationState& rhs) const; 00085 // Inequality operator 00086 bool operator!=(const AnimationState& rhs) const; 00087 00089 Real getValue(void) const; 00090 00092 void setValue(Real value); 00096 void setLoop(bool loop) { mLoop = loop; } 00098 bool getLoop(void) const { return mLoop; } 00099 00104 void copyStateFrom(const AnimationState& animState); 00105 00106 protected: 00107 String mAnimationName; 00108 Real mTimePos; 00109 Real mLength; 00110 Real mInvLength; 00111 Real mWeight; 00112 bool mEnabled; 00113 bool mLoop; 00114 00115 }; 00116 00117 // A set of animation states 00118 typedef std::map<String, AnimationState> AnimationStateSet; 00119 typedef MapIterator<AnimationStateSet> AnimationStateIterator; 00120 00128 _OgreExport void CopyAnimationStateSubset(AnimationStateSet& target, const AnimationStateSet& source); 00129 00130 } 00131 00132 #endif 00133
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:41 2006