local transforms = asset.require("scene/solarsystem/sun/transforms")
local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms")
asset.require("spice/base")



local UranusTrailEarth = {
  Identifier = "UranusTrailEarth",
  Parent = earthTransforms.EarthBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "URANUS",
      Observer = "EARTH"
    },
    Color = { 1.0, 0.5, 0.2 },
    Period = 224.695,
    Resolution = 1000,
    Enabled = false
  },
  Tag = { "planetTrail_solarSystem_alt", "planetTrail_terrestrial_alt" },
  GUI = {
    Name = "Uranus trail from Earth",
    Path = "/Solar System/Planets/Uranus",
    Hidden = false,
    Description = "Trail of Uranus as observed by the Earth",
  }
}

asset.onInitialize(function()
  openspace.addSceneGraphNode(UranusTrailEarth)
end)
  
asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(UranusTrailEarth)
end)
  
asset.export(UranusTrailEarth)



asset.meta = {
  Name = "Uranus Trail from Earth",
  Version = "1.1",
  Description = [[Alternate trail of Uranus, as observed by the Earth rather then the Sun.
    Data from NASA SPICE (see base spice asset)]],
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
