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



local MoonTrail = {
  Identifier = "MoonTrail",
  Parent = transforms.EarthBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "MOON",
      Observer = "EARTH BARYCENTER"
    },
    Color = { 0.5, 0.3, 0.3 },
    Period = 27,
    Resolution = 1000,
    Tag = { "moonTrail_solarSystem", "moonTrail_terrestrial", "moonTrail_earth" }
  },
  GUI = {
    Name = "Moon Trail",
    Path = "/Solar System/Planets/Earth/Moon"
  }
}


asset.onInitialize(function()
  openspace.addSceneGraphNode(MoonTrail)
end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(MoonTrail)
end)

asset.export(MoonTrail)



asset.meta = {
  Name = "Moon Trail",
  Version = "1.1",
  Description = [[Moon Trail - This asset contains the trail of the Moon. Data from NASA
    Spice (see base spice asset)]],
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
