cameraAnimation.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQ_PLY_CAMERAANIMATION_H
00019 #define EQ_PLY_CAMERAANIMATION_H
00020 #include <eq/eq.h>
00021 #include <eq/base/base.h>
00022 #include <math.h>
00023 #include <string>
00024
00025 namespace eqPly
00026 {
00027
00032 class CameraAnimation
00033 {
00034 public:
00035 struct Step;
00036
00037 CameraAnimation() : _curStep( 0 ), _curFrame( 0 ) {}
00038
00039 bool loadAnimation( const std::string& fileName );
00040
00041 bool isValid() const { return !_steps.empty(); }
00042
00043 Step getNextStep();
00044
00045 const eq::Vector3f& getModelRotation() const { return _modelRotation;}
00046
00047 struct Step
00048 {
00049 Step()
00050 : frame( 0 )
00051 , translation( eq::Vector3f( .0f, .0f, -1.0f ))
00052 , rotation( eq::Vector3f( .0f, .0f, .0f )){}
00053
00054 Step( int frame_, const eq::Vector3f& translation_,
00055 const eq::Vector3f& rotation_ )
00056 : frame( frame_ )
00057 , translation( translation_ ),
00058 rotation( rotation_ ){}
00059
00060 int frame;
00061 eq::Vector3f translation;
00062 eq::Vector3f rotation;
00063 };
00064
00065 private:
00066 eq::Vector3f _modelRotation;
00067 std::vector< Step > _steps;
00068 uint32_t _curStep;
00069 int32_t _curFrame;
00070 };
00071
00072 }
00073
00074 #endif // EQ_PLY_CAMERAANIMATION_H
00075