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



local Trail = {
  Identifier = "TritonTrail",
  Parent = transforms.NeptuneBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "TRITON",
      Observer = "NEPTUNE BARYCENTER"
    },
    Color = { 0.2, 0.5, 0.75 },
    Period = 5.877,
    Resolution = 1000
  },
  Tag = { "moonTrail_solarSystem", "moonTrail_giants", "moonTrail_neptune" },
  GUI = {
    Name = "Triton Trail",
    Path = "/Solar System/Planets/Neptune/Major Moons/Triton"
  }
}

asset.onInitialize(function()
  openspace.spice.loadKernel(kernel.nep097)


  openspace.addSceneGraphNode(Trail)
end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(Trail)


  openspace.spice.unloadKernel(kernel.nep097)
end)

asset.export(Trail)


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