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; // background
00019 
00020         Vector3 forward, right; // move matrix (TTimo: used to have up but it was not updated)
00021         Vector3 vup, vpn, vright; // view matrix (taken from the modelview matrix)
00022 
00023         Matrix4 projection;
00024         Matrix4 modelview;
00025 
00026         bool m_strafe; // true when in strafemode toggled by the ctrl-key
00027         bool m_strafe_forward; // true when in strafemode by ctrl-key and shift is pressed for forward strafing
00028 
00029         unsigned int movementflags; // movement flags
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 /* CAMERA_H_ */

Generated by  doxygen 1.6.2