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



local EarthTrail = {
  Identifier = "EarthTrail",
  Parent = transforms.SolarSystemBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "EARTH",
      Observer = "SSB"
    },
    Color = { 0.5, 0.8, 1.0 },
    Period = 365.242,
    Resolution = 1000,
    Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" }
  },
  GUI = {
    Name = "Earth Trail",
    Path = "/Solar System/Planets/Earth"
  }
}

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



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