animation on switch url

This commit is contained in:
SamGondelman 2018-09-10 10:03:05 -07:00
parent 983badf80a
commit a4605289a2
2 changed files with 3 additions and 3 deletions

View file

@ -1336,6 +1336,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
if (_parsedModelURL != model->getURL()) {
withWriteLock([&] {
_texturesLoaded = false;
_jointMappingCompleted = false;
model->setURL(_parsedModelURL);
});
}
@ -1445,8 +1446,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
if (!jointsMapped()) {
mapJoints(entity, model->getJointNames());
//else the joint have been mapped before but we have a new animation to load
} else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) {
_animation = DependencyManager::get<AnimationCache>()->getAnimation(entity->getAnimationURL());
} else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) {
_jointMappingCompleted = false;
mapJoints(entity, model->getJointNames());
}

View file

@ -187,7 +187,7 @@ private:
const void* _collisionMeshKey { nullptr };
// used on client side
bool _jointMappingCompleted{ false };
bool _jointMappingCompleted { false };
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
AnimationPointer _animation;
QUrl _parsedModelURL;