Merge remote-tracking branch 'origin/develop' into features/imgui

This commit is contained in:
Alexander Bock
2015-02-17 15:11:49 +01:00
11 changed files with 712 additions and 595 deletions

View File

@@ -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

View File

@@ -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;
};

View File

@@ -197,6 +197,11 @@ private:
double _sharedTime;
double _sharedDt;
bool _sharedTimeJumped;
//synced copies
double _syncedTime;
double _syncedDt;
bool _syncedTimeJumped;
std::mutex _syncMutex;