local transforms = asset.require("./transforms")
asset.require("spice/base")
asset.require("./trail")

local Uranus = {
  Identifier = "Uranus",
  Parent = transforms.UranusBarycenter.Identifier,
  Transform = {
    Translation = {
      Type = "SpiceTranslation",
      Target = "URANUS",
      Observer = "URANUS BARYCENTER"
    },
    Rotation = {
      Type = "SpiceRotation",
      SourceFrame = "IAU_URANUS",
      DestinationFrame = "GALACTIC"
    }
  },
  Renderable = {
    Type = "RenderableGlobe",
    Radii = { 25559000, 25559000, 24973000 },
    SegmentsPerPatch = 64,
    Layers = {}
  },
  Tag = { "planet_solarSystem", "planet_giants" },
  GUI = {
    Name = "Uranus",
    Path = "/Solar System/Planets/Uranus",
    Description = "Globe for Uranus"
  }
}

local UranusLabel = {
  Identifier = "UranusLabel",
  Parent = Uranus.Identifier,
  Renderable = {
    Enabled = false,
    Type = "RenderableLabels",
    Text = "Uranus",
    FontSize = 70.0,
    Size = 8.86,
    MinMaxSize = { 1, 100 },
    OrientationOption = "Camera View Direction",
    BlendMode = "Additive"
  },
  Tag = { "solarsystem_labels" },
  GUI = {
    Name = "Uranus Label",
    Path = "/Solar System/Planets/Uranus",
    Description = "Main planet label for Uranus",
  }
}

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



asset.meta = {
  Name = "Uranus",
  Version = "1.1",
  Description = "Uranus globe, and main planet label",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
