mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Merge remote-tracking branch 'origin/develop' into features/imgui
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
*/
|
||||
|
||||
namespace openspace {
|
||||
class SyncBuffer;
|
||||
|
||||
namespace scripting {
|
||||
|
||||
class ScriptEngine {
|
||||
@@ -67,6 +69,16 @@ public:
|
||||
|
||||
bool writeDocumentation(const std::string& filename, const std::string& type) const;
|
||||
|
||||
void serialize(SyncBuffer* syncBuffer);
|
||||
|
||||
void deserialize(SyncBuffer* syncBuffer);
|
||||
|
||||
void postSynchronizationPreDraw();
|
||||
|
||||
void preSynchronization();
|
||||
|
||||
void queueScript(const std::string &script);
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
|
||||
private:
|
||||
@@ -80,6 +92,11 @@ private:
|
||||
|
||||
lua_State* _state;
|
||||
std::set<LuaLibrary> _registeredLibraries;
|
||||
|
||||
//sync variables
|
||||
std::mutex _mutex;
|
||||
std::vector<std::string> _queuedScripts;
|
||||
std::string _currentSyncedScript;
|
||||
};
|
||||
|
||||
} // namespace scripting
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
|
||||
void setPosition(psc pos);
|
||||
const psc& position() const;
|
||||
|
||||
const psc& unsynchedPosition() const;
|
||||
|
||||
void setModelMatrix(glm::mat4 modelMatrix);
|
||||
const glm::mat4& modelMatrix() const;
|
||||
@@ -169,6 +171,11 @@ private:
|
||||
glm::vec2 _sharedScaling;
|
||||
psc _sharedPosition;
|
||||
glm::mat4 _sharedViewRotationMatrix;
|
||||
|
||||
//synced copies of local variables
|
||||
glm::vec2 _syncedScaling;
|
||||
psc _syncedPosition;
|
||||
glm::mat4 _syncedViewRotationMatrix;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -197,6 +197,11 @@ private:
|
||||
double _sharedTime;
|
||||
double _sharedDt;
|
||||
bool _sharedTimeJumped;
|
||||
|
||||
//synced copies
|
||||
double _syncedTime;
|
||||
double _syncedDt;
|
||||
bool _syncedTimeJumped;
|
||||
|
||||
|
||||
std::mutex _syncMutex;
|
||||
|
||||
Reference in New Issue
Block a user