mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 01:39:47 -05:00
Add potential fix for flickering of target
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user