-- Before using this asset the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task'

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



local MaxApogee = 2 * 10946320

local DebrisVolumeCartesian = {
  Identifier = "DebrisVolumeCartesian",
  Parent = transforms.EarthInertial.Identifier,
  Transform = {
    Scale = {
      Type = "StaticScale",
      Scale = MaxApogee
    }
  },
  Renderable = {
    Type = "RenderableTimeVaryingVolume",
    SourceDirectory = asset.localResource("generatedCartesian"),
    TransferFunction = asset.localResource("transferfunction.txt"),
    StepSize = 0.01,
    MinValue = 0,
    MaxValue = 1,
    GridType = "Cartesian",
    SecondsBefore = 50 * 365 * 24 * 60 * 60,
    SecondsAfter = 50 * 365 * 24 * 60 * 60
  },
  GUI = {
    Name = "Debris Volume - Cartesian",
    Path = "/Volumes"
  }
}


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

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

asset.export(DebrisVolumeCartesian)



asset.meta = {
  Name = "Satellites Debris - Volume Cartesian",
  Version = "1.0",
  Description = "Satellites asset for Debris - Volume Cartesian. Example asset",
  Author = "OpenSpace Team",
  URL = "",
  License = "MIT"
}
