File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -136,17 +136,18 @@ bool Animation::update(double simulationTime)
136136 return x < 0.0 ? y + std::fmod (x, y) : std::fmod (x, y);
137137 };
138138
139- time = time + (simulationTime - _previousSimulationTime) * speed;
139+ auto samplerTime = time = time + (simulationTime - _previousSimulationTime) * speed;
140+
140141 _previousSimulationTime = simulationTime;
141142
142143 if (mode == REPEAT)
143144 {
144- time = time_within_period (time, _maxTime);
145+ samplerTime = time = time_within_period (time, _maxTime);
145146 }
146147 else if (mode == FORWARD_AND_BACK)
147148 {
148- time = time_within_period (time, 2.0 * _maxTime);
149- if (time > _maxTime) time = 2.0 * _maxTime - time;
149+ samplerTime = time = time_within_period (time, 2.0 * _maxTime);
150+ if (time > _maxTime) samplerTime = 2.0 * _maxTime - time;
150151 }
151152 else
152153 {
@@ -159,7 +160,7 @@ bool Animation::update(double simulationTime)
159160
160161 for (auto sampler : samplers)
161162 {
162- sampler->update (time );
163+ sampler->update (samplerTime );
163164 }
164165
165166 return true ;
You can’t perform that action at this time.
0 commit comments