local textures = asset.syncedResource({
  Name = "Exoplanets Textures",
  Type = "HttpSynchronization",
  Identifier = "digitaluniverse_exoplanets_textures",
  Version = 1
})

local speck = asset.syncedResource({
  Name = "Exoplanets Speck Files",
  Type = "HttpSynchronization",
  Identifier = "digitaluniverse_exoplanets_speck",
  Version = 3
})


local Object = {
  Identifier = "Exoplanets",
  Renderable = {
    Type = "RenderableBillboardsCloud",
    Enabled = false,
    Labels = {
      File = speck .. "expl.label",
      Color = { 0.3, 0.3, 0.8 },
      Size = 14.8,
      MinMaxSize = { 10, 100 },
      Unit = "pc"
    },
    Color = { 1.0, 1.0, 1.0 },
    Opacity = 1.0,
    Texture = textures .. "target-blue.png",
    File = speck .. "expl.speck",
    Unit = "pc",
    ScaleFactor = 388.67923,
    CorrectionSizeEndDistance = 15.23,
    CorrectionSizeFactor = 13.3,
    BillboardMinMaxSize = { 0.0, 75.0 },
    EnablePixelSizeControl = true
  },
  GUI = {
    Name = "Exoplanets",
    Path = "/Milky Way/Exoplanets",
    Description = [[Census: 5,361 planets in 3,982 systems. DU Version 20.12. <br>
      Extrasolar planets, or exoplanets, are a relatively new phenomenon in
      astronomy. While many astronomers believed in their existence, no
      observational evidence was available until 1995. Since that time, scientists
      have discovered thousands of systems consisting of one or more planets around
      a host star.(Description from URL) <br><br> Data Reference: NASA Exoplanet
      Archive (CalTech/NASA)]]
  }
}


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

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

asset.export(Object)



asset.meta = {
  Name = "Exoplanets",
  Version = "1.1",
  Description = "Digital Universe asset for Exoplanets",
  Author = "Brian Abbott (AMNH)",
  URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe",
  License = "AMNH Digital Universe"
}
