From a237a2d7723b94df6cd3e91401ec28388de6f1a0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 21 Oct 2007 23:02:47 +0000 Subject: namespace cleanup --- src/client/camera.h | 56 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 17 deletions(-) (limited to 'src/client/camera.h') 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__ -- cgit v1.2.3