Camera.h
Go to the documentation of this file.00001 #ifndef CAMERA_H_
00002 #define CAMERA_H_
00003
00004 enum camera_draw_mode
00005 {
00006 cd_wire, cd_solid, cd_texture, cd_lighting
00007 };
00008
00009 struct camera_t
00010 {
00011 int width, height;
00012
00013 bool timing;
00014
00015 Vector3 origin;
00016 Vector3 angles;
00017
00018 Vector3 color;
00019
00020 Vector3 forward, right;
00021 Vector3 vup, vpn, vright;
00022
00023 Matrix4 projection;
00024 Matrix4 modelview;
00025
00026 bool m_strafe;
00027 bool m_strafe_forward;
00028
00029 unsigned int movementflags;
00030 Timer m_keycontrol_timer;
00031 guint m_keymove_handler;
00032
00033 float fieldOfView;
00034
00035 DeferredMotionDelta m_mouseMove;
00036
00037 static void motionDelta (int x, int y, void* data)
00038 {
00039 Camera_mouseMove(*reinterpret_cast<camera_t*> (data), x, y);
00040 }
00041
00042 View* m_view;
00043 Callback m_update;
00044
00045 static camera_draw_mode draw_mode;
00046
00047 camera_t (View* view, const Callback& update) :
00048 width(0), height(0), timing(false), origin(0, 0, 0), angles(0, 0, 0), color(0, 0, 0), projection(
00049 g_matrix4_identity), modelview(g_matrix4_identity), movementflags(0), m_keymove_handler(0),
00050 fieldOfView(90.0f), m_mouseMove(motionDelta, this), m_view(view), m_update(update)
00051 {
00052 }
00053 };
00054
00055 #endif