00001
00002
00003
00004 #include "cbviz_util.H"
00005 #include "conf.H"
00006 #include "CCamera.H"
00007 #include "scripted_camera.H"
00008 #include "component_interface.H"
00009 #include <gmtl/Matrix.h>
00010
00011 #ifndef CAJUN_SIMVIEW_H
00012 #define CAJUN_SIMVIEW_H
00013
00014
00015
00016
00017
00018 namespace cajun
00019 {
00020 class simview_t
00021 {
00022 private:
00023 CCamera Camera;
00024 camera_style_t m_camera_style;
00025 double m_initial_camera_pos[3];
00026 double m_prev_pos[3];
00027 double m_azimuth_angle;
00028 double m_elevation_angle;
00029 bool m_first_time_hack;
00030 bool m_reset_origin;
00031
00032 double m_time;
00033 scripted_camera_t *m_script;
00034 bool m_scripted_camera_enabled;
00035
00036 world_state_t *m_world_state;
00037 bool m_static_mode;
00038 public:
00039 double m_zoom_by;
00040 double m_move_by;
00041 bool m_left_button_down;
00042 simview_t (conf_t &conf,
00043 world_state_t *ws_,
00044 char const *camera_script_file,
00045 bool static_mode);
00046 void init_data ();
00047 void set_view (double ref_pos_[3], double ref_orient_[3]);
00048 void change_view (int command, double value);
00049
00050 void move_lights (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
00051 void update_data (double bot_pos[3]);
00052
00053 class simview_interface_t : public component_interface_t
00054 {
00055 private:
00056 int mousepos[2];
00057 float m_slow_multiplier;
00058 float m_med_multiplier;
00059 float m_fast_multiplier;
00060 void note_left_mouse_button_position (int x, int y);
00061 public:
00062 simview_interface_t (conf_t &conf,
00063 world_state_t *ws_,
00064 char const *camera_script_file,
00065 bool static_mode);
00066 simview_t *m_simview;
00067 void init_data ()
00068 { m_simview->init_data (); }
00069 void mousebuttonhandler (int button, int state, int x,
00070 int y);
00071 void mousemotionhandler (int x, int y);
00072 void pressNormalKey (unsigned char key, int x, int y);
00073 void pressControlKey (int key, int x, int y, int mod);
00074 void get_camera_pos (double pos[3]);
00075 void get_camera_view (double view[3]);
00076 void get_camera_view_angles (double view_angles[2]);
00077 void set_view (double ref_pos_[3], double ref_orientation_[3])
00078 { m_simview->set_view (ref_pos_, ref_orientation_); }
00079 void move_lights (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
00080 { m_simview->move_lights (x, y, z, w); }
00081 void update_data (double bot_pos[3])
00082 { m_simview->update_data (bot_pos); }
00083 void display (double bot_pos[3]) {};
00084 void toggle_display () {};
00085 };
00086 };
00087 };
00088 #endif