diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h | 232 |
1 files changed, 116 insertions, 116 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h b/libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h index 495a77b..8eb7ade 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h | |||
@@ -1,116 +1,116 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ | 5 | #ifndef __C_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ |
6 | #define __C_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ | 6 | #define __C_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ |
7 | 7 | ||
8 | #include "ISceneNodeAnimatorCameraMaya.h" | 8 | #include "ISceneNodeAnimatorCameraMaya.h" |
9 | #include "ICameraSceneNode.h" | 9 | #include "ICameraSceneNode.h" |
10 | #include "vector2d.h" | 10 | #include "vector2d.h" |
11 | 11 | ||
12 | namespace irr | 12 | namespace irr |
13 | { | 13 | { |
14 | 14 | ||
15 | namespace gui | 15 | namespace gui |
16 | { | 16 | { |
17 | class ICursorControl; | 17 | class ICursorControl; |
18 | } | 18 | } |
19 | 19 | ||
20 | namespace scene | 20 | namespace scene |
21 | { | 21 | { |
22 | 22 | ||
23 | //! Special scene node animator for FPS cameras | 23 | //! Special scene node animator for FPS cameras |
24 | /** This scene node animator can be attached to a camera to make it act | 24 | /** This scene node animator can be attached to a camera to make it act |
25 | like a 3d modelling tool camera | 25 | like a 3d modelling tool camera |
26 | */ | 26 | */ |
27 | class CSceneNodeAnimatorCameraMaya : public ISceneNodeAnimatorCameraMaya | 27 | class CSceneNodeAnimatorCameraMaya : public ISceneNodeAnimatorCameraMaya |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | //! Constructor | 30 | //! Constructor |
31 | CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, f32 rotateSpeed = -1500.f, | 31 | CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, f32 rotateSpeed = -1500.f, |
32 | f32 zoomSpeed = 200.f, f32 translationSpeed = 1500.f, f32 distance=70.f); | 32 | f32 zoomSpeed = 200.f, f32 translationSpeed = 1500.f, f32 distance=70.f); |
33 | 33 | ||
34 | //! Destructor | 34 | //! Destructor |
35 | virtual ~CSceneNodeAnimatorCameraMaya(); | 35 | virtual ~CSceneNodeAnimatorCameraMaya(); |
36 | 36 | ||
37 | //! Animates the scene node, currently only works on cameras | 37 | //! Animates the scene node, currently only works on cameras |
38 | virtual void animateNode(ISceneNode* node, u32 timeMs); | 38 | virtual void animateNode(ISceneNode* node, u32 timeMs); |
39 | 39 | ||
40 | //! Event receiver | 40 | //! Event receiver |
41 | virtual bool OnEvent(const SEvent& event); | 41 | virtual bool OnEvent(const SEvent& event); |
42 | 42 | ||
43 | //! Returns the speed of movement in units per millisecond | 43 | //! Returns the speed of movement in units per millisecond |
44 | virtual f32 getMoveSpeed() const; | 44 | virtual f32 getMoveSpeed() const; |
45 | 45 | ||
46 | //! Sets the speed of movement in units per millisecond | 46 | //! Sets the speed of movement in units per millisecond |
47 | virtual void setMoveSpeed(f32 moveSpeed); | 47 | virtual void setMoveSpeed(f32 moveSpeed); |
48 | 48 | ||
49 | //! Returns the rotation speed | 49 | //! Returns the rotation speed |
50 | virtual f32 getRotateSpeed() const; | 50 | virtual f32 getRotateSpeed() const; |
51 | 51 | ||
52 | //! Set the rotation speed | 52 | //! Set the rotation speed |
53 | virtual void setRotateSpeed(f32 rotateSpeed); | 53 | virtual void setRotateSpeed(f32 rotateSpeed); |
54 | 54 | ||
55 | //! Returns the zoom speed | 55 | //! Returns the zoom speed |
56 | virtual f32 getZoomSpeed() const; | 56 | virtual f32 getZoomSpeed() const; |
57 | 57 | ||
58 | //! Set the zoom speed | 58 | //! Set the zoom speed |
59 | virtual void setZoomSpeed(f32 zoomSpeed); | 59 | virtual void setZoomSpeed(f32 zoomSpeed); |
60 | 60 | ||
61 | //! Returns the current distance, i.e. orbit radius | 61 | //! Returns the current distance, i.e. orbit radius |
62 | virtual f32 getDistance() const; | 62 | virtual f32 getDistance() const; |
63 | 63 | ||
64 | //! Set the distance | 64 | //! Set the distance |
65 | virtual void setDistance(f32 distance); | 65 | virtual void setDistance(f32 distance); |
66 | 66 | ||
67 | //! This animator will receive events when attached to the active camera | 67 | //! This animator will receive events when attached to the active camera |
68 | virtual bool isEventReceiverEnabled() const | 68 | virtual bool isEventReceiverEnabled() const |
69 | { | 69 | { |
70 | return true; | 70 | return true; |
71 | } | 71 | } |
72 | 72 | ||
73 | //! Returns type of the scene node | 73 | //! Returns type of the scene node |
74 | virtual ESCENE_NODE_ANIMATOR_TYPE getType() const | 74 | virtual ESCENE_NODE_ANIMATOR_TYPE getType() const |
75 | { | 75 | { |
76 | return ESNAT_CAMERA_MAYA; | 76 | return ESNAT_CAMERA_MAYA; |
77 | } | 77 | } |
78 | 78 | ||
79 | //! Creates a clone of this animator. | 79 | //! Creates a clone of this animator. |
80 | /** Please note that you will have to drop | 80 | /** Please note that you will have to drop |
81 | (IReferenceCounted::drop()) the returned pointer after calling | 81 | (IReferenceCounted::drop()) the returned pointer after calling |
82 | this. */ | 82 | this. */ |
83 | virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0); | 83 | virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | 86 | ||
87 | void allKeysUp(); | 87 | void allKeysUp(); |
88 | void animate(); | 88 | void animate(); |
89 | bool isMouseKeyDown(s32 key) const; | 89 | bool isMouseKeyDown(s32 key) const; |
90 | 90 | ||
91 | bool MouseKeys[3]; | 91 | bool MouseKeys[3]; |
92 | 92 | ||
93 | gui::ICursorControl *CursorControl; | 93 | gui::ICursorControl *CursorControl; |
94 | scene::ICameraSceneNode* OldCamera; | 94 | scene::ICameraSceneNode* OldCamera; |
95 | core::vector3df OldTarget; | 95 | core::vector3df OldTarget; |
96 | core::vector3df LastCameraTarget; // to find out if the camera target was moved outside this animator | 96 | core::vector3df LastCameraTarget; // to find out if the camera target was moved outside this animator |
97 | core::position2df RotateStart; | 97 | core::position2df RotateStart; |
98 | core::position2df ZoomStart; | 98 | core::position2df ZoomStart; |
99 | core::position2df TranslateStart; | 99 | core::position2df TranslateStart; |
100 | core::position2df MousePos; | 100 | core::position2df MousePos; |
101 | f32 ZoomSpeed; | 101 | f32 ZoomSpeed; |
102 | f32 RotateSpeed; | 102 | f32 RotateSpeed; |
103 | f32 TranslateSpeed; | 103 | f32 TranslateSpeed; |
104 | f32 CurrentZoom; | 104 | f32 CurrentZoom; |
105 | f32 RotX, RotY; | 105 | f32 RotX, RotY; |
106 | bool Zooming; | 106 | bool Zooming; |
107 | bool Rotating; | 107 | bool Rotating; |
108 | bool Moving; | 108 | bool Moving; |
109 | bool Translating; | 109 | bool Translating; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | } // end namespace scene | 112 | } // end namespace scene |
113 | } // end namespace irr | 113 | } // end namespace irr |
114 | 114 | ||
115 | #endif | 115 | #endif |
116 | 116 | ||