mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Do some more cleanup in the interactionfolder
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
namespace openspace::interaction {
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* This handler is responsible for keeping track of the different input states provided
|
||||
* through the software's interaction system.
|
||||
*/
|
||||
class InteractionHandler: public properties::PropertyOwner {
|
||||
public:
|
||||
|
||||
@@ -31,19 +31,18 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
// This class represents the global input state of interaction devices
|
||||
/**
|
||||
* This class represents the global input state of keyboard interaction devices.
|
||||
*/
|
||||
class KeyboardInputState {
|
||||
public:
|
||||
// Callback functions
|
||||
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
|
||||
// Accessors
|
||||
const std::vector<std::pair<Key, KeyModifier>>& pressedKeys() const;
|
||||
bool isKeyPressed(std::pair<Key, KeyModifier> keyModPair) const;
|
||||
bool isKeyPressed(Key key) const;
|
||||
|
||||
private:
|
||||
// Input from keyboard
|
||||
std::vector<std::pair<Key, KeyModifier>> _keysDown;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,22 +31,21 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
// This class represents the global input state of interaction devices
|
||||
/**
|
||||
* This class represents the global input state of mouse interaction devices.
|
||||
*/
|
||||
class MouseInputState {
|
||||
public:
|
||||
// Callback functions
|
||||
void mouseButtonCallback(MouseButton button, MouseAction action);
|
||||
void mousePositionCallback(double mouseX, double mouseY);
|
||||
void mouseScrollWheelCallback(double mouseScrollDelta);
|
||||
|
||||
// Accessors
|
||||
const std::vector<MouseButton>& pressedMouseButtons() const;
|
||||
glm::dvec2 mousePosition() const;
|
||||
double mouseScrollDelta() const;
|
||||
bool isMouseButtonPressed(MouseButton mouseButton) const;
|
||||
|
||||
private:
|
||||
// Input from mouse
|
||||
std::vector<MouseButton> _mouseButtonsDown;
|
||||
glm::dvec2 _mousePosition = glm::dvec2(0.0);
|
||||
double _mouseScrollDelta = 0.0;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
#include <openspace/interaction/interpolator.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalinputhandler.h>
|
||||
#include <openspace/properties/misc/optionproperty.h>
|
||||
#include <openspace/properties/misc/stringproperty.h>
|
||||
#include <openspace/properties/misc/triggerproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/util/interpolator.h>
|
||||
#include <openspace/util/syncdata.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <optional>
|
||||
|
||||
Reference in New Issue
Block a user