mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 20:49:00 -06:00
Merging in feature gui for touch. Enable touch module to run. Currently only run on development mode with the "touch" scene.
38 lines
1.2 KiB
Plaintext
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)
|