Address PR comments

This commit is contained in:
Malin E
2022-04-07 13:22:06 +02:00
parent 940a1d5a98
commit 45c776b7ba
4 changed files with 15 additions and 17 deletions

View File

@@ -3,13 +3,11 @@ asset.require("spice/base") -- openspace.time.advancedTime depends on SPICE
-- Function to advance a time stamp in the given number of days, hours, minutes and
-- seconds. returns the new time stamp
local function advance(time, days, hours, minutes, seconds)
local result = openspace.time.advancedTime(
openspace.time.advancedTime(
openspace.time.advancedTime(
openspace.time.advancedTime(time, tostring(days) .. "d"),
tostring(hours) .. "h"),
tostring(minutes) .. "m"),
tostring(seconds) .. "s")
local result = ""
result = openspace.time.advancedTime(time, tostring(days) .. "d")
result = openspace.time.advancedTime(result, tostring(hours) .. "h")
result = openspace.time.advancedTime(result, tostring(minutes) .. "m")
result = openspace.time.advancedTime(result, tostring(seconds) .. "s")
return result
end
@@ -555,7 +553,7 @@ local function createActions()
openspace.time.setDeltaTime(-deltaTime)
-- Switch timelapse script
if (deltaTime < 0) then
if deltaTime < 0 then
-- Going backwards and switching to forwards
openspace.scriptScheduler.clear(0)
]] .. createForwardTimelapse() .. [[
@@ -567,14 +565,14 @@ local function createActions()
-- Update the dashboard text
local text = openspace.getPropertyValue("Dashboard.JWSTStateText.Text")
if(string.len(text) > 14) then
if string.len(text) > 14 then
local newText = ""
if(text:sub(13, 13) == "-") then
if text:sub(13, 13) == "-" then
newText = text:sub(1,12) .. text:sub(14)
else
newText = text:sub(1,12) .. "-" .. text:sub(13)
end
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", tostring(newText))
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", newText)
else
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", "")
end

View File

@@ -31,7 +31,7 @@ local JWSTTrailLaunch = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst_launch.hrz",
HorizonsTextFile = horizons .. "horizons_jwst_launch.hrz",
},
Color = { 0.9, 0.9, 0.0 },
StartTime = "2021 DEC 25 12:50:00",
@@ -61,7 +61,7 @@ local JWSTTrailOrbit = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst_orbit.hrz",
HorizonsTextFile = horizons .. "horizons_jwst_orbit.hrz",
},
Color = { 0.9, 0.9, 0.0 },
Period = 182.621099, -- About 6 months
@@ -88,7 +88,7 @@ local JWSTSunTrail = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst_sun.hrz",
HorizonsTextFile = horizons .. "horizons_jwst_sun.hrz",
},
Color = { 0.0, 0.9, 0.9 },
Period = 365.242,

View File

@@ -19,11 +19,11 @@ local JWSTPosition = {
Keyframes = {
["2021 DEC 25 12:50:00"] = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons.. "/horizons_jwst_launch.hrz",
HorizonsTextFile = horizons .. "horizons_jwst_launch.hrz",
},
["2022 JAN 25 00:00:00"] = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst_orbit.hrz",
HorizonsTextFile = horizons .. "horizons_jwst_orbit.hrz",
}
}
},

View File

@@ -689,7 +689,7 @@ void RenderableModel::update(const UpdateData& data) {
setBoundingSphere(_geometry->boundingRadius() * _modelScale *
glm::compMax(data.modelTransform.scale)
);
// Set Interaction sphere to be 10% in size as the bounding sphere
// Set Interaction sphere size to be 10% of the bounding sphere
setInteractionSphere(_boundingSphere * 0.1);
if (_geometry->hasAnimation() && !_animationStart.empty()) {