| 1 | // %flair:license{
|
---|
| 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
| 4 | // %flair:license}
|
---|
| 5 | // created: 2012/08/21
|
---|
| 6 | // filename: AnimPoursuite.h
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: classe definissant une animation poursuite pour camera
|
---|
| 14 | //
|
---|
| 15 | /*********************************************************************/
|
---|
| 16 |
|
---|
| 17 | #ifndef ANIMPOURSUITE_H
|
---|
| 18 | #define ANIMPOURSUITE_H
|
---|
| 19 |
|
---|
| 20 | #include <ISceneNodeAnimator.h>
|
---|
| 21 | #include <position2d.h>
|
---|
| 22 | #include <vector3d.h>
|
---|
| 23 |
|
---|
| 24 | namespace flair
|
---|
| 25 | {
|
---|
| 26 | namespace simulator
|
---|
| 27 | {
|
---|
| 28 |
|
---|
| 29 | class AnimPoursuite : public irr::scene::ISceneNodeAnimator
|
---|
| 30 | {
|
---|
| 31 | public:
|
---|
| 32 | AnimPoursuite(const irr::scene::ISceneNode* parent,float rotateSpeed = -500.0f, float zoomSpeed = 4.0f);
|
---|
| 33 | ~AnimPoursuite();
|
---|
| 34 |
|
---|
| 35 | void animateNode(irr::scene::ISceneNode* node, irr::u32 timeMs);
|
---|
| 36 | ISceneNodeAnimator* createClone(irr::scene::ISceneNode* node,irr::scene::ISceneManager* newManager=0);
|
---|
| 37 | bool MouseMoved(const irr::SEvent& event,irr::core::position2df MousePos);
|
---|
| 38 | void setPositionOffset(irr::core::vector3df newpos);
|
---|
| 39 | void setTargetOffset(irr::core::vector3df newpos);
|
---|
| 40 |
|
---|
| 41 | private:
|
---|
| 42 | virtual bool isEventReceiverEnabled(void) const
|
---|
| 43 | {
|
---|
| 44 | return true;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | irr::core::vector3df pos_offset,target_offset;
|
---|
| 48 | bool LMouseKey;
|
---|
| 49 | irr::core::position2df RotateStart;
|
---|
| 50 | irr::core::position2df MousePos;
|
---|
| 51 | const irr::scene::ISceneNode* parent;
|
---|
| 52 | bool Rotating;
|
---|
| 53 | float RotY,RotZ;
|
---|
| 54 | float rotateSpeed;
|
---|
| 55 | float zoomSpeed;
|
---|
| 56 | float currentZoom;
|
---|
| 57 | float sat(float value);
|
---|
| 58 | };
|
---|
| 59 |
|
---|
| 60 | } // end namespace simulator
|
---|
| 61 | } // end namespace flair
|
---|
| 62 |
|
---|
| 63 | #endif // ANIMPOURSUITE_H
|
---|