Enable basic saving and restoring camera position between runs

This commit is contained in:
Erik Broberg
2016-06-22 17:37:55 -04:00
parent 60da53c00e
commit 7c0e80b866
5 changed files with 113 additions and 2 deletions
@@ -194,9 +194,14 @@ public:
void mousePositionCallback(double x, double y);
void mouseScrollWheelCallback(double pos);
void saveCameraPosition(const std::string& filepath = "");
void restoreCameraPosition(const std::string& filepath = "");
private:
void setInteractionMode(std::shared_ptr<InteractionMode> interactionMode);
bool _cameraUpdatedFromScript = false;
std::multimap<KeyWithModifier, std::string > _keyLua;
std::unique_ptr<InputState> _inputState;
@@ -210,7 +215,6 @@ private:
// Properties
properties::StringProperty _origin;
properties::StringProperty _coordinateSystem;
};
#endif // USE_OLD_INTERACTIONHANDLER
+6
View File
@@ -38,6 +38,8 @@
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/quaternion.hpp>
#include <iostream>
namespace openspace {
/**
This class still needs some more love. Suggested improvements:
@@ -122,6 +124,9 @@ namespace openspace {
void serialize(SyncBuffer* syncBuffer);
void deserialize(SyncBuffer* syncBuffer);
void serialize(std::ostream& os) const;
void deserialize(std::istream& is);
/**
Handles SGCT's internal matrices. Also caches a calculated viewProjection
matrix. This is the data that is different for different cameras within
@@ -171,6 +176,7 @@ namespace openspace {
const glm::mat4& projectionMatrix() const;
[[deprecated("Replaced by Camera::SgctInternal::viewProjectionMatrix()")]]
const glm::mat4& viewProjectionMatrix() const;
private:
/**
Class encapsulating data that needs to be synched between SGCT nodes.