mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Merge branch 'master' into feature/disabled-updates
This commit is contained in:
@@ -68,7 +68,6 @@ protected:
|
||||
DelayedVariable<glm::dvec2, double> velocity;
|
||||
};
|
||||
|
||||
|
||||
double _sensitivity = 0.0;
|
||||
|
||||
InteractionState _globalRotationState;
|
||||
|
||||
@@ -106,12 +106,46 @@ private:
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
std::string to_string(
|
||||
const openspace::interaction::JoystickCameraStates::AxisType& value);
|
||||
inline std::string to_string(
|
||||
const openspace::interaction::JoystickCameraStates::AxisType& value)
|
||||
{
|
||||
using T = openspace::interaction::JoystickCameraStates::AxisType;
|
||||
switch (value) {
|
||||
case T::None: return "None";
|
||||
case T::OrbitX: return "Orbit X";
|
||||
case T::OrbitY: return "Orbit Y";
|
||||
case T::ZoomIn: return "Zoom In";
|
||||
case T::ZoomOut: return "Zoom Out";
|
||||
case T::LocalRollX: return "LocalRoll X";
|
||||
case T::LocalRollY: return "LocalRoll Y";
|
||||
case T::GlobalRollX: return "GlobalRoll X";
|
||||
case T::GlobalRollY: return "GlobalRoll Y";
|
||||
case T::PanX: return "Pan X";
|
||||
case T::PanY: return "Pan Y";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
openspace::interaction::JoystickCameraStates::AxisType
|
||||
from_string(const std::string& string);
|
||||
constexpr openspace::interaction::JoystickCameraStates::AxisType
|
||||
from_string(std::string_view string)
|
||||
{
|
||||
using T = openspace::interaction::JoystickCameraStates::AxisType;
|
||||
|
||||
if (string == "None") { return T::None; }
|
||||
if (string == "Orbit X") { return T::OrbitX; }
|
||||
if (string == "Orbit Y") { return T::OrbitY; }
|
||||
if (string == "Zoom In") { return T::ZoomIn; }
|
||||
if (string == "Zoom Out") { return T::ZoomOut; }
|
||||
if (string == "LocalRoll X") { return T::LocalRollX; }
|
||||
if (string == "LocalRoll Y") { return T::LocalRollY; }
|
||||
if (string == "GlobalRoll X") { return T::GlobalRollX; }
|
||||
if (string == "GlobalRoll Y") { return T::GlobalRollY; }
|
||||
if (string == "Pan X") { return T::PanX; }
|
||||
if (string == "Pan Y") { return T::PanY; }
|
||||
|
||||
throw RuntimeError("Unkonwn axis type '" + std::string(string) + "'");
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
#define __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
#include <ghoul/misc/stringconversion.h>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -113,10 +115,25 @@ struct JoystickInputStates : public std::array<JoystickInputState, MaxJoysticks>
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
std::string to_string(const openspace::interaction::JoystickAction& value);
|
||||
inline std::string to_string(const openspace::interaction::JoystickAction& value) {
|
||||
switch (value) {
|
||||
case openspace::interaction::JoystickAction::Idle: return "Idle";
|
||||
case openspace::interaction::JoystickAction::Press: return "Press";
|
||||
case openspace::interaction::JoystickAction::Repeat: return "Repeat";
|
||||
case openspace::interaction::JoystickAction::Release: return "Release";
|
||||
default: throw MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
openspace::interaction::JoystickAction from_string(const std::string& str);
|
||||
constexpr openspace::interaction::JoystickAction from_string(std::string_view string) {
|
||||
if (string == "Idle") { return openspace::interaction::JoystickAction::Idle; }
|
||||
if (string == "Press") { return openspace::interaction::JoystickAction::Press; }
|
||||
if (string == "Repeat") { return openspace::interaction::JoystickAction::Repeat; }
|
||||
if (string == "Release") { return openspace::interaction::JoystickAction::Release; }
|
||||
|
||||
throw RuntimeError("Unknown action '" + std::string(string) + "'");
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
|
||||
@@ -106,12 +106,46 @@ private:
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
std::string to_string(
|
||||
const openspace::interaction::WebsocketCameraStates::AxisType& type);
|
||||
inline std::string to_string(
|
||||
const openspace::interaction::WebsocketCameraStates::AxisType& type)
|
||||
{
|
||||
using T = openspace::interaction::WebsocketCameraStates::AxisType;
|
||||
switch (type) {
|
||||
case T::None: return "None";
|
||||
case T::OrbitX: return "Orbit X";
|
||||
case T::OrbitY: return "Orbit Y";
|
||||
case T::ZoomIn: return "Zoom In";
|
||||
case T::ZoomOut: return "Zoom Out";
|
||||
case T::LocalRollX: return "LocalRoll X";
|
||||
case T::LocalRollY: return "LocalRoll Y";
|
||||
case T::GlobalRollX: return "GlobalRoll X";
|
||||
case T::GlobalRollY: return "GlobalRoll Y";
|
||||
case T::PanX: return "Pan X";
|
||||
case T::PanY: return "Pan Y";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
openspace::interaction::WebsocketCameraStates::AxisType
|
||||
from_string(const std::string& string);
|
||||
constexpr openspace::interaction::WebsocketCameraStates::AxisType from_string(
|
||||
std::string_view string)
|
||||
{
|
||||
using T = openspace::interaction::WebsocketCameraStates::AxisType;
|
||||
|
||||
if (string == "None") { return T::None; }
|
||||
if (string == "Orbit X") { return T::OrbitX; }
|
||||
if (string == "Orbit Y") { return T::OrbitY; }
|
||||
if (string == "Zoom In") { return T::ZoomIn; }
|
||||
if (string == "Zoom Out") { return T::ZoomOut; }
|
||||
if (string == "LocalRoll X") { return T::LocalRollX; }
|
||||
if (string == "LocalRoll Y") { return T::LocalRollY; }
|
||||
if (string == "GlobalRoll X") { return T::GlobalRollX; }
|
||||
if (string == "GlobalRoll Y") { return T::GlobalRollY; }
|
||||
if (string == "Pan X") { return T::PanX; }
|
||||
if (string == "Pan Y") { return T::PanY; }
|
||||
|
||||
throw RuntimeError("Unknown axis type '" + std::string(string) + "'");
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef __OPENSPACE_CORE___WEBSOCKETINPUTSTATE___H__
|
||||
#define __OPENSPACE_CORE___WEBSOCKETINPUTSTATE___H__
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
#include <ghoul/misc/stringconversion.h>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -115,10 +117,25 @@ struct WebsocketInputStates : public std::unordered_map<size_t, WebsocketInputSt
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
std::string to_string(const openspace::interaction::WebsocketAction& action);
|
||||
inline std::string to_string(const openspace::interaction::WebsocketAction& action) {
|
||||
switch (action) {
|
||||
case openspace::interaction::WebsocketAction::Idle: return "Idle";
|
||||
case openspace::interaction::WebsocketAction::Press: return "Press";
|
||||
case openspace::interaction::WebsocketAction::Repeat: return "Repeat";
|
||||
case openspace::interaction::WebsocketAction::Release: return "Release";
|
||||
default: throw MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
openspace::interaction::WebsocketAction from_string(const std::string& str);
|
||||
constexpr openspace::interaction::WebsocketAction from_string(std::string_view string) {
|
||||
if (string == "Idle") { return openspace::interaction::WebsocketAction::Idle; }
|
||||
if (string == "Press") { return openspace::interaction::WebsocketAction::Press; }
|
||||
if (string == "Repeat") { return openspace::interaction::WebsocketAction::Repeat; }
|
||||
if (string == "Release") { return openspace::interaction::WebsocketAction::Release; }
|
||||
|
||||
throw RuntimeError("Unknown action '" + std::string(string) + "'");
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
|
||||
Reference in New Issue
Block a user