diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset index e4902c1725..56cbcf1fad 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset @@ -1,4 +1,4 @@ asset.request('./debris/debris_breezem') -asset.request('./debris/debris_fengyun') -asset.request('./debris/debris_iridium33') -asset.request('./debris/debris_kosmos2251') +--asset.request('./debris/debris_fengyun') +--asset.request('./debris/debris_iridium33') +--asset.request('./debris/debris_kosmos2251') diff --git a/data/assets/spaceDebris.scene b/data/assets/spaceDebris.scene new file mode 100644 index 0000000000..aa0cfec58c --- /dev/null +++ b/data/assets/spaceDebris.scene @@ -0,0 +1,110 @@ +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') +assetHelper.requestAll(asset, 'scene/solarsystem/sun') +asset.require('scene/solarsystem/planets/earth') +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') + +asset.require('util/webgui') + +asset.request('customization/globebrowsing') + +asset.request('scene/solarsystem/planets/earth/satellites/satellites_debris') + +-- Keybindings that are specific for this scene +local Keybindings = { + { + Key = "s", + Command = propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth at Night 2012.Enabled') .. + propertyHelper.invert('Scene.Earth.Renderable.PerformShading') .. + propertyHelper.invert('Scene.Earth.Renderable.Atmosphere') .. + propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled'), + Name = "Night for earth", + Documentation = "Toggle night texture, shading, atmosphere, and water for Earth.", + GuiPath = "/Rendering", + Local = false + }, + { + 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="Hide Trails", + Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)", + Documentation = "Disables visibility of the trails", + GuiPath = "/Rendering", + Local = false + }, +} + +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +assetHelper.registerInterestingNodes(asset, { + "Earth", "Mars", "Moon", "Sun" +}) + +asset.onInitialize(function () + local now = openspace.time.currentWallTime() + -- Jump back one day to show a complete planet + openspace.time.setTime(openspace.time.advancedTime(now, "-1d")) + + 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 scene at the same time", + true, + nil, + nil + ) + + openspace.navigation.setCameraState({ + Anchor = earthAsset.Earth.Identifier, + Position = { 0, 0, 0 }, + Rotation = { 0.758797, 0.221490, -0.605693, -0.091135 }, + }) + + openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000) +end) + +asset.onDeinitialize(function () + sceneHelper.unbindKeys(Keybindings) + + openspace.removeVirtualProperty("*Trail.Renderable.Enabled") +end) diff --git a/openspace.cfg b/openspace.cfg index 58e0446fca..2f8a59042c 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -37,7 +37,8 @@ SGCTConfig = sgct.config.single{} -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace -Asset = "default" +Asset = "spaceDebris" +-- Asset = "default" -- Asset = "default_full" -- Asset = "newhorizons" -- Asset = "rosetta"