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



local PlutoBarycenterTrail = {
  Identifier = "PlutoBarycenterTrail",
  Parent = transforms.SolarSystemBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "PLUTO BARYCENTER",
      Observer = "SSB"
    },
    Color = { 0.3, 0.7, 0.3 },
    Period = 365.25,
    Resolution = 1000
  },
  Tag = { "planetTrail_solarSystem", "planetTrail_dwarf" },
  GUI = {
    Name = "Pluto Barycenter Trail",
    Path = "/Solar System/Dwarf Planets/Pluto",
    Description = [[Precise trail of Pluto from NASA SPICE data. Not containing full
      orbit]]
  }
}


asset.onInitialize(function()
  openspace.spice.loadKernel(kernels.PlutoKernels)

  openspace.addSceneGraphNode(PlutoBarycenterTrail)
end)

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

  openspace.spice.unloadKernel(kernels.PlutoKernels)
end)

asset.export(PlutoBarycenterTrail)



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