]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/designer.h
Use a GL::Camera
[r2c2.git] / source / designer / designer.h
index 37a4a1e6524456c88ce90dbc74c408a2489abc96..a72316e128044aea2e182190a59008f60712950c 100644 (file)
@@ -11,6 +11,7 @@ Distributed under the GPL
 #include <string>
 #include <msp/core/application.h>
 #include <msp/gbase/simplewindow.h>
+#include <msp/gl/camera.h>
 #include <msp/gl/font.h>
 #include <msp/gl/light.h>
 #include <msp/gl/lighting.h>
@@ -24,6 +25,7 @@ Distributed under the GPL
 #include "libmarklin/layout.h"
 #include "3d/layout.h"
 #include "3d/track.h"
+#include "cameracontroller.h"
 #include "manipulator.h"
 #include "measure.h"
 #include "selection.h"
@@ -59,6 +61,7 @@ private:
        Msp::GL::Object *base_object;
        Marklin::Route *cur_route;
        Msp::GL::Pipeline *pipeline;
+       Msp::GL::Camera camera;
        Msp::GL::Lighting lighting;
        Msp::GL::Light light;
 
@@ -67,17 +70,9 @@ private:
        Manipulator manipulator;
        Measure measure;
        Input *input;
-
-       float cam_yaw;
-       float cam_pitch;
-       Marklin::Point cam_pos;
+       CameraController camera_ctl;
 
        bool shift;
-       int move_x;
-       int move_y;
-       int zoom;
-       int rotate;
-       int pitch;
        int pointer_x;
        int pointer_y;
 
@@ -101,14 +96,13 @@ public:
        Marklin::Route *get_current_route() const { return cur_route; }
        void add_selection_to_route();
 
-       void map_pointer_coords(int, int, float &, float &);
+       Marklin::Point map_pointer_coords(int, int);
 private:
        void tick();
        void key_press(unsigned, unsigned, wchar_t);
        void key_release(unsigned, unsigned);
        void button_press(int, int, unsigned, unsigned);
        void pointer_motion(int, int);
-       void project_3d();
        void apply_camera();
        void render();
        Marklin::Track3D *pick_track(int, int);
@@ -123,6 +117,7 @@ private:
        void turnout_id_accept();
        void sensor_id_accept();
        void input_dismiss();
+       void view_all();
 };
 
 #endif