mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-26 14:09:05 -06:00
Merging in feature gui for touch. Enable touch module to run. Currently only run on development mode with the "touch" scene.
82 lines
3.2 KiB
Plaintext
82 lines
3.2 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
|
|
local webGui = 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 ()
|
|
webGui.setCefRoute("onscreen")
|
|
|
|
sceneHelper.bindKeys(Keybindings)
|
|
openspace.setDefaultGuiSorting()
|
|
|
|
openspace.globebrowsing.loadWMSServersFromFile(
|
|
openspace.absPath("${DATA}/globebrowsing_servers.lua")
|
|
)
|
|
end)
|
|
|
|
asset.onDeinitialize(function ()
|
|
sceneHelper.unbindKeys(Keybindings)
|
|
end)
|