Lugdunum  0.1.0
FreeMovement.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <lug/Core/Export.hpp>
5 #include <lug/Math/Vector.hpp>
6 #include <lug/Window/Window.hpp>
7 #include <lug/System/Time.hpp>
8 
9 namespace lug {
10 namespace Core {
11 
13 public:
14  explicit FreeMovement() = default;
15  ~FreeMovement() = default;
16 
20  void setTargetNode(lug::Graphics::Scene::Node& target);
21 
27  void setEventSource(lug::Window::Window& eventSource);
28 
29  void onFrame(const System::Time& elapsedTime);
30 
31 private:
32  lug::Graphics::Scene::Node* _target{nullptr};
33  lug::Window::Window* _eventSource{nullptr};
34  float _speed{0.005f};
35 
36  bool _hasFocus{false};
37  Math::Vec2i _lastMousePos{0, 0};
38 };
39 
41 
42 } // Core
43 } // lug
44 
Class for window.
Definition: Window.hpp:59
#define LUG_CORE_API
Definition: Export.hpp:11