OSDN Git Service

fix cmake/Macros.cmake
[moflib/moflib.git] / moflib-1.0 / src / mof / stream / Translation3D.hpp
1  #pragma once
2  #include <map>
3  #include <stdexcept>
4  #include <boost/function/function2.hpp>
5  #include "mof/stream/KeyFrameAnimation.hpp"
6  #include "mof/Matrix3D.hpp"
7  
8  
9  
10  namespace mof{
11  
12  
13  class Translation3D : public mof::Manipulator<mof::Matrix3D>{
14         mof::Manipulator<mof::Vector3D>::Handler  m_body;
15  public:
16         typedef std::pair<mof::frame_t, mof::Vector3D> keyframe_t;
17  
18         Translation3D
19     (
20                 const std::pair<mof::FrameNumber , mof::Vector3D>& front , 
21                 const std::pair<mof::FrameNumber , mof::Vector3D>& back  
22         )
23         {
24                 m_body = mof::makeKeyFrameAnimationHandler<mof::Vector3D>
25         (
26                     front , back , &mof::linerInterpolate<mof::Vector3D>
27                 );
28         }
29  
30     Translation3D
31     (
32             const mof::Manipulator<mof::Vector3D>::Handler&  body
33         )
34     : m_body( body )
35         {
36         }
37
38         virtual mof::Matrix3D value( mof::FrameNumber frame) const{
39                 return mof::Matrix3D::createTranslation(m_body->value(frame));
40         }
41  
42         /*mof::FrameNumber getFinalKeyFrameNumber(){
43                 return m_pBody->getFinalKeyFrameNumber();
44         }*/
45
46  
47  };
48  
49  
50  
51  
52  } //namespace mof
53