add gt check for frameIndex
This commit is contained in:
@@ -75,6 +75,8 @@ void SceneAsset::updateMorphAnimation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_morphAnimationBuffer->frameIndex == -1) {
|
if (_morphAnimationBuffer->frameIndex == -1) {
|
||||||
|
// auto ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
|
||||||
|
// Log("Frame 1 at %lu", ms);
|
||||||
_morphAnimationBuffer->frameIndex++;
|
_morphAnimationBuffer->frameIndex++;
|
||||||
_morphAnimationBuffer->startTime = high_resolution_clock::now();
|
_morphAnimationBuffer->startTime = high_resolution_clock::now();
|
||||||
applyWeights(_morphAnimationBuffer->frameData,
|
applyWeights(_morphAnimationBuffer->frameData,
|
||||||
@@ -94,7 +96,7 @@ void SceneAsset::updateMorphAnimation() {
|
|||||||
1000 / _morphAnimationBuffer->frameLengthInMs,
|
1000 / _morphAnimationBuffer->frameLengthInMs,
|
||||||
_morphAnimationBuffer->frameIndex);
|
_morphAnimationBuffer->frameIndex);
|
||||||
_morphAnimationBuffer = nullptr;
|
_morphAnimationBuffer = nullptr;
|
||||||
} else if (frameIndex != _morphAnimationBuffer->frameIndex) {
|
} else if (frameIndex > _morphAnimationBuffer->frameIndex) {
|
||||||
// Log("Rendering frame %d (of a total %d)", frameIndex,
|
// Log("Rendering frame %d (of a total %d)", frameIndex,
|
||||||
// _morphAnimationBuffer->numFrames);
|
// _morphAnimationBuffer->numFrames);
|
||||||
_morphAnimationBuffer->frameIndex = frameIndex;
|
_morphAnimationBuffer->frameIndex = frameIndex;
|
||||||
@@ -211,7 +213,6 @@ void SceneAsset::updateEmbeddedAnimations() {
|
|||||||
float animationTimeOffset = 0;
|
float animationTimeOffset = 0;
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
if (!status.started) {
|
if (!status.started) {
|
||||||
Log("Starting");
|
|
||||||
|
|
||||||
status.started = true;
|
status.started = true;
|
||||||
status.startedAt = now;
|
status.startedAt = now;
|
||||||
|
|||||||
Reference in New Issue
Block a user