fix
This commit is contained in:
@@ -348,13 +348,14 @@ void SceneAsset::setTexture() {
|
|||||||
|
|
||||||
void SceneAsset::updateEmbeddedAnimations() {
|
void SceneAsset::updateEmbeddedAnimations() {
|
||||||
auto now = high_resolution_clock::now();
|
auto now = high_resolution_clock::now();
|
||||||
int animationIndex = 0;
|
|
||||||
bool playing = false;
|
bool needsUpdate = false;
|
||||||
for (auto &status : _embeddedAnimationStatus) {
|
for (int animationIndex = 0; animationIndex < _embeddedAnimationStatus.size(); animationIndex++) {
|
||||||
|
auto &status = _embeddedAnimationStatus[animationIndex];
|
||||||
if (status.play == false) {
|
if (status.play == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
playing = true;
|
needsUpdate = true;
|
||||||
|
|
||||||
float animationLength = _animator->getAnimationDuration(animationIndex);
|
float animationLength = _animator->getAnimationDuration(animationIndex);
|
||||||
|
|
||||||
@@ -403,11 +404,12 @@ void SceneAsset::updateEmbeddedAnimations() {
|
|||||||
_animator->applyCrossFade(animationIndex, animationLength - 0.05, (elapsed.count() - animationLength) / 0.3);
|
_animator->applyCrossFade(animationIndex, animationLength - 0.05, (elapsed.count() - animationLength) / 0.3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
animationIndex++;
|
|
||||||
}
|
}
|
||||||
if(playing)
|
if(needsUpdate) {
|
||||||
_animator->updateBoneMatrices();
|
_animator->updateBoneMatrices();
|
||||||
}
|
}
|
||||||
|
needsUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
unique_ptr<vector<string>> SceneAsset::getAnimationNames() {
|
unique_ptr<vector<string>> SceneAsset::getAnimationNames() {
|
||||||
size_t count = _animator->getAnimationCount();
|
size_t count = _animator->getAnimationCount();
|
||||||
|
|||||||
Reference in New Issue
Block a user