50 #ifndef INTERPOLATIONANIMATIONT_HH
51 #define INTERPOLATIONANIMATIONT_HH
56 #include "../PoseT.hh"
57 #include "InterpolationT.hh"
58 #include "InterpolationMatrixManipulatorT.hh"
60 template<
class Po
intT>
68 typedef typename Point::value_type Scalar;
72 typedef std::vector<Scalar> TargetType;
83 virtual bool getMinInput(Scalar& _result);
84 virtual bool getMaxInput(Scalar& _result);
90 std::vector<int> influencedJoints_;
91 std::vector< Interpolator* > interpolators_;
94 std::map < Interpolator*, std::vector < TargetType > > precalculations_;
95 MatrixManipulator* matrixManipulator_;
98 std::map < unsigned int, Pose* > interpolatedPoses_;
103 static const int FPS = 60;
119 virtual Pose*
pose(
unsigned int _iFrame);
128 virtual Pose*
pose(
unsigned int _iFrame, Pose* _reference);
197 void addInfluencedJoint(
int _joint)
199 influencedJoints_.push_back(_joint);
202 bool isInfluenced(
int _joint);
204 std::vector<int>& influencedJoints();
222 Pose* getReference() {
return pose(0); }
224 virtual void clearPoseCache()
226 if (interpolatedPoses_.size() == 1 && interpolatedPoses_.find(0) != interpolatedPoses_.end())
229 if (interpolatedPoses_.find(0) != interpolatedPoses_.end()) {
232 if (interpolatedPoses_.size() > 1) {
233 typename std::map<unsigned int, Pose*>::iterator ip_it = interpolatedPoses_.begin();
235 for (; ip_it != interpolatedPoses_.end(); ++ip_it) {
236 delete ip_it->second;
237 interpolatedPoses_.erase(ip_it);
243 interpolatedPoses_.clear();
251 #if defined(INCLUDE_TEMPLATES) && !defined(INTERPOLATIONANIMATIONT_C)
252 #define INTERPOLATIONANIMATIONT_TEMPLATES
253 #include "InterpolationAnimationT.cc"
257 #endif //INTERPOLATIONANIMATIONT_HH
virtual Pose * pose(unsigned int _iFrame)
Returns a pointer to the pose calculated for the given frame.
unsigned int frameCount()
Returns the number of frames stored in this pose.
MatrixManipulator * matrixManipulator()
Get the matrix manipulator.
unsigned int calcAbsoluteMaxForInterpolator(uint _index)
Calculates the last frame that interpolator _index is responsible for.
Knows how to apply the values generated by an interpolator to a matrix. When playing back an Interpol...
A general pose, used to store the frames of the animation.
Interpolator * interpolator(unsigned int _index)
Get the i-th interpolator.
InterpolationAnimationT(const InterpolationAnimationT< PointT > &_other)
Copy constructor.
Stores a single animation.
void addInterpolator(InterpolationT< double > *_interpolator)
Add an interpolator.
virtual void updateFromGlobal(unsigned int _index)
Updates the local matrix using the global matrix.
virtual void insertJointAt(unsigned int _index)
Called by the skeleton as a new joint is inserted.
unsigned int interpolatorCount()
Get the number of interpolators.
virtual void removeJointAt(unsigned int _index)
Called by the skeleton as a joint is deleted.