Anim.hpp

Go to the documentation of this file.
00001 /*
00002 SagaEngine library
00003 Copyright (c) 2002-2006 Skalden Studio AS
00004 
00005 This software is provided 'as-is', without any express or implied 
00006 warranty. In no event will the authors be held liable for any 
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to distribute the library under the terms of the 
00010 Q Public License version 1.0. Be sure to read and understand the license
00011 before using the library. It should be included here, or you may read it
00012 at http://www.trolltech.com/products/qt/licenses/licensing/qpl
00013 
00014 The original version of this library can be located at:
00015 http://www.sagaengine.com/
00016 
00017 Rune Myrland
00018 rune@skalden.com
00019 */
00020 
00021 
00022 #ifndef sim_stat_Anim_hpp
00023 #define sim_stat_Anim_hpp
00024 
00025 #include "util/type/util_type.hpp"
00026 #include "../config/sim_config.hpp"
00027 
00028 namespace se_core {
00029     class _SeCoreExport Anim {
00030     public:
00031         typedef short MovementMode;
00032 
00033         Anim();
00034         void setAnim(const Anim& original);
00035 
00047         void setMovementMode(short mode);
00048 
00059         void setMovementMode(long when, short mode);
00060 
00066         short movementMode() const;
00067 
00076         long movementWhen(long when) const { return when - movementStartedWhen_; }
00077         void setSpeed(scale_t s) { speed_ = s; }
00078         scale_t speed() const { return speed_; }
00079 
00080         void setWeight(scale_t w) { weight_ = w; }
00081         scale_t weight() const { return weight_; }
00082 
00083         void setStartPos(float p) { startPos_ = p; }
00084         void addStartPos(float p) { startPos_ += p; }
00085 
00089         scale_t startPos() const { return startPos_; }
00090 
00094         scale_t pos() const { return pos_; }
00095         void resetPos() { pos_ = startPos_; }
00096         void addPos(scale_t s) { pos_ += s; }
00097         void updatePos() { pos_ += speed_ * SCALE_STEP; }
00098 
00099         static void setMovementModeCount(int c) { MOVEMENT_MODE_COUNT = c; }
00100         static int MOVEMENT_MODE_COUNT;
00101 
00102     private:
00104         int movementMode_;
00105 
00107         long movementStartedWhen_;
00108 
00109         scale_t pos_;
00110 
00111         scale_t weight_;
00112 
00113         scale_t speed_;
00114 
00115         scale_t startPos_;
00116     };
00117 
00118 }
00119 
00120 #endif

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:11 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo