mirror of
https://github.com/lubosz/overte.git
synced 2025-08-27 11:46:18 +02:00
Cleaned up the code a bit so that there is no need for a new class variable for properties to verify the change of url
This commit is contained in:
parent
9f484a7f57
commit
1c97272767
2 changed files with 7 additions and 12 deletions
|
@ -1394,18 +1394,14 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
|||
// That is where _currentFrame and _lastAnimated were updated.
|
||||
if (_animating) {
|
||||
DETAILED_PROFILE_RANGE(simulation_physics, "Animate");
|
||||
// check animation url change
|
||||
auto newprops = entity->getAnimationProperties();
|
||||
if (newprops != _previousAnimationProperties) {
|
||||
if (newprops.getURL() != _previousAnimationProperties.getURL()) {
|
||||
_animation = DependencyManager::get<AnimationCache>()->getAnimation(entity->getAnimationURL());
|
||||
_jointMappingCompleted = false;
|
||||
mapJoints(entity, model->getJointNames());
|
||||
}
|
||||
_previousAnimationProperties = newprops;
|
||||
|
||||
if (!jointsMapped()) {
|
||||
mapJoints(entity, model->getJointNames());
|
||||
}
|
||||
if (!jointsMapped() || _animation->getURL().toString() != entity->getAnimationURL()) {
|
||||
qCDebug(entitiesrenderer) << "changed animation or started animation";
|
||||
//else the joints have been mapped before but we have new animation to load
|
||||
else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) {
|
||||
_animation = DependencyManager::get<AnimationCache>()->getAnimation(entity->getAnimationURL());
|
||||
_jointMappingCompleted = false;
|
||||
mapJoints(entity, model->getJointNames());
|
||||
}
|
||||
if (!(entity->getAnimationFirstFrame() < 0) && !(entity->getAnimationFirstFrame() > entity->getAnimationLastFrame())) {
|
||||
|
|
|
@ -192,7 +192,6 @@ private:
|
|||
bool _shouldHighlight { false };
|
||||
bool _animating { false };
|
||||
uint64_t _lastAnimated { 0 };
|
||||
AnimationPropertyGroup _previousAnimationProperties;
|
||||
|
||||
render::ItemKey _itemKey { render::ItemKey::Builder().withTypeMeta() };
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue