OSDN Git Service

fix cmake/Macros.cmake
[moflib/moflib.git] / moflib-1.0 / moflib / moflib / mof / stream / Rotation3D.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 Rotation3D : 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         Rotation3D(
19                 const std::pair<mof::FrameNumber , mof::Vector3D>& front , 
20                 const std::pair<mof::FrameNumber , mof::Vector3D>& back  
21                 )
22         {
23                 m_body = mof::makeKeyFrameAnimationHandler<mof::Vector3D>
24         (
25                         front , back , &mof::linerInterpolate<mof::Vector3D> 
26                 );
27         }
28     
29     Rotation3D
30     (
31             const mof::Manipulator<mof::Vector3D>::Handler&  body
32         )
33     : m_body( body )
34         {
35         }
36  
37         virtual mof::Matrix3D value( mof::FrameNumber frame) const{
38                 return mof::Matrix3D::createRotation(m_body->value(frame));
39         }
40  
41  
42         /*mof::FrameNumber getFinalKeyFrameNumber(){
43                 return m_pBody->getFinalKeyFrameNumber();
44         }*/
45  
46  
47  };
48  
49  
50  
51  
52  } //namespace mof
53