50 #define MULTIINTERPOLATIONANIMATIONT_C
52 #include "AnimationT.hh"
61 template<
class Po
intT>
64 interpolationAnimations_(_other.interpolationAnimations_)
70 template<
class Po
intT>
77 template<
class Po
intT>
79 if (interpolationAnimations_.size() == 0)
82 interpolationAnimations_[0]->getMinInput(_result);
84 for (uint i=0;i<interpolationAnimations_.size();++i) {
86 interpolationAnimations_[i]->getMinInput(currentInput);
88 if (currentInput < _result)
89 _result = currentInput;
97 template<
class Po
intT>
99 if (interpolationAnimations_.size() == 0)
102 interpolationAnimations_[0]->getMaxInput(_result);
104 for (uint i=0;i<interpolationAnimations_.size();++i) {
106 interpolationAnimations_[i]->getMaxInput(currentInput);
108 if (currentInput > _result)
109 _result = currentInput;;
121 template<
class Po
intT>
124 Scalar minInput=0, maxInput=0;
125 if (getMinInput(minInput) && getMaxInput(maxInput)) {
126 return ((maxInput - minInput) * FPS);
134 template<
class Po
intT>
138 if (interpolationAnimations_.size() == 0)
141 Scalar minValue=0; uint minInterpolationAnimationIndex = 0;
142 for (uint i=0; i<interpolationAnimations_.size(); ++i) {
144 interpolationAnimations_[i]->getMinInput(currentValue);
145 Scalar minValueTmp = std::min(minValue, currentValue);
146 minInterpolationAnimationIndex = (minValueTmp < minValue) ? i : minInterpolationAnimationIndex;
149 return pose(_iFrame, interpolationAnimations_[minValue]->getReference());
154 template<
class Po
intT>
159 Pose* newPose = NULL;
160 Pose* referenceCopy =
new Pose(*_reference);
162 for (uint i=0; i<interpolationAnimations_.size(); ++i) {
163 Scalar minInput, maxInput;
164 interpolationAnimations_[i]->getMinInput(minInput); interpolationAnimations_[i]->getMaxInput(maxInput);
166 unsigned int minFrame = (minInput * FPS);
167 unsigned int maxFrame = (maxInput * FPS);
170 if (_iFrame < minFrame || _iFrame > maxFrame)
173 if (interpolationAnimations_[i]) {
175 newPose = interpolationAnimations_[i]->pose(_iFrame - minFrame, referenceCopy);
177 newPose = interpolationAnimations_[i]->pose(_iFrame - minFrame, newPose);
181 delete referenceCopy;
184 newPose = _reference;
191 template<
class Po
intT>
193 if ( _index < interpolationAnimations_.size() )
194 return interpolationAnimations_[ _index ];
virtual Pose * pose(unsigned int _iFrame)
get a pose
virtual unsigned int frameCount()
Returns the number of frames that this animation can playback.
A general pose, used to store the frames of the animation.
Stores a single animation.