mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 23:08:55 -06:00
Implement ability to update camera in two steps. still using old method.
This commit is contained in:
@@ -173,7 +173,13 @@ public:
|
||||
void lockControls();
|
||||
void unlockControls();
|
||||
|
||||
void update(double deltaTime);
|
||||
//void update(double deltaTime);
|
||||
|
||||
void preSynchronization(double deltaTime);
|
||||
void postSynchronizationPreDraw();
|
||||
|
||||
void serialize(SyncBuffer* syncBuffer);
|
||||
void deserialize(SyncBuffer* syncBuffer);
|
||||
|
||||
// Accessors
|
||||
ghoul::Dictionary getCameraStateDictionary();
|
||||
@@ -214,8 +220,6 @@ private:
|
||||
|
||||
std::map<std::string, std::shared_ptr<InteractionMode>> _interactionModes;
|
||||
std::shared_ptr<OrbitalInteractionMode::MouseStates> _mouseStates;
|
||||
//std::shared_ptr<OrbitalInteractionMode> _orbitalInteractionMode;
|
||||
//std::shared_ptr<GlobeBrowsingInteractionMode> _globebrowsingInteractionMode;
|
||||
|
||||
// Properties
|
||||
properties::StringProperty _origin;
|
||||
|
||||
@@ -95,7 +95,12 @@ public:
|
||||
// Accessors
|
||||
SceneGraphNode* focusNode();
|
||||
|
||||
virtual void update(Camera& camera, const InputState& inputState, double deltaTime) = 0;
|
||||
virtual void updateMouseStatesFromInput(const InputState& inputState, double deltaTime) = 0;
|
||||
virtual void updateCameraStateFromMouseStates(Camera& camera) = 0;
|
||||
|
||||
virtual void serialize(SyncBuffer* syncBuffer) = 0;
|
||||
virtual void deserialize(SyncBuffer* syncBuffer) = 0;
|
||||
|
||||
protected:
|
||||
/**
|
||||
Inner class that acts as a smoothing filter to a variable. The filter has a step
|
||||
@@ -163,8 +168,13 @@ public:
|
||||
KeyframeInteractionMode();
|
||||
~KeyframeInteractionMode();
|
||||
|
||||
virtual void update(double deltaTime);
|
||||
virtual void updateMouseStatesFromInput(const InputState& inputState, double deltaTime);
|
||||
virtual void updateCameraStateFromMouseStates(Camera& camera);
|
||||
|
||||
// Need implementation
|
||||
|
||||
virtual void serialize(SyncBuffer* syncBuffer) {};
|
||||
virtual void deserialize(SyncBuffer* syncBuffer) {};
|
||||
private:
|
||||
double _currentKeyframeTime;
|
||||
};
|
||||
@@ -178,7 +188,6 @@ public:
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
\param inputState
|
||||
\param 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.
|
||||
@@ -190,9 +199,19 @@ public:
|
||||
void setVerticalFriction(double friction);
|
||||
void setSensitivity(double sensitivity);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
glm::dvec2 synchedGlobalRotationMouseVelocity();
|
||||
glm::dvec2 synchedLocalRotationMouseVelocity();
|
||||
glm::dvec2 synchedTruckMovementMouseVelocity();
|
||||
glm::dvec2 synchedLocalRollMouseVelocity();
|
||||
glm::dvec2 synchedGlobalRollMouseVelocity();
|
||||
|
||||
void preSynchronization();
|
||||
void postSynchronizationPreDraw();
|
||||
|
||||
void serialize(SyncBuffer* syncBuffer);
|
||||
void deserialize(SyncBuffer* syncBuffer);
|
||||
private:
|
||||
friend class OrbitalInteractionMode;
|
||||
friend class GlobeBrowsingInteractionMode;
|
||||
double _sensitivity;
|
||||
|
||||
MouseState _globalRotationMouseState;
|
||||
@@ -200,15 +219,34 @@ public:
|
||||
MouseState _truckMovementMouseState;
|
||||
MouseState _localRollMouseState;
|
||||
MouseState _globalRollMouseState;
|
||||
|
||||
// MouseStates have synched variables
|
||||
glm::dvec2 _sharedGlobalRotationMouseVelocity;
|
||||
glm::dvec2 _sharedLocalRotationMouseVelocity;
|
||||
glm::dvec2 _sharedTruckMovementMouseVelocity;
|
||||
glm::dvec2 _sharedLocalRollMouseVelocity;
|
||||
glm::dvec2 _sharedGlobalRollMouseVelocity;
|
||||
|
||||
glm::dvec2 _synchedGlobalRotationMouseVelocity;
|
||||
glm::dvec2 _synchedLocalRotationMouseVelocity;
|
||||
glm::dvec2 _synchedTruckMovementMouseVelocity;
|
||||
glm::dvec2 _synchedLocalRollMouseVelocity;
|
||||
glm::dvec2 _synchedGlobalRollMouseVelocity;
|
||||
};
|
||||
|
||||
OrbitalInteractionMode(std::shared_ptr<MouseStates> mouseStates);
|
||||
~OrbitalInteractionMode();
|
||||
|
||||
virtual void update(Camera& camera, const InputState& inputState, double deltaTime);
|
||||
//virtual void update(Camera& camera, const InputState& inputState, double deltaTime);
|
||||
|
||||
virtual void updateMouseStatesFromInput(const InputState& inputState, double deltaTime);
|
||||
virtual void updateCameraStateFromMouseStates(Camera& camera);
|
||||
|
||||
virtual void serialize(SyncBuffer* syncBuffer);
|
||||
virtual void deserialize(SyncBuffer* syncBuffer);
|
||||
|
||||
protected:
|
||||
void updateCameraStateFromMouseStates(Camera& camera);
|
||||
//void updateCameraStateFromMouseStates(Camera& camera);
|
||||
std::shared_ptr<MouseStates> _mouseStates;
|
||||
};
|
||||
|
||||
@@ -219,9 +257,11 @@ public:
|
||||
~GlobeBrowsingInteractionMode();
|
||||
|
||||
virtual void setFocusNode(SceneGraphNode* focusNode);
|
||||
virtual void update(Camera& camera, const InputState& inputState, double deltaTime);
|
||||
//virtual void update(Camera& camera, const InputState& inputState, double deltaTime);
|
||||
virtual void updateCameraStateFromMouseStates(Camera& camera);
|
||||
|
||||
private:
|
||||
void updateCameraStateFromMouseStates(Camera& camera);
|
||||
//void updateCameraStateFromMouseStates(Camera& camera);
|
||||
RenderableGlobe* _globe;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user