Files
OpenSpace/data/assets/mas.scene
T
2018-07-17 11:17:27 -04:00

89 lines
2.7 KiB
Plaintext

local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
asset.require('util/default_dashboard')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
assetHelper.requestAll(asset, 'scene/digitaluniverse')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
-- asset.request('customization/globebrowsing')
local sunAsset = asset.require('scene/solarsystem/sun/sun')
-- local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
local masAsset = asset.require('scene/solarsystem/model/mas/mas')
local Keybindings = {
{
Key = "F7",
Command = "openspace.time.setTime('2017 AUG 20 00:00:00');",
Documentation = "Set time with margin to when eclipse data starts",
Local = false
},
{
Key = "F8",
Command = "openspace.time.setTime('2017 AUG 21 17:00:00');",
Documentation = "Set time to when eclipse data starts",
Local = false
},
{
Key = "F9",
Command = "openspace.setPropertyValueSingle('Scene.SunGlare.renderable.Enabled', false);",
Documentation = "Turn off sun glare",
Local = false
},
{
Key = "r",
Command = "openspace.setPropertyValueSingle('Scene.Mas.renderable.Enabled', false);",
Documentation = "Set Mas volume off",
Local = false
},
{
Key = "a",
Command = "openspace.setPropertyValueSingle('Scene.Mas.renderable.Enabled', true);",
Documentation = "Set Mas volume on",
Local = false
}
}
asset.onInitialize(function ()
-- openspace.time.setTime("2017 JUN 01 00:00:00")
openspace.time.setTime(openspace.time.currentWallTime())
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
-- openspace.globebrowsing.loadWMSServersFromFile(
-- openspace.absPath("${DATA}/globebrowsing_servers.lua")
-- )
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.renderable.Enabled",
"Disable or enable all trails of the sHmmcene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Focus = masAsset.Mas.Identifier,
Position = { 10000000000, 10000000000, 10000000000 },
Rotation = { 0.758797, 0.221490, -0.605693, -0.091135 },
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.renderable.Enabled")
end)