local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local kernels = asset.require('../kernels')


local JuiceTrail = {
  Identifier = "JuiceTrail",
  Parent = sunTransforms.SolarSystemBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailTrajectory",
    Translation = {
      Type = "SpiceTranslation",
      Target = "JUICE",
      Observer = "SSB",
      Kernels = kernels.Kernels
    },
    Color = { 0.85, 0.85, 0.85 },
    StartTime = "2023 APR 05 12:00:00.000",
    EndTime = "2035 OCT 05 00:00:00.000",
    SampleInterval = 3600
  },
  GUI = {
    Name = "Juice Trail",
    Path = "/Solar System/Missions/Juice",
    Description = "Juice's trajectory relative to the solar system's barycenter"
  }
}


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

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

asset.export(JuiceTrail)


asset.meta = {
  Name = "Juice trajectory relative to the solar system's barycenter",
  Version = "1.0",
  Description = [[
    The trajectory of the Juice spacecraft relative to the solar system's barycenter
  ]],
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
