X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fcameracontroller.h;h=5b6c3155314c74b2eb5b705aa90eabbeab67eee2;hb=dfeb2d2896fe18e55b1f6c4a8028b7cfb878dede;hp=beed68a483c247f106797cc4e4557c8a9e4e422e;hpb=d6ad508feda1aaa9b2ac2ca2d303c8d28d3094b9;p=r2c2.git diff --git a/source/designer/cameracontroller.h b/source/designer/cameracontroller.h index beed68a..5b6c315 100644 --- a/source/designer/cameracontroller.h +++ b/source/designer/cameracontroller.h @@ -1,17 +1,11 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef CAMERACONTROLLER_H_ #define CAMERACONTROLLER_H_ -#include +#include #include - -class Designer; +#include +#include +#include "3d/view.h" /** Moves the camera based on keyboard and mouse events. Controls are as follows: @@ -38,17 +32,20 @@ private: DISTANCE }; - Designer &designer; - Msp::Graphics::EventSource &event_source; + R2C2::View3D &view; + Msp::Input::Keyboard &keyboard; + Msp::Input::Mouse &mouse; Msp::GL::Camera &camera; int move_x; int move_y; int pointer_x; int pointer_y; + bool shift_pressed; + bool ctrl_pressed; DragMode drag_mode; public: - CameraController(Designer &, Msp::Graphics::EventSource &, Msp::GL::Camera &); + CameraController(R2C2::View3D &, Msp::Input::Keyboard &, Msp::Input::Mouse &); void top_down(); void set_look_direction(const Msp::GL::Vector3 &); @@ -56,16 +53,16 @@ public: void move(float, float); void adjust_distance(float); - void rotate(float); - void pitch(float); + void rotate(const R2C2::Angle &); + void pitch(const R2C2::Angle &); void tick(float); private: - void button_press(int, int, unsigned, unsigned); - void button_release(int, int, unsigned, unsigned); - void pointer_motion(int, int); - void key_press(unsigned, unsigned, wchar_t); - void key_release(unsigned, unsigned); + void button_press(unsigned); + void button_release(unsigned); + void axis_motion(unsigned, float, float); + void key_press(unsigned); + void key_release(unsigned); public: /** Return the focus point, i.e. where the look ray intersects with ground. */