mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 12:39:49 -06:00
128 lines
5.2 KiB
Plaintext
128 lines
5.2 KiB
Plaintext
--apollo.scene
|
|
asset.require('./base')
|
|
local propertyHelper = asset.require('util/property_helper')
|
|
local sceneHelper = asset.require('util/scene_helper')
|
|
|
|
|
|
asset.require('scene/solarsystem/planets/earth/moon/moon')
|
|
asset.require('scene/solarsystem/missions/apollo/8/apollo8.asset')
|
|
|
|
-- Custom Keybindings
|
|
local Keybindings = {
|
|
{
|
|
Key = "E",
|
|
Command = "openspace.time.setPause(true);" ..
|
|
"openspace.time.setDeltaTime(1);" ..
|
|
"openspace.time.setTime('1968 DEC 24 16:37:31');" ..
|
|
"openspace.navigation.setNavigationState({" ..
|
|
" Anchor = 'Apollo8'," ..
|
|
" Position = { 1.494592E1, 3.236777E1, -4.171296E1 }," ..
|
|
" ReferenceFrame = 'Root'," ..
|
|
" Up = { 0.960608E0, -0.212013E0, 0.179675E0 }" ..
|
|
"});" ..
|
|
"openspace.setPropertyValue('*Trail.Renderable.Enabled', false)",
|
|
Documentation = "Jump to right before the earthrise photo",
|
|
Name = "Set Earthrise time",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "U",
|
|
Command = "openspace.time.setTime('1968-12-21T12:51:37.00')" ..
|
|
"openspace.setPropertyValueSingle('Scene.Apollo8LaunchTrail.Renderable.Enabled', true);",
|
|
Documentation = "Jump to time right before Apollo 8 liftoff, with its trail enabled",
|
|
Name = "Set Apollo 8 launch time",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "K",
|
|
Command = propertyHelper.invert('Scene.Moon.Renderable.Layers.ColorLayers.Kaguya_Utah.Enabled'),
|
|
Documentation = "Toggles Moon Kaguya color layer",
|
|
Name = "Toggle Kaguya layer on the Moon",
|
|
GuiPath = "/Missions/Apollo",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "T",
|
|
Command = propertyHelper.invert('Scene.Apollo8MoonTrail.Renderable.Enabled'),
|
|
Documentation = "Toggles the trails of the Apollo 8 orbits, focused around the Moon",
|
|
Name = "Toggle Apollo 8 orbits",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "SHIFT+T",
|
|
Command = propertyHelper.invert('Scene.Apollo8LaunchTrail.Renderable.Enabled'),
|
|
Documentation = "Toggles the trails of the Apollo 8 Launch, focused around the Earth",
|
|
Name = "Toggle Apollo 8 launch trail",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "CTRL+T",
|
|
Command = propertyHelper.invert('Scene.Apollo8EarthBarycenterTrail.Renderable.Enabled'),
|
|
Documentation = "Toggles the trails of the full Apollo 8, with Earth's frame of reference",
|
|
Name = "Toggles Apollo 8 full trail",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "S",
|
|
Command = propertyHelper.invert('Scene.Moon.Renderable.PerformShading'),
|
|
Documentation = "Toggles shading for the Moon",
|
|
Name = "Toggle Moon shading",
|
|
GuiPath = "/Missions/Apollo",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "PAGE_UP",
|
|
Command = "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo8')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
|
Documentation = "Set camera focus to Apollo 8",
|
|
Name = "Focus on Apollo 8",
|
|
GuiPath = "/Missions/Apollo/8",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "PAGE_DOWN",
|
|
Command = "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Moon')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
|
Documentation = "Set camera focus to the Moon",
|
|
Name = "Focus on Moon",
|
|
GuiPath = "/Missions/Apollo",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "HOME",
|
|
Command = "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth')" ..
|
|
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
|
Documentation = "Set camera focus to the Earth",
|
|
Name = "Focus on Earth",
|
|
GuiPath = "/Missions/Apollo",
|
|
Local = false
|
|
}
|
|
}
|
|
|
|
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
|
|
asset.onInitialize(function ()
|
|
sceneHelper.bindKeys(Keybindings)
|
|
|
|
openspace.time.setTime("1968-12-21T12:51:51.0")
|
|
-- Earthrise:
|
|
-- openspace.time.setTime("1968-12-24T16:37:19.0")
|
|
|
|
openspace.markInterestingNodes({ "Earth", "Moon", "Apollo8", "Apollo8Launch" })
|
|
|
|
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.MinimumAllowedDistance', 0.000000);
|
|
|
|
openspace.globebrowsing.goToGeo(earthAsset.Earth.Identifier, 20, -60, 15000000)
|
|
end)
|
|
|
|
asset.onDeinitialize(function ()
|
|
openspace.removeInterestingNodes({ "Earth", "Moon", "Apollo8" })
|
|
end)
|