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

local labelsPath = asset.syncedResource({
  Name = "Saturn Labels",
  Type = "HttpSynchronization",
  Identifier = "saturn_labels",
  Version = 1
})

local Mimas = {
  Identifier = "Mimas",
  Parent = transforms.SaturnBarycenter.Identifier,
  Transform = {
    Translation = {
      Type = "SpiceTranslation",
      Target = "MIMAS",
      Observer = "SATURN BARYCENTER",
      Kernels = kernel
    },
    Rotation = {
      Type = "SpiceRotation",
      SourceFrame = "IAU_MIMAS",
      DestinationFrame = "GALACTIC"
    }
  },
  Renderable = {
    Type = "RenderableGlobe",
    Radii = { 207000, 197000, 191000 },
    SegmentsPerPatch = 64,
    Layers = { },
    Labels = {
      Enabled = false,
      FileName = labelsPath .. "mimas.labels",
      AlignmentOption = "Horizontally", -- or Circularly
      FontSize = 20.0,
      Size = 7.7,
      FadeInEnabled = true,
      FadeOutEnabled = true,
      FadeDistances = { 400000.0, 1000000.0 },
      DistanceEPS = 25000.0,
      Color = { 1.0, 1.0, 0.0 }
    }
  },
  Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
  GUI = {
    Name = "Mimas",
    Path = "/Solar System/Planets/Saturn/Moons",
    Description = "That's no moon..."
  }
}

asset.onInitialize(function()
  openspace.addSceneGraphNode(Mimas)
end)
  
asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(Mimas)
end)
  
asset.export(Mimas)



asset.meta = {
  Name = "Mimas",
  Version = "1.1",
  Description = "Mimas globe with labels",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
