mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-01 08:19:51 -05:00
Add missing base.scene
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
-- 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')
|
||||
|
||||
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/globebrowsing')
|
||||
|
||||
-- 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)
|
||||
Reference in New Issue
Block a user