mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 12:10:52 -06:00
Start cleaning among the camera states code
This commit is contained in:
@@ -22,37 +22,40 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___DELAYEDVARIABLE___H__
|
||||
#define __OPENSPACE_CORE___DELAYEDVARIABLE___H__
|
||||
#ifndef __OPENSPACE_CORE___DAMPENEDVELOCITY___H__
|
||||
#define __OPENSPACE_CORE___DAMPENEDVELOCITY___H__
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
/**
|
||||
* Class that acts as a smoothing filter to a variable. The filter has a step response on
|
||||
* a form that resembles the function y = 1-e^(-t/scale). The variable will be updated as
|
||||
* soon as it is set to a value (calling the set() function).
|
||||
* This class acts as a smoothing filter to a variable representing a velocity.
|
||||
* If friction is enabled, a decelleration can also be applied over time.
|
||||
*
|
||||
* The filter has a step response on a form that resembles the function
|
||||
* y = 1-e^(-t/scale). The variable will be updated as soon as it is set to a
|
||||
* value (calling the set() function).
|
||||
*/
|
||||
template <typename T, typename ScaleType>
|
||||
class DelayedVariable {
|
||||
template <typename T>
|
||||
class DampenedVelocity {
|
||||
public:
|
||||
DelayedVariable(ScaleType scaleFactor, ScaleType friction);
|
||||
DampenedVelocity(double scaleFactor, bool useFriction);
|
||||
|
||||
void set(T value, double dt);
|
||||
void decelerate(double dt);
|
||||
void setHard(T value);
|
||||
void setFriction(ScaleType friction);
|
||||
void setScaleFactor(ScaleType scaleFactor);
|
||||
void setImmediate(T value);
|
||||
void setFriction(bool enabled);
|
||||
void setScaleFactor(double scaleFactor);
|
||||
T get() const;
|
||||
|
||||
private:
|
||||
ScaleType _scaleFactor;
|
||||
ScaleType _friction;
|
||||
double _scaleFactor;
|
||||
bool _frictionEnabled;
|
||||
T _targetValue = T(0);
|
||||
T _currentValue = T(0);
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#include "delayedvariable.inl"
|
||||
#include "dampenedvelocity.inl"
|
||||
|
||||
#endif // __OPENSPACE_CORE___DELAYEDVARIABLE___H__
|
||||
#endif // __OPENSPACE_CORE___DAMPENEDVELOCITY___H__
|
||||
@@ -27,47 +27,46 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
DelayedVariable<T, ScaleType>::DelayedVariable(ScaleType scaleFactor, ScaleType friction)
|
||||
: _scaleFactor(std::move(scaleFactor))
|
||||
, _friction(friction)
|
||||
{
|
||||
ghoul_assert(_friction >= ScaleType(0.0), "Friction must be positive");
|
||||
}
|
||||
template <typename T>
|
||||
DampenedVelocity<T>::DampenedVelocity(double scaleFactor, bool useFriction)
|
||||
: _scaleFactor(scaleFactor)
|
||||
, _frictionEnabled(useFriction)
|
||||
{}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
void DelayedVariable<T, ScaleType>::set(T value, double dt) {
|
||||
template <typename T>
|
||||
void DampenedVelocity<T>::set(T value, double dt) {
|
||||
_targetValue = value;
|
||||
_currentValue = _currentValue + (_targetValue - _currentValue) *
|
||||
glm::min(_scaleFactor * dt, 1.0); // less or equal to 1.0 keeps it stable
|
||||
_currentValue += (_targetValue - _currentValue) * glm::min(_scaleFactor * dt, 1.0);
|
||||
// less or equal to 1.0 keeps it stable
|
||||
}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
void DelayedVariable<T, ScaleType>::decelerate(double dt) {
|
||||
_currentValue = _currentValue + (- _currentValue) *
|
||||
glm::min(_scaleFactor * _friction * dt, 1.0);
|
||||
// less or equal to 1.0 keeps it stable
|
||||
template <typename T>
|
||||
void DampenedVelocity<T>::decelerate(double dt) {
|
||||
if (!_frictionEnabled) {
|
||||
return;
|
||||
}
|
||||
_currentValue *= (1.0 - glm::min(_scaleFactor * dt, 1.0));
|
||||
// less or equal to 1.0 keeps it stable
|
||||
}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
void DelayedVariable<T, ScaleType>::setHard(T value) {
|
||||
template <typename T>
|
||||
void DampenedVelocity<T>::setImmediate(T value) {
|
||||
_targetValue = value;
|
||||
_currentValue = value;
|
||||
}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
void DelayedVariable<T, ScaleType>::setFriction(ScaleType friction) {
|
||||
_friction = friction;
|
||||
ghoul_assert(_friction >= ScaleType(0.0), "Friction must be positive");
|
||||
template <typename T>
|
||||
void DampenedVelocity<T>::setFriction(bool enabled) {
|
||||
_frictionEnabled = enabled;
|
||||
}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
void DelayedVariable<T, ScaleType>::setScaleFactor(ScaleType scaleFactor) {
|
||||
template <typename T>
|
||||
void DampenedVelocity<T>::setScaleFactor(double scaleFactor) {
|
||||
_scaleFactor = scaleFactor;
|
||||
}
|
||||
|
||||
template <typename T, typename ScaleType>
|
||||
T DelayedVariable<T, ScaleType>::get() const {
|
||||
template <typename T>
|
||||
T DampenedVelocity<T>::get() const {
|
||||
return _currentValue;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/camerainteractionstates.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalcamerastates.h>
|
||||
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
#include <ghoul/format.h>
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class JoystickCameraStates : public CameraInteractionStates {
|
||||
class JoystickCameraStates : public OrbitalCameraStates {
|
||||
public:
|
||||
enum class AxisType {
|
||||
None = 0,
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
#ifndef __OPENSPACE_CORE___MOUSECAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___MOUSECAMERASTATES___H__
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/camerainteractionstates.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalcamerastates.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class KeyboardInputState;
|
||||
class MouseInputState;
|
||||
|
||||
class MouseCameraStates : public CameraInteractionStates {
|
||||
class MouseCameraStates : public OrbitalCameraStates {
|
||||
public:
|
||||
MouseCameraStates(double sensitivity, double velocityScaleFactor);
|
||||
|
||||
|
||||
@@ -25,24 +25,27 @@
|
||||
#ifndef __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
|
||||
#define __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/delayedvariable.h>
|
||||
#include <openspace/navigation/orbitalnavigator/dampenedvelocity.h>
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class CameraInteractionStates {
|
||||
/**
|
||||
* Velocity input states for the OrbitalNavigator's camera interaction.
|
||||
*/
|
||||
class OrbitalCameraStates {
|
||||
public:
|
||||
/**
|
||||
* \param sensitivity Interaction sensitivity
|
||||
* \param velocityScaleFactor Can be set to 60 to remove the inertia of the
|
||||
* interaction. Lower value will make it harder to move the camera
|
||||
*/
|
||||
CameraInteractionStates(double sensitivity, double velocityScaleFactor);
|
||||
virtual ~CameraInteractionStates() = default;
|
||||
OrbitalCameraStates(double sensitivity, double velocityScaleFactor);
|
||||
virtual ~OrbitalCameraStates() = default;
|
||||
|
||||
void setRotationalFriction(double friction);
|
||||
void setHorizontalFriction(double friction);
|
||||
void setVerticalFriction(double friction);
|
||||
void setRotationalFriction(bool friction);
|
||||
void setHorizontalFriction(bool friction);
|
||||
void setVerticalFriction(bool friction);
|
||||
void setSensitivity(double sensitivity);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
@@ -61,23 +64,21 @@ public:
|
||||
bool hasNonZeroVelocities(bool checkOnlyMovement = false) const;
|
||||
|
||||
protected:
|
||||
template <typename T>
|
||||
struct InteractionState {
|
||||
explicit InteractionState(double scaleFactor);
|
||||
void setFriction(double friction);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
T previousValue = T(0.0);
|
||||
DelayedVariable<T, double> velocity;
|
||||
};
|
||||
|
||||
double _sensitivity = 0.0;
|
||||
|
||||
InteractionState<glm::dvec2> _globalRotationState;
|
||||
InteractionState<glm::dvec2> _localRotationState;
|
||||
InteractionState<double> _truckMovementState;
|
||||
InteractionState<double> _localRollState;
|
||||
InteractionState<double> _globalRollState;
|
||||
template <typename T>
|
||||
struct CameraInteractionState {
|
||||
CameraInteractionState(double scaleFactor);
|
||||
T previousValue = T(0.0);
|
||||
DampenedVelocity<T> velocity;
|
||||
};
|
||||
|
||||
CameraInteractionState<glm::dvec2> _globalRotationState;
|
||||
CameraInteractionState<glm::dvec2> _localRotationState;
|
||||
CameraInteractionState<double> _truckMovementState;
|
||||
CameraInteractionState<double> _localRollState;
|
||||
CameraInteractionState<double> _globalRollState;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
@@ -25,13 +25,13 @@
|
||||
#ifndef __OPENSPACE_CORE___SCRIPTCAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___SCRIPTCAMERASTATES___H__
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/camerainteractionstates.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalcamerastates.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class ScriptCameraStates : public CameraInteractionStates {
|
||||
class ScriptCameraStates : public OrbitalCameraStates {
|
||||
public:
|
||||
ScriptCameraStates();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___WEBSOCKETCAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___WEBSOCKETCAMERASTATES___H__
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/camerainteractionstates.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalcamerastates.h>
|
||||
|
||||
#include <openspace/interaction/websocketinputstate.h>
|
||||
#include <ghoul/misc/boolean.h>
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class WebsocketCameraStates : public CameraInteractionStates {
|
||||
class WebsocketCameraStates : public OrbitalCameraStates {
|
||||
public:
|
||||
enum class AxisType {
|
||||
None = 0,
|
||||
|
||||
@@ -74,10 +74,10 @@ set(OPENSPACE_SOURCE
|
||||
navigation/navigationhandler.cpp
|
||||
navigation/navigationhandler_lua.inl
|
||||
navigation/navigationstate.cpp
|
||||
navigation/orbitalnavigator/camerainteractionstates.cpp
|
||||
navigation/orbitalnavigator/idlebehavior.cpp
|
||||
navigation/orbitalnavigator/joystickcamerastates.cpp
|
||||
navigation/orbitalnavigator/mousecamerastates.cpp
|
||||
navigation/orbitalnavigator/orbitalcamerastates.cpp
|
||||
navigation/orbitalnavigator/orbitalinputhandler.cpp
|
||||
navigation/orbitalnavigator/orbitalnavigator.cpp
|
||||
navigation/orbitalnavigator/orbitalnavigator_lua.inl
|
||||
@@ -271,12 +271,12 @@ set(OPENSPACE_HEADER
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/keyframenavigator.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/navigationhandler.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/navigationstate.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/delayedvariable.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/delayedvariable.inl
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/camerainteractionstates.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/dampenedvelocity.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/dampenedvelocity.inl
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/idlebehavior.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/joystickcamerastates.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/mousecamerastates.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/orbitalcamerastates.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/orbitalinputhandler.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/orbitalnavigator.h
|
||||
${PROJECT_SOURCE_DIR}/include/openspace/navigation/orbitalnavigator/websocketcamerastates.h
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace {
|
||||
namespace openspace::interaction {
|
||||
|
||||
JoystickCameraStates::JoystickCameraStates(double sensitivity, double velocityScaleFactor)
|
||||
: CameraInteractionStates(sensitivity, velocityScaleFactor)
|
||||
: OrbitalCameraStates(sensitivity, velocityScaleFactor)
|
||||
{}
|
||||
|
||||
void JoystickCameraStates::updateStateFromInput(
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace {
|
||||
namespace openspace::interaction {
|
||||
|
||||
MouseCameraStates::MouseCameraStates(double sensitivity, double velocityScaleFactor)
|
||||
: CameraInteractionStates(sensitivity, velocityScaleFactor)
|
||||
: OrbitalCameraStates(sensitivity, velocityScaleFactor)
|
||||
{}
|
||||
|
||||
void MouseCameraStates::updateStateFromInput(const MouseInputState& mouseState,
|
||||
@@ -125,6 +125,7 @@ void MouseCameraStates::updateStateFromInput(const MouseInputState& mouseState,
|
||||
_globalRotationState.previousValue = mousePosition;
|
||||
_globalRotationState.velocity.decelerate(deltaTime);
|
||||
}
|
||||
|
||||
if (secondaryPressed || (keyAltPressed && primaryPressed)) {
|
||||
const double mousePosDelta = _truckMovementState.previousValue - mousePosition.y;
|
||||
|
||||
@@ -137,6 +138,7 @@ void MouseCameraStates::updateStateFromInput(const MouseInputState& mouseState,
|
||||
_truckMovementState.previousValue = mousePosition.y;
|
||||
_truckMovementState.velocity.decelerate(deltaTime);
|
||||
}
|
||||
|
||||
if (button3Pressed || (keyShiftPressed && primaryPressed)) {
|
||||
if (keyCtrlPressed) {
|
||||
const double mousePosDelta = _localRollState.previousValue - mousePosition.x;
|
||||
|
||||
@@ -22,30 +22,16 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/navigation/orbitalnavigator/camerainteractionstates.h>
|
||||
#include <openspace/navigation/orbitalnavigator/orbitalcamerastates.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
template <typename T>
|
||||
CameraInteractionStates::InteractionState<T>::InteractionState(double scaleFactor)
|
||||
: previousValue(T(0.0))
|
||||
, velocity(scaleFactor, 1)
|
||||
OrbitalCameraStates::CameraInteractionState<T>::CameraInteractionState(double scaleFactor)
|
||||
: velocity(scaleFactor, 1.0)
|
||||
{}
|
||||
|
||||
template <typename T>
|
||||
void CameraInteractionStates::InteractionState<T>::setFriction(double friction) {
|
||||
velocity.setFriction(friction);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void CameraInteractionStates::InteractionState<T>::setVelocityScaleFactor(
|
||||
double scaleFactor)
|
||||
{
|
||||
velocity.setScaleFactor(scaleFactor);
|
||||
}
|
||||
|
||||
CameraInteractionStates::CameraInteractionStates(double sensitivity,
|
||||
double velocityScaleFactor)
|
||||
OrbitalCameraStates::OrbitalCameraStates(double sensitivity, double velocityScaleFactor)
|
||||
: _sensitivity(sensitivity)
|
||||
, _globalRotationState(velocityScaleFactor)
|
||||
, _localRotationState(velocityScaleFactor)
|
||||
@@ -54,41 +40,41 @@ CameraInteractionStates::CameraInteractionStates(double sensitivity,
|
||||
, _globalRollState(velocityScaleFactor)
|
||||
{}
|
||||
|
||||
void CameraInteractionStates::setRotationalFriction(double friction) {
|
||||
_localRotationState.setFriction(friction);
|
||||
_localRollState.setFriction(friction);
|
||||
_globalRollState.setFriction(friction);
|
||||
void OrbitalCameraStates::setRotationalFriction(bool enabled) {
|
||||
_localRotationState.velocity.setFriction(enabled);
|
||||
_localRollState.velocity.setFriction(enabled);
|
||||
_globalRollState.velocity.setFriction(enabled);
|
||||
}
|
||||
|
||||
void CameraInteractionStates::setHorizontalFriction(double friction) {
|
||||
_globalRotationState.setFriction(friction);
|
||||
void OrbitalCameraStates::setHorizontalFriction(bool enabled) {
|
||||
_globalRotationState.velocity.setFriction(enabled);
|
||||
}
|
||||
|
||||
void CameraInteractionStates::setVerticalFriction(double friction) {
|
||||
_truckMovementState.setFriction(friction);
|
||||
void OrbitalCameraStates::setVerticalFriction(bool enabled) {
|
||||
_truckMovementState.velocity.setFriction(enabled);
|
||||
}
|
||||
|
||||
void CameraInteractionStates::setSensitivity(double sensitivity) {
|
||||
void OrbitalCameraStates::setSensitivity(double sensitivity) {
|
||||
_sensitivity = sensitivity;
|
||||
}
|
||||
|
||||
void CameraInteractionStates::setVelocityScaleFactor(double scaleFactor) {
|
||||
_globalRotationState.setVelocityScaleFactor(scaleFactor);
|
||||
_localRotationState.setVelocityScaleFactor(scaleFactor);
|
||||
_truckMovementState.setVelocityScaleFactor(scaleFactor);
|
||||
_localRollState.setVelocityScaleFactor(scaleFactor);
|
||||
_globalRollState.setVelocityScaleFactor(scaleFactor);
|
||||
void OrbitalCameraStates::setVelocityScaleFactor(double scaleFactor) {
|
||||
_globalRotationState.velocity.setScaleFactor(scaleFactor);
|
||||
_localRotationState.velocity.setScaleFactor(scaleFactor);
|
||||
_truckMovementState.velocity.setScaleFactor(scaleFactor);
|
||||
_localRollState.velocity.setScaleFactor(scaleFactor);
|
||||
_globalRollState.velocity.setScaleFactor(scaleFactor);
|
||||
}
|
||||
|
||||
void CameraInteractionStates::resetVelocities() {
|
||||
_globalRotationState.velocity.setHard({ 0.0, 0.0 });
|
||||
_localRotationState.velocity.setHard({ 0.0, 0.0 });
|
||||
_truckMovementState.velocity.setHard(0.0);
|
||||
_localRollState.velocity.setHard(0.0);
|
||||
_globalRollState.velocity.setHard(0.0);
|
||||
void OrbitalCameraStates::resetVelocities() {
|
||||
_globalRotationState.velocity.setImmediate({ 0.0, 0.0 });
|
||||
_localRotationState.velocity.setImmediate({ 0.0, 0.0 });
|
||||
_truckMovementState.velocity.setImmediate(0.0);
|
||||
_localRollState.velocity.setImmediate(0.0);
|
||||
_globalRollState.velocity.setImmediate(0.0);
|
||||
}
|
||||
|
||||
bool CameraInteractionStates::hasNonZeroVelocities(bool checkOnlyMovement) const {
|
||||
bool OrbitalCameraStates::hasNonZeroVelocities(bool checkOnlyMovement) const {
|
||||
glm::dvec2 sum = glm::dvec2(0.0);
|
||||
sum += globalRotationVelocity();
|
||||
sum += truckMovementVelocity();
|
||||
@@ -103,23 +89,23 @@ bool CameraInteractionStates::hasNonZeroVelocities(bool checkOnlyMovement) const
|
||||
return glm::length(sum) > 0.001;
|
||||
}
|
||||
|
||||
glm::dvec2 CameraInteractionStates::globalRotationVelocity() const{
|
||||
glm::dvec2 OrbitalCameraStates::globalRotationVelocity() const{
|
||||
return _globalRotationState.velocity.get();
|
||||
}
|
||||
|
||||
glm::dvec2 CameraInteractionStates::localRotationVelocity() const{
|
||||
glm::dvec2 OrbitalCameraStates::localRotationVelocity() const{
|
||||
return _localRotationState.velocity.get();
|
||||
}
|
||||
|
||||
double CameraInteractionStates::truckMovementVelocity() const{
|
||||
double OrbitalCameraStates::truckMovementVelocity() const{
|
||||
return _truckMovementState.velocity.get();
|
||||
}
|
||||
|
||||
double CameraInteractionStates::localRollVelocity() const{
|
||||
double OrbitalCameraStates::localRollVelocity() const{
|
||||
return _localRollState.velocity.get();
|
||||
}
|
||||
|
||||
double CameraInteractionStates::globalRollVelocity() const{
|
||||
double OrbitalCameraStates::globalRollVelocity() const{
|
||||
return _globalRollState.velocity.get();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
ScriptCameraStates::ScriptCameraStates() : CameraInteractionStates(1.0, 1.0) {}
|
||||
ScriptCameraStates::ScriptCameraStates() : OrbitalCameraStates(1.0, 1.0) {}
|
||||
|
||||
void ScriptCameraStates::updateStateFromInput(double deltaTime) {
|
||||
if (_localRotation != glm::dvec2(0.0)) {
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace openspace::interaction {
|
||||
|
||||
WebsocketCameraStates::WebsocketCameraStates(double sensitivity,
|
||||
double velocityScaleFactor)
|
||||
: CameraInteractionStates(sensitivity, velocityScaleFactor)
|
||||
: OrbitalCameraStates(sensitivity, velocityScaleFactor)
|
||||
{}
|
||||
|
||||
void WebsocketCameraStates::updateStateFromInput(
|
||||
|
||||
Reference in New Issue
Block a user