Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2007-10-21 23:02:47 +0000
committerStijn Buys <ingar@osirion.org>2007-10-21 23:02:47 +0000
commita237a2d7723b94df6cd3e91401ec28388de6f1a0 (patch)
tree7da376d276d03fced7b94a807c0952fd32bcde08 /src/client/camera.h
parent084c6212afaa6f996091f36d0ff85ac845803a87 (diff)
namespace cleanup
Diffstat (limited to 'src/client/camera.h')
-rw-r--r--src/client/camera.h56
1 files changed, 39 insertions, 17 deletions
diff --git a/src/client/camera.h b/src/client/camera.h
index 63c7aa5..2e20c1b 100644
--- a/src/client/camera.h
+++ b/src/client/camera.h
@@ -1,44 +1,66 @@
-/* camera.h
- This file is part of the Osirion project
+/*
+ client/camera.h
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
*/
#ifndef __INCLUDED_CAMERA_H__
#define __INCLUDED_CAMERA_H__
-#include "common/vector3f.h"
+#include "gl/osiriongl.h"
+
+namespace client {
/// camera functions
/** The functions in this namespace performs the transformations
for the camera eye location. The camera always looks at (0,0,0)
*/
-namespace camera
+class Camera
{
+public:
+ /// enum indicating the camera mode
+ enum Mode {Free, Track};
+
/// draw the OpenGL camera transformation
- void draw(float elapsed);
+ static void draw(float elapsed);
/// rotate the camera left
- void rotate_left();
+ static void rotate_left();
/// rotate the camera right
- void rotate_right();
+ static void rotate_right();
/// rotate the camera up
- void rotate_up();
+ static void rotate_up();
/// rotate the camera down
- void rotate_down();
+ static void rotate_down();
/// switch to next camera mode
- void nextmode();
+ static void nextmode();
/// camera target
/** The location the camera is looking at */
- extern Vector3f target;
+ static gl::Vector3f target;
- /// horizontal viewing angle x/z plane
- extern float horiz_angle;
- /// vertical viewing angle z/y plane
- extern float vert_angle;
+ /// target yaw, angle in XZ plane, positive is looking left
+ static float yaw_target;
+ /// target pitch, angle in XZ plane, positive is looking left
+ static float pitch_target;
/// distance from the camera to the target
- /** The distance in game units from the eye of the camera to the target */
- extern float distance;
+ static float distance;
+
+protected:
+ /// default tracking pitch
+ static const float track_pitch;
+ /// default offset increment
+ static const float offset_inc;
+
+ /// current yaw, angle in XZ plane, positive is looking left
+ static float yaw;
+ /// current pitch, angle in XY, positive is looking up
+ static float pitch;
+
+ static Mode mode;
};
+
+} // namespace client
#endif // __INCLUDED_CAMERA_H__