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


local textures = asset.syncedResource({
  Type = "HttpSynchronization",
  Name = "Sun textures",
  Identifier = "sun_textures",
  Version = 4
})

local SunMarker = {
  Identifier = "SunMarker",
  Parent = transforms.SolarSystemBarycenter.Identifier,
  Renderable = {
    Enabled = false,
    Type = "RenderablePlaneImageLocal",
    Size = 3.0E11,
    Origin = "Center",
    Billboard = true,
    Texture = textures .. "marker.png",
    BlendMode = "Additive"
  },
  GUI = {
    Name = "Sun Marker",
    Path = "/Solar System/Sun",
    Description = "Sun marker with name, sized for Solar System view"
  }
}

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



asset.meta = {
  Name = "Sun marker",
  Version = "1.1",
  Description = "Marker for the Sun, with a stick and label",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
