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



local SunRadius = 6.957E8
local EarthRadius = 6.371E6

local EarthBarycenterAxes = {
  Identifier = "EarthBarycenterAxes",
  Parent = earthTransforms.EarthBarycenter.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = EarthRadius * 3.5
    }
  },
  Renderable = {
    Type = "RenderableCartesianAxes"
  },
  GUI = {
    Path = "/Other/Coordinate Systems"
  }
}

local EarthInertialAxes = {
  Identifier = "EarthInertialAxes",
  Parent = earthTransforms.EarthInertial.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = EarthRadius * 2.5
    }
  },
  Renderable = {
    Type = "RenderableCartesianAxes"
  },
  GUI = {
    Path = "/Other/Coordinate Systems"
  }
}

local EarthIAUAxes = {
  Identifier = "EarthIAUAxes",
  Parent = earthTransforms.EarthIAU.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = EarthRadius * 1.5
    }
  },
  Renderable = {
    Type = "RenderableCartesianAxes"
  },
  GUI = {
    Path = "/Other/Coordinate Systems"
  }
}

local SunIAUAxes = {
  Identifier = "SunIAUAxes",
  Parent = sunTransforms.SunIAU.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = SunRadius * 300
    }
  },
  Renderable = {
    Type = "RenderableCartesianAxes"
  },
  GUI = {
    Path = "/Other/Coordinate Systems"
  }
}

local SolarSystemBarycenterAxes = {
  Identifier = "SolarSystemBarycenterAxes",
  Parent = sunTransforms.SolarSystemBarycenter.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = SunRadius * 300
    }
  },
  Renderable = {
    Type = "RenderableCartesianAxes"
  },
  GUI = {
    Path = "/Other/Coordinate Systems"
  }
}


asset.onInitialize(function()
  openspace.addSceneGraphNode(EarthBarycenterAxes)
  openspace.addSceneGraphNode(EarthInertialAxes)
  openspace.addSceneGraphNode(EarthIAUAxes)
  openspace.addSceneGraphNode(SunIAUAxes)
  openspace.addSceneGraphNode(SolarSystemBarycenterAxes)

end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(SolarSystemBarycenterAxes)
  openspace.removeSceneGraphNode(SunIAUAxes)
  openspace.removeSceneGraphNode(EarthIAUAxes)
  openspace.removeSceneGraphNode(EarthInertialAxes)
  openspace.removeSceneGraphNode(EarthBarycenterAxes)
end)

asset.export(EarthBarycenterAxes)
asset.export(EarthInertialAxes)
asset.export(EarthIAUAxes)
asset.export(SunIAUAxes)
asset.export(SolarSystemBarycenterAxes)
