[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[8] | 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 |
|
---|
[15] | 24 | namespace flair {
|
---|
| 25 | namespace simulator {
|
---|
[8] | 26 |
|
---|
[15] | 27 | class AnimPoursuite : public irr::scene::ISceneNodeAnimator {
|
---|
| 28 | public:
|
---|
| 29 | AnimPoursuite(const irr::scene::ISceneNode *parent,
|
---|
| 30 | float rotateSpeed = -500.0f, float zoomSpeed = 4.0f);
|
---|
| 31 | ~AnimPoursuite();
|
---|
[8] | 32 |
|
---|
[15] | 33 | void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
|
---|
| 34 | ISceneNodeAnimator *createClone(irr::scene::ISceneNode *node,
|
---|
| 35 | irr::scene::ISceneManager *newManager = 0);
|
---|
| 36 | bool MouseMoved(const irr::SEvent &event, irr::core::position2df MousePos);
|
---|
| 37 | void setPositionOffset(irr::core::vector3df newpos);
|
---|
| 38 | void setTargetOffset(irr::core::vector3df newpos);
|
---|
[8] | 39 |
|
---|
[15] | 40 | private:
|
---|
| 41 | virtual bool isEventReceiverEnabled(void) const { return true; }
|
---|
[8] | 42 |
|
---|
[15] | 43 | irr::core::vector3df pos_offset, target_offset;
|
---|
| 44 | bool LMouseKey;
|
---|
| 45 | irr::core::position2df RotateStart;
|
---|
| 46 | irr::core::position2df MousePos;
|
---|
| 47 | const irr::scene::ISceneNode *parent;
|
---|
| 48 | bool Rotating;
|
---|
| 49 | float RotY, RotZ;
|
---|
| 50 | float rotateSpeed;
|
---|
| 51 | float zoomSpeed;
|
---|
| 52 | float currentZoom;
|
---|
| 53 | float sat(float value);
|
---|
| 54 | };
|
---|
[8] | 55 |
|
---|
| 56 | } // end namespace simulator
|
---|
| 57 | } // end namespace flair
|
---|
| 58 |
|
---|
| 59 | #endif // ANIMPOURSUITE_H
|
---|