aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/extantz/extantzCamera.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-27 11:18:26 +1000
committerDavid Walter Seikel2013-01-27 11:18:26 +1000
commit37be70434d2d1ddd6d691863740d64ddbf0b2921 (patch)
treea1081a593ad8e4ca09440f2ddba08506b8a28627 /ClientHamr/extantz/extantzCamera.h
parentClean up the rest of the object files. (diff)
downloadSledjHamr-37be70434d2d1ddd6d691863740d64ddbf0b2921.zip
SledjHamr-37be70434d2d1ddd6d691863740d64ddbf0b2921.tar.gz
SledjHamr-37be70434d2d1ddd6d691863740d64ddbf0b2921.tar.bz2
SledjHamr-37be70434d2d1ddd6d691863740d64ddbf0b2921.tar.xz
Move a bunch of stuff into the new cameraMove structure, and some clean ups.
Diffstat (limited to 'ClientHamr/extantz/extantzCamera.h')
-rw-r--r--ClientHamr/extantz/extantzCamera.h44
1 files changed, 9 insertions, 35 deletions
diff --git a/ClientHamr/extantz/extantzCamera.h b/ClientHamr/extantz/extantzCamera.h
index fe548d9..9d74236 100644
--- a/ClientHamr/extantz/extantzCamera.h
+++ b/ClientHamr/extantz/extantzCamera.h
@@ -28,6 +28,7 @@ typedef struct
28 float x, y, z; 28 float x, y, z;
29 float r, s, t; 29 float r, s, t;
30 float jump; 30 float jump;
31 float JumpSpeed, RotateSpeed, MoveSpeed;
31} cameraMove; 32} cameraMove;
32 33
33cameraMove *getCameraMove(ICameraSceneNode *camera); 34cameraMove *getCameraMove(ICameraSceneNode *camera);
@@ -46,15 +47,15 @@ namespace irr
46{ 47{
47namespace scene 48namespace scene
48{ 49{
49 ICameraSceneNode *addExtantzCamera(ISceneManager* sm, ISceneNode* parent, f32 rotateSpeed, f32 moveSpeed, s32 id, bool noVerticalMovement, f32 jumpSpeed, bool invertMouseY, bool makeActive); 50 ICameraSceneNode *addExtantzCamera(ISceneManager* sm, ISceneNode* parent, s32 id);
50 51
51 class extantzCamera : public ISceneNodeAnimator 52 class extantzCamera : public ISceneNodeAnimator
52 { 53 {
53 public: 54 public:
54 55
55 //! Constructor 56 //! Constructor
56// extantzCamera(gui::ICursorControl* cursorControl, f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f, bool noVerticalMovement=false, bool invertY=false); 57// extantzCamera(gui::ICursorControl* cursorControl);
57 extantzCamera(f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f, bool noVerticalMovement=false, bool invertY=false); 58 extantzCamera();
58 59
59 //! Destructor 60 //! Destructor
60 virtual ~extantzCamera(); 61 virtual ~extantzCamera();
@@ -62,26 +63,6 @@ namespace scene
62 //! Animates the scene node, currently only works on cameras 63 //! Animates the scene node, currently only works on cameras
63 virtual void animateNode(ISceneNode* node, u32 timeMs); 64 virtual void animateNode(ISceneNode* node, u32 timeMs);
64 65
65 //! Returns the speed of movement in units per second
66 virtual f32 getMoveSpeed() const;
67
68 //! Sets the speed of movement in units per second
69 virtual void setMoveSpeed(f32 moveSpeed);
70
71 //! Returns the rotation speed
72 virtual f32 getRotateSpeed() const;
73
74 //! Set the rotation speed
75 virtual void setRotateSpeed(f32 rotateSpeed);
76
77 //! Sets whether vertical movement should be allowed.
78 virtual void setVerticalMovement(bool allow);
79
80 //! Sets whether the Y axis of the mouse should be inverted.
81 /** If enabled then moving the mouse down will cause
82 the camera to look up. It is disabled by default. */
83 virtual void setInvertMouse(bool invert);
84
85 //! This animator will receive events when attached to the active camera 66 //! This animator will receive events when attached to the active camera
86 virtual bool isEventReceiverEnabled() const 67 virtual bool isEventReceiverEnabled() const
87 { 68 {
@@ -100,23 +81,16 @@ namespace scene
100 done with it. */ 81 done with it. */
101 virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0); 82 virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
102 83
84 bool NoVerticalMovement;
85 // -1.0f for inverted mouse, defaults to 1.0f
86 f32 MouseYDirection;
87
103 cameraMove move; 88 cameraMove move;
104 89
105 private: 90 private:
106 f32 MaxVerticalAngle; 91 f32 MaxVerticalAngle;
107
108 f32 MoveSpeed;
109 f32 RotateSpeed;
110 f32 JumpSpeed;
111 // -1.0f for inverted mouse, defaults to 1.0f
112 f32 MouseYDirection;
113
114 s32 LastAnimationTime; 92 s32 LastAnimationTime;
115 93// core::position2d<f32> CenterCursor, CursorPos;
116 core::position2d<f32> CenterCursor, CursorPos;
117
118 bool firstUpdate;
119 bool NoVerticalMovement;
120 }; 94 };
121}; 95};
122}; 96};