mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-01 16:29:43 -05:00
adding a forced time jump to trigger recomputation of trails when an init message is received
This commit is contained in:
@@ -88,7 +88,8 @@ namespace openspace {
|
||||
_isConnected(false),
|
||||
_tryConnect(false),
|
||||
_performDisconnect(false),
|
||||
_latestTimeKeyframeValid(false)
|
||||
_latestTimeKeyframeValid(false),
|
||||
_initializationTimejumpRequired(false)
|
||||
|
||||
{
|
||||
//create handler thread
|
||||
@@ -467,6 +468,9 @@ namespace openspace {
|
||||
//let the server know
|
||||
queueMessage(buffer);
|
||||
|
||||
//we also need to force a time jump just to ensure that the server and client are synced
|
||||
_initializationTimejumpRequired.store(true);
|
||||
|
||||
// int result;
|
||||
// uint16_t numScripts;
|
||||
// uint32_t datalen;
|
||||
@@ -630,6 +634,12 @@ namespace openspace {
|
||||
_latestTimeKeyframe._requiresTimeJump = tf._requiresTimeJump;
|
||||
}
|
||||
|
||||
//if we're just initialized we need to perform a time jump as soon as a valid keyframe has been received
|
||||
if(_initializationTimejumpRequired.load() && _latestTimeKeyframeValid){
|
||||
_latestTimeKeyframe._requiresTimeJump = true;
|
||||
_initializationTimejumpRequired.store(false);
|
||||
}
|
||||
|
||||
//unlock mutex
|
||||
_timeKeyframeMutex.unlock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user