local transforms = asset.require('../transforms')
local assetHelper = asset.require('util/asset_helper')
local kernel = asset.require('../kernels').sat375
asset.request('./trail')



-- local textures = asset.syncedResource({
--     Name = "Hyperion textures",
--     Type = "HttpSynchronization",
--     Identifier = "hyperion_textures",
--     Version = 1
-- })

local Hyperion = {
    Identifier = "Hyperion",
    Parent = transforms.SaturnBarycenter.Identifier,
    Transform = {
        Translation = {
            Type = "SpiceTranslation",
            Target = "HYPERION",
            Observer = "SATURN BARYCENTER",
            Kernels = kernel
        },
        Rotation = {
            Type = "SpiceRotation",
            SourceFrame = "IAU_HYPERION",
            DestinationFrame = "GALACTIC"
        }
    },
    Renderable = {
        Type = "RenderableGlobe",
        Radii = { 360200, 266000, 205400},
        SegmentsPerPatch = 64,
        Layers = {
            -- ColorLayers = {
            --     {
            --         Name = "Hyperion Texture",
            --         FilePath = textures .. "/hyperion.jpg",
            --         Enabled = true
            --     }
            -- }
        }
    },
    Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
    GUI = {
        Path = "/Solar System/Planets/Saturn/Moons"
    }
}



assetHelper.registerSceneGraphNodesAndExport(asset, { Hyperion })


Remove Hyperion's rotation as there is no SPICE information for it available
local transforms = asset.require('../transforms')
local assetHelper = asset.require('util/asset_helper')
local kernel = asset.require('../kernels').sat375
asset.request('./trail')



-- local textures = asset.syncedResource({
--     Name = "Hyperion textures",
--     Type = "HttpSynchronization",
--     Identifier = "hyperion_textures",
--     Version = 1
-- })

local Hyperion = {
    Identifier = "Hyperion",
    Parent = transforms.SaturnBarycenter.Identifier,
    Transform = {
        Translation = {
            Type = "SpiceTranslation",
            Target = "HYPERION",
            Observer = "SATURN BARYCENTER",
            Kernels = kernel
        }
        --[[
         The IAU report does not give an orientation model for Hyperion.
         Hyperion's rotation is in chaotic and is not predictable for
         long periods.
        ]]--
    },
    Renderable = {
        Type = "RenderableGlobe",
        Radii = { 360200, 266000, 205400},
        SegmentsPerPatch = 64,
        Layers = {
            -- ColorLayers = {
            --     {
            --         Name = "Hyperion Texture",
            --         FilePath = textures .. "/hyperion.jpg",
            --         Enabled = true
            --     }
            -- }
        }
    },
    Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
    GUI = {
        Path = "/Solar System/Planets/Saturn/Moons"
    }
}



assetHelper.registerSceneGraphNodesAndExport(asset, { Hyperion })