From 460b849361250a7f695662abbbc7faa55bc74e2f Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 16 Aug 2022 11:45:36 +0200 Subject: [PATCH] Make L2 co-rot trail turn on/off together with the other JWST trails --- .../scene/solarsystem/missions/jwst/toggle_trail.asset | 8 +++++++- .../assets/scene/solarsystem/missions/jwst/trail.asset | 5 ++++- .../solarsystem/planets/earth/lagrange_points/L2.asset | 10 +++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/data/assets/scene/solarsystem/missions/jwst/toggle_trail.asset b/data/assets/scene/solarsystem/missions/jwst/toggle_trail.asset index 9f8d42dc16..6360f6283c 100644 --- a/data/assets/scene/solarsystem/missions/jwst/toggle_trail.asset +++ b/data/assets/scene/solarsystem/missions/jwst/toggle_trail.asset @@ -17,6 +17,7 @@ local toggle_trail = { local launchTrail = "JWSTTrailLaunch" local cruiseTrail = "JWSTTrailCruise" local orbitTrail = "JWSTTrailOrbit" + local coOrbitTrail = "JWSTTrailCoRotOrbit" local visibility if is_declared("args") then @@ -31,7 +32,8 @@ local toggle_trail = { visibility = not ( openspace.getPropertyValue("Scene." .. launchTrail .. ".Renderable.Enabled") or openspace.getPropertyValue("Scene." .. cruiseTrail .. ".Renderable.Enabled") or - openspace.getPropertyValue("Scene." .. orbitTrail .. ".Renderable.Enabled") + openspace.getPropertyValue("Scene." .. orbitTrail .. ".Renderable.Enabled") or + openspace.getPropertyValue("Scene." .. coOrbitTrail .. ".Renderable.Enabled") ) end @@ -47,6 +49,10 @@ local toggle_trail = { "Scene." .. orbitTrail .. ".Renderable.Enabled", visibility ) + openspace.setPropertyValueSingle( + "Scene." .. coOrbitTrail .. ".Renderable.Enabled", + visibility + ) ]], Documentation = [[Toggles the visibility of the JWST trail with an approaching/exiting event. This action takes optional arguments to 1) determine which diff --git a/data/assets/scene/solarsystem/missions/jwst/trail.asset b/data/assets/scene/solarsystem/missions/jwst/trail.asset index a3adf09bde..09aee9de85 100644 --- a/data/assets/scene/solarsystem/missions/jwst/trail.asset +++ b/data/assets/scene/solarsystem/missions/jwst/trail.asset @@ -83,6 +83,7 @@ local JWSTTrailCruise = { -- Trail of JWST relative to L2 after first month to reach L2 -- Gives a better trail history of the orbit around L2 than if it was relative to Earth +-- This does NOT co-rotate withe L2 and gives a saddle look of the trail local JWSTTrailOrbit = { Identifier = "JWSTTrailOrbit", Parent = transforms.L2Position.Identifier, @@ -113,6 +114,8 @@ local JWSTTrailOrbit = { } } +-- Trail of JWST in orbit around L2 that co-rotates with L2 around the Sun +-- This gives the trail a look of a wheel going along L2 around the Sun local JWSTTrailCoRotOrbit = { Identifier = "JWSTTrailCoRotOrbit", Parent = transforms.L2CoRotFrame.Identifier, @@ -130,7 +133,7 @@ local JWSTTrailCoRotOrbit = { Frame = 'L2_COROT', Kernels = { kernels .. "webb.bsp" } }, - Color = { 0.0, 0.9, 0.9 }, + Color = { 0.9, 0.0, 0.9 }, Period = 182.621099, -- About 6 months Resolution = 183 -- About a sample rate of once per day }, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset index 85a87561dd..98a835c794 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset @@ -34,16 +34,12 @@ local L2Position = { } } +-- This ref. frame co-rotates with L2 and is needed for a more intuitive trail of JWST in +-- relation to L2 local L2CoRotFrame = { Identifier = "L2CoRotFrame", - Parent = transforms.SolarSystemBarycenter.Identifier, + Parent = L2Position.Identifier, Transform = { - Translation = { - Type = "SpiceTranslation", - Target = 392, -- L2 - Observer = "SSB", - Kernels = kernels .. "L2_de431.bsp" - }, Rotation = { Type = "SpiceRotation", SourceFrame = "L2_COROT",