mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-23 05:19:18 -06:00
Restored ability to change trail colors in satellite asset files.
This commit is contained in:
@@ -4,7 +4,7 @@ local shared = asset.require('../satellites_shared')
|
||||
local group = {
|
||||
Title = "SpaceStations",
|
||||
Url = "http://celestrak.com/NORAD/elements/stations.txt",
|
||||
TrailColor = { 0.0, 1.0, 0.0 }
|
||||
TrailColor = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
|
||||
local tle = shared.downloadTLEFile(asset, group.Url, group.Title)
|
||||
|
||||
@@ -177,8 +177,8 @@ RenderableTrail::Appearance::Appearance()
|
||||
: properties::PropertyOwner(AppearanceInfo)
|
||||
, lineColor(LineColorInfo, glm::vec3(1.0f, 1.0f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, useLineFade(EnableFadeInfo, true)
|
||||
, lineFade(FadeInfo, 0.4f, 0.f, 30.f)
|
||||
, lineWidth(LineWidthInfo, 1.1f, 1.f, 20.f)
|
||||
, lineFade(FadeInfo, 1.f, 0.f, 30.f)
|
||||
, lineWidth(LineWidthInfo, 2.f, 1.f, 20.f)
|
||||
, pointSize(PointSizeInfo, 1, 1, 64)
|
||||
, renderingModes(
|
||||
RenderingModeInfo,
|
||||
@@ -201,17 +201,6 @@ RenderableTrail::Appearance::Appearance()
|
||||
|
||||
RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
/*
|
||||
, _lineColor(LineColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _useLineFade(EnableFadeInfo, true)
|
||||
, _lineFade(FadeInfo, 1.f, 0.f, 30.f)
|
||||
, _lineWidth(LineWidthInfo, 2.f, 1.f, 20.f)
|
||||
, _pointSize(PointSizeInfo, 1, 1, 64)
|
||||
, _renderingModes(
|
||||
RenderingModeInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
*/
|
||||
{
|
||||
addProperty(_opacity);
|
||||
registerUpdateRenderBinFromOpacity();
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
namespace {
|
||||
constexpr const char* ProgramName = "RenderableSatellites";
|
||||
constexpr const char* _loggerCat = "SpaceDebris";
|
||||
constexpr const char* _loggerCat = "Satellites";
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo PathInfo = {
|
||||
"Path",
|
||||
@@ -77,7 +77,12 @@ namespace {
|
||||
"The fading factor that is applied to the trail if the 'EnableFade' value is "
|
||||
"'true'. If it is 'false', this setting has no effect. The higher the number, "
|
||||
"the less fading is applied."
|
||||
};
|
||||
};
|
||||
constexpr openspace::properties::Property::PropertyInfo LineColorInfo = {
|
||||
"Color",
|
||||
"Color",
|
||||
"This value determines the RGB main color for the lines and points of the trail."
|
||||
};
|
||||
|
||||
constexpr const char* KeyFile = "Path";
|
||||
constexpr const char* KeyLineNum = "LineNumber";
|
||||
@@ -303,13 +308,18 @@ documentation::Documentation RenderableSatellites::Documentation() {
|
||||
Optional::Yes,
|
||||
LineWidthInfo.description
|
||||
},
|
||||
|
||||
{
|
||||
FadeInfo.identifier,
|
||||
new DoubleVerifier,
|
||||
Optional::Yes,
|
||||
FadeInfo.description
|
||||
}
|
||||
},
|
||||
{
|
||||
LineColorInfo.identifier,
|
||||
new DoubleVector3Verifier,
|
||||
Optional::No,
|
||||
LineColorInfo.description
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -334,6 +344,10 @@ RenderableSatellites::RenderableSatellites(const ghoul::Dictionary& dictionary)
|
||||
_lineFade =
|
||||
static_cast<float>(dictionary.value<double>(FadeInfo.identifier));
|
||||
|
||||
if (dictionary.hasKeyAndValue<glm::vec3>(LineColorInfo.identifier)) {
|
||||
_appearance.lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
|
||||
}
|
||||
|
||||
addPropertySubOwner(_appearance);
|
||||
addProperty(_path);
|
||||
addProperty(_nSegments);
|
||||
|
||||
Reference in New Issue
Block a user