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



local TethysTrail = {
  Identifier = "TethysTrail",
  Parent = transforms.SaturnBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "TETHYS",
      Observer = "SATURN BARYCENTER"
    },
    Color = { 0.5, 0.3, 0.3 },
    Period = 45.0 / 24.0,
    Resolution = 1000
  },
  Tag = { "moonTrail_solarSystem", "moonTrail_giants", "moonTrail_saturn", "moonTrail_major_saturn" },
  GUI = {
    Name = "Tethys Trail",
    Path = "/Solar System/Planets/Saturn/Major Moons/Tethys",
    Description = "Trail of Saturn's moon Tethys as observed by Saturn"
  }
}


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

  openspace.addSceneGraphNode(TethysTrail)
end)

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

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

asset.export(TethysTrail)



asset.meta = {
  Name = "Tethys Trail",
  Version = "1.0",
  Description = "Main trail for Tethys. Data from NASA Spice (see base spice asset)",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
