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



local Kerberos = {
  Identifier = "Kerberos",
  Parent = transforms.PlutoBarycenter.Identifier,
  Transform = {
    Translation = {
      Type = "SpiceTranslation",
      Target = "KERBEROS",
      Observer = "PLUTO BARYCENTER"
    }
  },
  Renderable = {
    Type = "RenderableGlobe",
    Radii = { 10000, 10000, 10000 },
    SegmentsPerPatch = 64,
    Layers = {}
  },
  Tag = { "moon_solarSystem", "moon_dwarf", "moon_pluto", "moon_minor" },
  GUI = {
    Path = "/Solar System/Dwarf Planets/Pluto/Moons/Kerberos"
  }
}

local KerberosTrail = {
  Identifier = "KerberosTrail",
  Parent = transforms.PlutoBarycenter.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "SpiceTranslation",
      Target = "KERBEROS",
      Observer = "PLUTO BARYCENTER",
    },
    Color = { 0.00, 0.62, 1.00 },
    Period = 32.16756,
    Resolution = 1000
  },
  Tag = {
    "moonTrail_solarSystem",
    "moonTrail_dwarf",
    "moonTrail_pluto",
    "moonTrail_minor"
  },
  GUI = {
    Name = "Kerberos Trail",
    Path = "/Solar System/Dwarf Planets/Pluto/Moons/Kerberos"
  }
}

local KerberosLabel = {
  Identifier = "KerberosLabel",
  Parent = Kerberos.Identifier,
  Renderable = {
    Enabled = false,
    Type = "RenderableLabel",
    Text = "Kerberos",
    FontSize = 70.0,
    Size = 6.0,
    MinMaxSize = { 1, 25 },
    OrientationOption = "Camera View Direction",
    BlendMode = "Normal",
    EnableFading = true,
    FadeUnit = "Mm",
    FadeDistances = { 250.0, 1000.0 },
    FadeWidths = { 150.0, 500.0 }
  },
  Tag = { "solarsystem_labels", "moon_labels", "minor_moon_labels" },
  GUI = {
    Name = "Kerberos Label",
    Path = "/Solar System/Dwarf Planets/Pluto/Moons/Kerberos",
    Description = "Label for Pluto's moon Kerberos"
  }
}


asset.onInitialize(function()
  openspace.addSceneGraphNode(Kerberos)
  openspace.addSceneGraphNode(KerberosTrail)
  openspace.addSceneGraphNode(KerberosLabel)
end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(KerberosLabel)
  openspace.removeSceneGraphNode(KerberosTrail)
  openspace.removeSceneGraphNode(Kerberos)
end)

asset.export(Kerberos)
asset.export(KerberosTrail)
asset.export(KerberosLabel)



asset.meta = {
  Name = "Kerberos",
  Version = "1.0",
  Description = [[Globe and trail for Pluto's moon Kerberos. Data from NASA Spice (see
    base spice asset)]],
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
