Add potential fix for flickering of target

This commit is contained in:
Ylva Selling
2022-09-22 04:23:16 -04:00
parent 4214811c6a
commit 2c31e485d8
3 changed files with 5 additions and 3 deletions
@@ -50,7 +50,7 @@ public:
glm::dvec2 fineTuneVector(const glm::dvec2& drag);
bool isInitialized() const;
void setVerticalFovWithScroll(float scroll);
double setVerticalFovWithScroll(float scroll);
void setOpacity(float opacity);
void setRatio(float ratio);
void setIdInBrowser() const;
@@ -328,12 +328,13 @@ void ScreenSpaceSkyBrowser::update() {
ScreenSpaceRenderable::update();
}
void ScreenSpaceSkyBrowser::setVerticalFovWithScroll(float scroll) {
double ScreenSpaceSkyBrowser::setVerticalFovWithScroll(float scroll) {
// Make scroll more sensitive the smaller the FOV
double x = _verticalFov;
double zoomFactor = atan(x / 50.0) + exp(x / 40.0) - 0.99999999999999999999999999999;
double zoom = scroll > 0.0 ? zoomFactor : -zoomFactor;
_verticalFov = std::clamp(_verticalFov + zoom, 0.0, 70.0);
return _verticalFov;
}
void ScreenSpaceSkyBrowser::bindTexture() {
+2 -1
View File
@@ -262,7 +262,8 @@ void TargetBrowserPair::setBrowserRatio(float ratio) {
}
void TargetBrowserPair::setVerticalFovWithScroll(float scroll) {
_browser->setVerticalFovWithScroll(scroll);
double fov = _browser->setVerticalFovWithScroll(scroll);
_target->setVerticalFov(fov);
}
void TargetBrowserPair::setImageCollectionIsLoaded(bool isLoaded) {