local proceduralGlobes = asset.require("util/procedural_globe")
local transforms = asset.require("./transforms")
local kernel = asset.require("./kernels").nep081



local Triton = {
  Identifier = "Triton",
  Parent = {
    Identifier = transforms.NeptuneBarycenter.Identifier,
    Spice = "NEPTUNE BARYCENTER"
  },
  Spice = "TRITON",
  Radii = { 2709000, 2706000, 2705000 },
  Tags = { "moon_solarSystem", "moon_giants", "moon_neptune" },
  TrailTags = { "moonTrail_solarSystem", "moonTrail_giants", "moonTrail_neptune" },
  GUI = {
    Path = "/Solar System/Planets/Neptune/Moons/Irregular Prograde Moons"
  },
  TrailColor = { 0.2, 0.5, 0.75 },
  OrbitPeriod = 5.877,
  Kernels = kernel
}

local nodes = proceduralGlobes.createGlobes({ Triton })

asset.onInitialize(function()
  for _, node in ipairs(nodes) do
    openspace.addSceneGraphNode(node)
  end
end)
  
asset.onDeinitialize(function()
  for i = #nodes, 1, -1 do
    openspace.removeSceneGraphNode(nodes[i])
  end
end)
  
for _, node in ipairs(nodes) do
  asset.export(node)
end



asset.meta = {
  Name = "Triton",
  Version = "1.1",
  Description = [[Procedural Globe asset containing Neptune's moon: Triton. A blank globe
    and SPICE trail are generated for the moon]],
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
