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



local models = asset.syncedResource({
  Name = "New Horizons Model",
  Type = "HttpSynchronization",
  Identifier = "newhorizons_model",
  Version = 2
})


local NewHorizons = {
  Identifier = "NewHorizons",
  Parent = transforms.NewHorizonsPosition.Identifier,
  Renderable = {
    Type = "RenderableModel",
    Body = "NEW HORIZONS",
    GeometryFile = models .. "NewHorizonsCleanModel.obj",
    AmbientIntensity = 0.2,
    DiffuseIntensity = 1.0,
    SpecularIntensity = 1.0,
    LightSources = {
      sun.LightSource
    }
  },
  GUI = {
    Name = "New Horizons",
    Path = "/Solar System/Missions/New Horizons"
  }
}


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

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

asset.export(NewHorizons)
