Simplify test scene so it only contains our keybinding as extra

This commit is contained in:
Emma Broman
2020-02-26 11:15:45 -05:00
parent 0db62b740c
commit 607404d996

View File

@@ -1,63 +1,6 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/sun/sun')
asset.require('scene/solarsystem/sun/glare')
asset.require('scene/solarsystem/planets')
asset.request('scene/milkyway/milkyway/volume')
-- Add non planet object
local modelFolder = asset.syncedResource({
Name = "Apollo Models",
Type = "HttpSynchronization",
Identifier = "apollo_11_models",
Version = 1
})
local object = {
Identifier = "ExampleModel",
Transform = {
Translation = {
Type = "StaticTranslation",
Position = {100000000, 1000, 10000}
}
},
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = modelFolder .. "/Apollo_CSM_shrunk_rotated_xy_double_size.obj"
},
ColorTexture = modelFolder .. "/gray.png",
LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
},
GUI = {
Name = "Example Model",
Path = ""
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
assetHelper.requestAll(asset, 'scene/digitaluniverse')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
-- Load web gui
local webGui = asset.require('util/webgui')
asset.request('customization/globebrowsing')
-- Keybindings that are specific for this scene
local Keybindings = {
@@ -76,28 +19,17 @@ local Keybindings = {
Documentation = "Stop a camera path.",
GuiPath = "/Interaction",
Local = false
},
{
Key = "h",
Name="Toggle Planet Trails",
Command = "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of planet trails",
GuiPath = "/Rendering",
Local = false
},
}
}
asset.onInitialize(function ()
webGui.setCefRoute("onscreen")
sceneHelper.bindKeys(Keybindings)
local now = openspace.time.currentWallTime()
-- Jump back one day to be able to show complete weather data on Earth.
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
openspace.globebrowsing.goToGeo("Earth", 58.5877, 16.1924, 20000000)
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
end)
asset.onDeinitialize(function ()