44 #define MULTIINTERPOLATIONANIMATIONT_C 46 #include "AnimationT.hh" 55 template<
class Po
intT>
58 interpolationAnimations_(_other.interpolationAnimations_)
64 template<
class Po
intT>
71 template<
class Po
intT>
73 if (interpolationAnimations_.size() == 0)
76 interpolationAnimations_[0]->getMinInput(_result);
78 for (uint i=0;i<interpolationAnimations_.size();++i) {
80 interpolationAnimations_[i]->getMinInput(currentInput);
82 if (currentInput < _result)
83 _result = currentInput;
91 template<
class Po
intT>
93 if (interpolationAnimations_.size() == 0)
96 interpolationAnimations_[0]->getMaxInput(_result);
98 for (uint i=0;i<interpolationAnimations_.size();++i) {
100 interpolationAnimations_[i]->getMaxInput(currentInput);
102 if (currentInput > _result)
103 _result = currentInput;;
115 template<
class Po
intT>
118 Scalar minInput=0, maxInput=0;
119 if (getMinInput(minInput) && getMaxInput(maxInput)) {
120 return ((maxInput - minInput) * FPS);
128 template<
class Po
intT>
132 if (interpolationAnimations_.size() == 0)
135 Scalar minValue=0; uint minInterpolationAnimationIndex = 0;
136 for (uint i=0; i<interpolationAnimations_.size(); ++i) {
138 interpolationAnimations_[i]->getMinInput(currentValue);
139 Scalar minValueTmp = std::min(minValue, currentValue);
140 minInterpolationAnimationIndex = (minValueTmp < minValue) ? i : minInterpolationAnimationIndex;
143 return pose(_iFrame, interpolationAnimations_[minValue]->getReference());
148 template<
class Po
intT>
153 Pose* newPose = NULL;
154 Pose* referenceCopy =
new Pose(*_reference);
156 for (uint i=0; i<interpolationAnimations_.size(); ++i) {
157 Scalar minInput, maxInput;
158 interpolationAnimations_[i]->getMinInput(minInput); interpolationAnimations_[i]->getMaxInput(maxInput);
160 unsigned int minFrame = (minInput * FPS);
161 unsigned int maxFrame = (maxInput * FPS);
164 if (_iFrame < minFrame || _iFrame > maxFrame)
167 if (interpolationAnimations_[i]) {
169 newPose = interpolationAnimations_[i]->pose(_iFrame - minFrame, referenceCopy);
171 newPose = interpolationAnimations_[i]->pose(_iFrame - minFrame, newPose);
175 delete referenceCopy;
178 newPose = _reference;
185 template<
class Po
intT>
187 if ( _index < interpolationAnimations_.size() )
188 return interpolationAnimations_[ _index ];
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.
virtual Pose * pose(unsigned int _iFrame)
get a pose
PoseT< PointT > Pose
Typedef for the pose template.
Stores a single animation.