@@ -107,7 +107,11 @@ namespace vsgvr
107
107
return PollEventsResult::RunningDontRender;
108
108
}
109
109
110
+ #if VSG_VERSION_MAJOR >= 1 && VSG_VERSION_MINOR >= 1
111
+ bool Viewer::advanceToNextFrame (double simulationTime)
112
+ #else
110
113
bool Viewer::advanceToNextFrame ()
114
+ #endif
111
115
{
112
116
// Viewer::acquireNextFrame
113
117
_frameState = XrFrameState ();
@@ -128,12 +132,28 @@ namespace vsgvr
128
132
if (!_frameStamp)
129
133
{
130
134
// first frame, initialize to frame count and indices to 0
135
+ #if VSG_VERSION_MAJOR >= 1 && VSG_VERSION_MINOR >= 1
136
+
137
+ _start_time_point = t;
138
+
139
+ if (simulationTime == UseTimeSinceStartPoint) simulationTime = 0.0 ;
140
+ _frameStamp = vsg::FrameStamp::create (t, 0 , simulationTime);
141
+ #else
131
142
_frameStamp = vsg::FrameStamp::create (t, 0 );
143
+ #endif
132
144
}
133
145
else
134
146
{
135
147
// after first frame so increment frame count and indices
148
+ #if VSG_VERSION_MAJOR >= 1 && VSG_VERSION_MINOR >= 1
149
+ if (simulationTime == UseTimeSinceStartPoint)
150
+ {
151
+ simulationTime = std::chrono::duration<double , std::chrono::seconds::period>(t - _start_time_point).count ();
152
+ }
153
+ _frameStamp = vsg::FrameStamp::create (t, _frameStamp->frameCount + 1 , simulationTime);
154
+ #else
136
155
_frameStamp = vsg::FrameStamp::create (t, _frameStamp->frameCount + 1 );
156
+ #endif
137
157
}
138
158
139
159
for (auto & layer : compositionLayers)
0 commit comments