mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 14:58:37 -05:00
Add Hubble trail asset and turn off ISS trail
This commit is contained in:
89
data/assets/scene/solarsystem/missions/jwst/hubble.asset
Normal file
89
data/assets/scene/solarsystem/missions/jwst/hubble.asset
Normal file
@@ -0,0 +1,89 @@
|
||||
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
local satelliteHelper = asset.require('util/tle_helper')
|
||||
|
||||
local url = "https://celestrak.com/satcat/tle.php?CATNR=20580"
|
||||
local identifier = "HST"
|
||||
local filename = "HST.txt"
|
||||
local nodes = {}
|
||||
local tle = satelliteHelper.downloadTLEFile(asset, url, identifier, filename)
|
||||
|
||||
local initializeAndAddNodes = function()
|
||||
local lineElement = satelliteHelper.makeSingleLineElement(tle, filename)
|
||||
local period = satelliteHelper.getPeriodFromElement(lineElement)
|
||||
local path = tle .. "/" .. filename
|
||||
|
||||
local HubblePosition = {
|
||||
Identifier = "HubblePosition",
|
||||
Parent = transforms.EarthInertial.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "TLETranslation",
|
||||
Body = identifier,
|
||||
Observer = transforms.EarthInertial.Identifier,
|
||||
File = path,
|
||||
LineNumber = 1
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "GALACTIC",
|
||||
DestinationFrame = "J2000",
|
||||
}
|
||||
},
|
||||
Tag = { "earth_satellite", "hubble" },
|
||||
GUI = {
|
||||
Name = "Hubble Position",
|
||||
Path = "/Solar System/Planets/Earth/Satellites/Hubble",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
local HubbleTrail = {
|
||||
Identifier = "HubbleTrail",
|
||||
Parent = transforms.EarthInertial.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "TLETranslation",
|
||||
Body = identifier,
|
||||
Observer = transforms.EarthInertial.Identifier,
|
||||
File = path,
|
||||
LineNumber = 1
|
||||
},
|
||||
RenderBinMode = "PostDeferredTransparent",
|
||||
Color = { 0.0, 0.902, 0.6},
|
||||
Fade = 1.5,
|
||||
Period = period,
|
||||
Resolution = 320
|
||||
},
|
||||
Tag = { "earth_satellite", "hubble" },
|
||||
GUI = {
|
||||
Name = "Hubble Trail",
|
||||
Path = "/Solar System/Planets/Earth/Satellites/Hubble"
|
||||
}
|
||||
}
|
||||
|
||||
return { HubblePosition, HubbleTrail }
|
||||
end
|
||||
|
||||
asset.onInitialize(function ()
|
||||
nodes = initializeAndAddNodes()
|
||||
for _, node in ipairs(nodes) do
|
||||
openspace.addSceneGraphNode(node)
|
||||
end
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
for i=1, #nodes do
|
||||
openspace.removeSceneGraphNode(nodes[#nodes + 1 - i].Identifier)
|
||||
end
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Hubble Space Telescope",
|
||||
Version = "1.0",
|
||||
Description = [[ Position and Trail for Hubble Space Telescope, trail from
|
||||
celestrak.com]],
|
||||
Author = "Dan Tell",
|
||||
URL = "www.calacademy.org",
|
||||
License = "CC-BY"
|
||||
}
|
||||
@@ -84,6 +84,7 @@
|
||||
"scene/solarsystem/missions/jwst/jwst",
|
||||
"scene/solarsystem/missions/jwst/trail",
|
||||
"scene/solarsystem/missions/jwst/hudf",
|
||||
"scene/solarsystem/missions/jwst/hubble",
|
||||
"scene/solarsystem/missions/jwst/timelapse",
|
||||
"scene/solarsystem/missions/jwst/toggle_trail",
|
||||
"scene/digitaluniverse/hdf"
|
||||
@@ -308,6 +309,11 @@
|
||||
"name": "Scene.Earth.Renderable.Layers.ColorLayers.ESRI_VIIRS_Combo.Enabled",
|
||||
"type": "setPropertyValueSingle",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "Scene.ISS_trail.Renderable.Enabled",
|
||||
"type": "setPropertyValueSingle",
|
||||
"value": "false"
|
||||
}
|
||||
],
|
||||
"time": {
|
||||
|
||||
Reference in New Issue
Block a user