Feature/numeric slider updates (#1609)

* Remove Logarithmic ViewOption and instead always use exponent of NumericalProperty + set exponent of some renderables' properties

* Add MinMaxRange ViewOption for Vec2 properties

* Add MinMaxRange viewoption to some existing vec2 properties and combine some other related properties to be able to utilize it. For example Min and Max label sizes, fade in/out distances, inner and outer radius. OBS! Includes renaming several properties (**breaking change**)

* Refactor and document labels code. OBS! Includes renaming several properties (**breaking change**)

* Add comments for some assets that have labels that are not working correctly


Renderables with rename properties: RenderableLabels , GlobeLabelsComponent, RenderableBillboardsCloud, RenderableDUMeshes, RenderableRadialGrid )
This commit is contained in:
Emma Broman
2021-05-28 17:00:55 +02:00
committed by GitHub
parent a36ac1ee2f
commit 1695937749
88 changed files with 929 additions and 1320 deletions
+6 -4
View File
@@ -511,7 +511,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
, _userProvidedTextureOwner(UserProvidedTextureOptionInfo)
, _parametersOwner(ParametersOwnerOptionInfo)
, _moffatMethodOwner(MoffatMethodOptionInfo)
, _fadeInDistance(
, _fadeInDistances(
FadeInDistancesInfo,
glm::vec2(0.f),
glm::vec2(0.f),
@@ -617,6 +617,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
_otherDataOption.onChange([&]() { _dataIsDirty = true; });
addProperty(_otherDataOption);
_otherDataRange.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_otherDataRange);
addProperty(_otherDataColorMapPath);
@@ -727,9 +728,10 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
if (p.fadeInDistances.has_value()) {
glm::vec2 v = *p.fadeInDistances;
_fadeInDistance = v;
_fadeInDistances = v;
_disableFadeInDistance = false;
addProperty(_fadeInDistance);
_fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_fadeInDistances);
addProperty(_disableFadeInDistance);
}
}
@@ -1034,7 +1036,7 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) {
float fadeInVariable = 1.f;
if (!_disableFadeInDistance) {
float distCamera = static_cast<float>(glm::length(data.camera.positionVec3()));
const glm::vec2 fadeRange = _fadeInDistance;
const glm::vec2 fadeRange = _fadeInDistances;
const double a = 1.f / ((fadeRange.y - fadeRange.x) * PARSEC);
const double b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
const double funcValue = a * distCamera + b;