Issue/2518 epicycle (#3195)

* added epicycle asset; updated trailFromEarth period and colors; added FromEarth trails to trail toggle;

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
This commit is contained in:
Micah Acinapura
2024-04-19 13:11:32 +02:00
committed by GitHub
parent 7e65a3a32d
commit 9f51549a2a
9 changed files with 96 additions and 16 deletions

View File

@@ -56,6 +56,7 @@ local ToggleTrails = {
end
openspace.setPropertyValue("Scene.*Trail.Renderable.Fade", newFade, 2)
openspace.setPropertyValue("Scene.*trail.Renderable.Fade", newFade, 2)
openspace.setPropertyValue("Scene.*TrailEarth.Renderable.Fade", newFade, 2)
end
]],
Documentation = "Toggle fade for all trails in the Scene",

View File

@@ -0,0 +1,79 @@
asset.require("scene/solarsystem/planets/mercury/trail_earth")
asset.require("scene/solarsystem/planets/venus/trail_earth")
asset.require("scene/solarsystem/planets/mars/trail_earth")
asset.require("scene/solarsystem/planets/jupiter/trail_earth")
asset.require("scene/solarsystem/planets/saturn/trail_earth")
asset.require("scene/solarsystem/planets/uranus/trail_earth")
asset.require("scene/solarsystem/planets/neptune/trail_earth")
local FullCycleAction = {
Identifier = "os.epicycle.SetFull",
Name = "Set full epicycles",
Documentation = [[Sets EnableFade to false for all epicycle trails so that
they show the entire period]],
Command = [[openspace.setPropertyValue("*TrailEarth.Renderable.Appearance.EnableFade", false)]],
GuiPath = "/Trails/Epicycle",
IsLocal = false
}
local FadedCycleAction = {
Identifier = "os.epicycle.SetFaded",
Name = "Set faded epicycles",
Documentation = [[Sets EnableFade to true for all epicycle trails so that
they match the default planet trails]],
Command = [[openspace.setPropertyValue("*TrailEarth.Renderable.Appearance.EnableFade", true)]],
GuiPath = "/Trails/Epicycle",
IsLocal = false
}
local ShowCyclesAction = {
Identifier = "os.epicycle.ShowTrails",
Name = "Enable/Show epicycles",
Documentation = [[Enables and shows in all epicycle trails]],
Command = [[openspace.setPropertyValue("*TrailEarth.Renderable.Enabled", true);
openspace.setPropertyValue("*TrailEarth.Renderable.Fade", 1, 2);]],
GuiPath = "/Trails/Epicycle",
IsLocal = false
}
local FadeoutCyclesAction = {
Identifier = "os.epicycle.HideTrails",
Name = "Hide epicycles",
Documentation = [[Hides all epicycle trails]],
Command = [[openspace.setPropertyValue("*TrailEarth.Renderable.Fade", 0, 2)]],
GuiPath = "/Trails/Epicycle",
IsLocal = false
}
asset.onInitialize(function()
openspace.action.registerAction(FullCycleAction)
openspace.action.registerAction(FadedCycleAction)
openspace.action.registerAction(ShowCyclesAction)
openspace.action.registerAction(FadeoutCyclesAction)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(FadeoutCyclesAction)
openspace.action.removeAction(ShowCyclesAction)
openspace.action.removeAction(FadedCycleAction)
openspace.action.removeAction(FullCycleAction)
end)
asset.export("FullCycleAction", FullCycleAction.Identifier)
asset.export("FadedCycleAction", FadedCycleAction.Identifier)
asset.export("ShowCyclesAction", ShowCyclesAction.Identifier)
asset.export("FadeoutCyclesAction", FadeoutCyclesAction.Identifier)
asset.meta = {
Name = "Epicycle",
Version = "1.0",
Description = [[This asset includes the trails of the planets from earth.
In addition, it provides some actions for manipulating them.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -15,8 +15,8 @@ local JupiterTrailEarth = {
Target = coreKernels.ID.Jupiter,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Color = { 0.8, 0.7, 0.7 },
Period = 4375.0,
Resolution = 1000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },

View File

@@ -14,8 +14,8 @@ local MarsTrailEarth = {
Target = coreKernels.ID.Mars,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Color = { 0.814, 0.305, 0.220 },
Period = 5990.0,
Resolution = 1000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },

View File

@@ -15,8 +15,8 @@ local MercuryTrailEarth = {
Target = coreKernels.ID.Mercury,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Color = { 0.6, 0.5, 0.5 },
Period = 380.0,
Resolution = 1000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },

View File

@@ -15,9 +15,9 @@ local NeptuneTrailEarth = {
Target = coreKernels.ID.Neptune,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Resolution = 1000
Color = { 0.2, 0.5, 1.0 },
Period = 60250.0,
Resolution = 3000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },
GUI = {

View File

@@ -14,9 +14,9 @@ local SaturnTrailEarth = {
Target = coreKernels.ID.Saturn,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Resolution = 1000
Color = { 0.85, 0.75, 0.51 },
Period = 10746.94,
Resolution = 3000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },
GUI = {

View File

@@ -14,9 +14,9 @@ local UranusTrailEarth = {
Target = coreKernels.ID.Uranus,
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Resolution = 1000
Color = { 0.6, 0.95, 1.0 },
Period = 30588.74,
Resolution = 3000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },
GUI = {

View File

@@ -16,7 +16,7 @@ local VenusTrailEarth = {
Observer = coreKernels.ID.Earth
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
Period = 2900.0,
Resolution = 1000
},
Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },