local transforms = asset.require("scene/solarsystem/planets/earth/transforms")

local omm = asset.syncedResource({
  Name = "Satellite OMM Data (Breeze-M Breakup)",
  Type = "UrlSynchronization",
  Identifier = "satellite_omm_data_2012-044",
  Url = "https://www.celestrak.com/NORAD/elements/gp.php?INTDES=2012-044&FORMAT=kvn",
  Filename = "2012-044.txt",
  Override = true
})

local satellites = {
  Identifier = "2012-044",
  Parent = transforms.EarthInertial.Identifier,
  Renderable = {
    Type = "RenderableOrbitalKepler",
    Path = omm .. "2012-044.txt",
    Format = "OMM",
    SegmentQuality = 3,
    Color = { 0.25, 0.35, 0.45 },
    Fade = 1.5,
    RenderBinMode = "PostDeferredTransparent"
  },
  Tag = { "earth_satellites" },
  GUI = {
    Name = "Breeze-M Breakup",
    Path = "/Solar System/Planets/Earth/Satellites"
  }
}

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

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

asset.export(satellites)



asset.meta = {
  Name = "Satellites Debris - Breeze-M Breakup",
  Version = "1.0",
  Description = "Satellites asset for Debris - Breeze-M Breakup. Data from Celestrak",
  Author = "OpenSpace Team",
  URL = "https://celestrak.com/events/38746-Breakup/",
  License = "Celestrak"
}
