1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CL_ANIMATION_SET_H
20 #define CL_ANIMATION_SET_H
26 #include "nel/misc/types_nl.h"
27 #include "nel/misc/smart_ptr.h"
29 #include "animation_type.h"
30 #include "animation_state.h"
40 * Class to manage an animation set.
41 * \author Guillaume PUZIN (GUIGUI)
42 * \author Nevrax France
50 double _AboutFaceAngle
;
60 /// AnimationState cache
61 std::vector
<CAnimationState
> _AnimationStates
;
62 CAnimationSetSheet
*_Sheet
;
69 * Build the animation set according to the georges file. (read in the sheet manager)
71 void init(CAnimationSetSheet
*sheet
, NL3D::UAnimationSet
*animationSet
);
74 * Return the distance after the one you have to break the idle.
75 * \return double : this distance.
77 double maxDist() const {return _MaxDist
;}
79 * Return the distance after the one you have to break the idle.
80 * \return double : this distance.
82 double angle() const {return _Angle
;}
84 * Return the distance after the one you have to break the idle.
85 * \return double : this distance.
87 double aboutFaceAngle() const {return _AboutFaceAngle
;}
89 * When in walk animation, after this speed the animation should switch in run mode.
90 * \return double : a speed.
92 double speedToRun() const {return _SpeedToRun
;}
94 * When in run animation, before this speed the animation should switch in walk mode.
95 * \return double : a speed.
97 double speedToWalk() const {return _SpeedToWalk
;}
99 /// Return the animation state from its Id. Your id must be valid, no check for optimal performances.
100 const CAnimationState
*getAnimationState(const TAnimStateId
& stateId
) const
102 if ((uint
)stateId
<_AnimationStates
.size ())
103 return &(_AnimationStates
[stateId
]);
108 // get number of animation states
109 uint
getNumAnimationState() const { return (uint
)_AnimationStates
.size(); }
110 // get an animation state by its index
111 CAnimationState
*getAnimationStateByIndex(uint index
);
113 /// Return the covered distance by 1 walking animation.
114 double walkDist() const {return _WalkDist
;}
115 /// Return the covered distance by 1 running animation.
116 double runDist() const {return _RunDist
;}
117 /// Return the length (in sec) of the walking animation.
118 double walkLength() const {return _WalkLength
;}
119 /// Return the length (in sec) of the running animation.
120 double runLength() const {return _RunLength
;}
122 // get the sheet name
123 std::string
getSheetName() const
126 if(_Sheet
) return _Sheet
->Name
;
132 #endif // CL_ANIMATION_SET_H
134 /* End of animation_set.h */