Files
OpenSpace/data/assets/newhorizons.scene
T

192 lines
7.4 KiB
Plaintext

local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_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/newhorizons/newhorizons')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
-- Custom Keybindings
local Keybindings = {
{
Key = "a",
Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'NewHorizons')",
Documentation = "Sets the focus of the camera on 'NewHorizons'.",
Local = false
},
{
Key = "s",
Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'Pluto')",
Documentation = "Sets the focus of the camera on 'Pluto'",
Local = false
},
{
Key = "d",
Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'Charon')",
Documentation = "Sets the focus of the camera on 'Charon'.",
Local = false
},
{
Key = "F8",
Command = "openspace.setPropertyValue('Pluto.renderable.ProjectionComponent.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Charon.renderable.ProjectionComponent.ClearAllProjections', true);",
Documentation = "Removes all image projections from Pluto and Charon.",
Local = false
},
{
Key = "F9",
Command = "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
"openspace.setPropertyValue('Pluto.renderable.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Charon.renderable.ClearAllProjections', true);",
Documentation = "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections.",
Local = false
},
{
Key = "KP_8",
Command = sceneHelper.property.increment('Pluto.renderable.HeightExaggeration', 5000000),
Documentation = "Increases the height map exaggeration on Pluto.",
Local = false
},
{
Key = "KP_2",
Command = sceneHelper.property.decrement('Pluto.renderable.HeightExaggeration', 5000000),
Documentation = "Decreases the height map exaggeration on Pluto.",
Local = false
},
{
Key = "KP_9",
Command = sceneHelper.property.increment('Charon.renderable.HeightExaggeration', 5000000),
Documentation = "Increases the height map exaggeration on Charon.",
Local = false
},
{
Key = "KP_3",
Command = sceneHelper.property.decrement('Charon.renderable.HeightExaggeration', 5000000),
Documentation = "Decreases the height map exaggeration on Charon.",
Local = false
},
{
Key = "q",
Command = sceneHelper.property.invert('SunMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Sun.",
Local = false
},
{
Key = "e",
Command = sceneHelper.property.invert('EarthMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Earth.",
Local = false
},
{
Key = "o",
Command = sceneHelper.property.invert('PlutoTrail.renderable.Enabled'),
Documentation = "Toggles the visibility of the trail behind Pluto.",
Local = false
},
{
Key = "j",
Command = sceneHelper.renderable.toggle('PlutoText') .. sceneHelper.renderable.toggle('CharonText') ..
sceneHelper.renderable.toggle('HydraText') .. sceneHelper.renderable.toggle('NixText') ..
sceneHelper.renderable.toggle('KerberosText') .. sceneHelper.renderable.toggle('StyxText'),
Documentation = "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx.",
Local = false
},
{
Key = "l",
Command = sceneHelper.property.invert('Labels.renderable.performFading'),
Documentation = "Toggles the visibility of the labels for the New Horizons instruments.",
Local = false
},
{
Key = "m",
Command = sceneHelper.property.invert('NH_LORRI.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_LEISA.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_PAN1.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_PAN2.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_RED.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_BLUE.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_FT.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_METHANE.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_NIR.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_ALICE_AIRGLOW.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_ALICE_SOC.renderable.SolidDraw'),
Documentation = "Draws the instrument field of views in a solid color or as lines.",
Local = false
},
{
Key = "t",
Command = sceneHelper.renderable.toggle('PlutoShadow') .. sceneHelper.renderable.toggle('CharonShadow'),
Documentation = "Toggles the visibility of the shadow visualization of Pluto and Charon.",
Local = false
}
}
local NewHorizonsAsset = asset.require('scene/solarsystem/missions/newhorizons/model')
asset.onInitialize(function ()
openspace.time.setTime("2015-07-14T08:00:00.00")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultDashboard()
openspace.dashboard.addDashboardItem({
Type = "DashboardItemSpacing",
Spacing = 25
})
openspace.dashboard.addDashboardItem({
Type = "DashboardItemDistance",
SourceType = "Node",
SourceNodeName = "NewHorizons",
DestinationType = "Node Surface",
DestinationNodeName = "Pluto"
})
openspace.dashboard.addDashboardItem({
Type = "DashboardItemInstruments"
})
openspace.setDefaultGuiSorting()
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
2160, 4320, 8640
})
openspace.markInterestingNodes({
"Pluto", "NewHorizons", "Charon"
})
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.FollowFocusNodeRotationDistance', 20.000000);
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 = NewHorizonsAsset.NewHorizons.Name,
Position = { 4662120063743.592773, 1263245003503.724854, -955413856565.788086 },
Rotation = { 0.683224, -0.165934, 0.701234, 0.118073 },
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.renderable.Enabled")
openspace.removeInterestingNodes({
"Pluto", "NewHorizons", "Charon"
})
end)