Merge pull request #2426 from OpenSpace/issue/2425

Fix bug that channels in cluster don't set the field of view to the same value after animating
This commit is contained in:
Ylva Selling
2023-02-02 16:17:06 -05:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ private:
skybrowser::Animation<glm::dvec3> _targetAnimation =
skybrowser::Animation(glm::dvec3(0.0), glm::dvec3(0.0), 0.0);
bool _targetIsAnimating = false;
bool _fovIsAnimating = false;
// Dragging
glm::dvec3 _startTargetPosition = glm::dvec3(0.0);

View File

@@ -283,11 +283,18 @@ void TargetBrowserPair::incrementallyAnimateToCoordinate() {
aimTargetGalactic(_targetNode->identifier(), _targetAnimation.newValue());
_fovAnimation.start();
_targetIsAnimating = false;
_fovIsAnimating = true;
}
// After the target has animated to its position, animate the field of view
if (_fovAnimation.isAnimating()) {
_browser->setVerticalFov(_fovAnimation.newValue());
_targetRenderable->setVerticalFov(_browser->verticalFov());
}
else if (!_fovAnimation.isAnimating() && _fovIsAnimating) {
// Set the finished field of view
setVerticalFov(_fovAnimation.newValue());
_fovIsAnimating = false;
}
}
void TargetBrowserPair::startFading(float goal, float fadeTime) {