Files
OpenSpace/data/assets/base.asset
Alexander Bock 157c653afc Moved the volume.asset from customization to scene/milkyway/milkyway/volume.asset
Make the Galaxy volume a default
Small changes here and there
2019-08-23 16:36:43 +02:00

80 lines
3.1 KiB
Plaintext

-- This is a base scene that is included in most other scenes to set up defaults
-- loading this scene directly without any other elements added on top of it will
-- probably not work
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
asset.require('scene/solarsystem/sun/sun')
asset.require('scene/solarsystem/sun/glare')
asset.require('scene/solarsystem/planets')
asset.require('scene/solarsystem/planets/mars/moons/phobos')
asset.require('scene/solarsystem/planets/mars/moons/deimos')
asset.require('scene/solarsystem/dwarf_planets/pluto/system')
asset.request('scene/milkyway/milkyway/volume')
assetHelper.requestAll(asset, 'scene/digitaluniverse')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
-- Load web gui
asset.require('util/webgui')
asset.request('customization/volumes')
-- Keybindings that are specific for this scene
local Keybindings = {
{
Key = "b",
Name = "Toggle background",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled'),
Documentation = "Toggle background (Stars and Milkyway).",
GuiPath = "/Rendering",
Local = false
},
{
Key = "g",
Name = "Toggle background/shading",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled') ..
propertyHelper.invert('Scene.EarthAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.MarsAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
propertyHelper.invert('Scene.Moon.Renderable.Enabled') ..
propertyHelper.invert('Scene.Sun.Renderable.Enabled'),
Documentation = "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun",
GuiPath = "/Rendering",
Local = false
},
{
Key = "h",
Name="Toggle Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of all trails",
GuiPath = "/Rendering",
Local = false
},
}
asset.onInitialize(function ()
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${DATA}/globebrowsing_servers.lua")
)
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
end)