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') asset.request('scene/digitaluniverse/stars') asset.request('scene/digitaluniverse/milkyway') asset.require('scene/solarsystem/missions/osirisrex/osirisrex') -- Load default key bindings applicable to most scenes asset.require('util/default_keybindings') -- Custom Keybindings local Keybindings = { { Key = "a", Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'OsirisRex')", Documentation = "Sets the focus of the camera on 'OsirisRex'.", Local = false }, { Key = "s", Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'BennuBarycenter')", Documentation = "Sets the focus of the camera on 'Bennu'", Local = false }, { Key = "F6", Command = "openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');", Documentation = "Sets the time to the launch.", Local = false }, { Key = "F7", Command = "openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');", Documentation = "Sets the time to the Earth gravity assist.", Local = false }, { Key = "F8", Command = "openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');", Documentation = "Sets the time to the approach at Bennu.", Local = false }, { Key = "F9", Command = "openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');", Documentation = "Sets the time to the preliminary survey of Bennu.", Local = false }, { Key = "F10", Command = "openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');", Documentation = "Sets the time to the orbital B event.", Local = false }, { Key = "F11", Command = "openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');", Documentation = "Sets the time to the recon event.", Local = false }, { Key = "q", Command = propertyHelper.invert('Scene.SunMarker.renderable.Enabled'), Documentation = "Toggles the visibility of the text marking the location of the Sun.", Local = false }, { Key = "e", Command = propertyHelper.invert('Scene.EarthMarker.renderable.Enabled'), Documentation = "Toggles the visibility of the text marking the location of the Earth.", Local = false } } local OsirisRexAsset = asset.require('scene/solarsystem/missions/osirisrex/model') asset.onInitialize(function () -- openspace.time.setTime("2019 APR 16 12:03:00.00") openspace.time.setTime("2016 SEP 8 23:00:00.500") sceneHelper.bindKeys(Keybindings) openspace.setDefaultDashboard() openspace.dashboard.addDashboardItem({ Type = "DashboardItemSpacing", Spacing = 25 }) openspace.dashboard.addDashboardItem({ Type = "DashboardItemDistance", SourceType = "Node", SourceNodeName = "OsirisRex", DestinationType = "Node", DestinationNodeName = "BennuBarycenter" }) openspace.dashboard.addDashboardItem({ Type = "DashboardItemInstruments" }) openspace.setDefaultGuiSorting() sceneHelper.setDeltaTimeKeys({ 1, 5, 10, 20, 40, 60, 120, 360, 540, 1080, 2160, 4320, 8640 }) openspace.markInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" }) openspace.addVirtualProperty( "BoolProperty", "Show Trails", "*Trail.renderable.Enabled", "Disable or enable all trails of the scene at the same time", true, nil, nil ) openspace.navigation.setCameraState({ Focus = OsirisRexAsset.OsirisRex.Identifier, Position = { 26974590199.661884, 76314608558.908020, -127086452897.101791 }, Rotation = { 0.729548, -0.126024, 0.416827, 0.527382 }, }) end) asset.onDeinitialize(function () sceneHelper.unbindKeys(Keybindings) openspace.removeVirtualProperty("*Trail.renderable.Enabled") openspace.removeInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" }) end)