Files
OpenSpace/data/assets/touch.scene
liuloppan 78eb673611 Feature/gui for touch (#967)
Merging in feature gui for touch. Enable touch module to run.
Currently only run on development mode with the "touch" scene.
2019-09-18 23:49:51 +02:00

38 lines
1.2 KiB
Plaintext

local has_touch = openspace.modules.isLoaded('Touch')
if not has_touch then
openspace.printFatal('Could not load scene "' .. asset.filePath .. '" due to missing module "touch"')
do return end
end
asset.require('./base')
local webGui = asset.require('util/webgui')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.onInitialize(function ()
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.markInterestingNodes(
{ "Earth", "Mars", "Moon" }
)
openspace.navigation.setNavigationState({
Anchor = earthAsset.Earth.Identifier,
Position = { 58.5877, 16.1924, 20000000 }
})
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', false)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', false)
webGui.setCefRoute("ontouch")
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes(
{ "Earth", "Mars", "Moon" }
)
end)