mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-28 23:19:35 -06:00
153 lines
5.5 KiB
Plaintext
153 lines
5.5 KiB
Plaintext
asset.require('./base')
|
|
|
|
|
|
local assetHelper = asset.require('util/asset_helper')
|
|
local sceneHelper = asset.require('util/scene_helper')
|
|
local propertyHelper = asset.require('util/property_helper')
|
|
local renderableHelper = asset.require('util/renderable_helper')
|
|
|
|
asset.require('scene/solarsystem/missions/rosetta/67p')
|
|
asset.require('scene/solarsystem/missions/rosetta/rosetta')
|
|
|
|
-- Custom Keybindings
|
|
local Keybindings = {
|
|
{
|
|
Key = "a",
|
|
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P');" ..
|
|
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
|
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
|
Documentation = "Sets the focus of the camera on '67P'.",
|
|
Name = "Focus on 67P",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "s",
|
|
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta');" ..
|
|
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
|
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
|
Documentation = "Sets the focus of the camera on 'Rosetta'",
|
|
Name = "Focus on Rosetta",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "Shift+F6",
|
|
Command = "openspace.time.setTime('2014-08-01T03:05:18.10')",
|
|
Documentation = "Jumps to the time of initial approach of Rosetta to 67P.",
|
|
Name = "Set initial approach time",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "F6",
|
|
Command = "openspace.time.setTime('2014-11-12T08:20:00.00')",
|
|
Documentation = "Jumps to the time when the Philae lander is released.",
|
|
Name = "Set lander release time",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "F8",
|
|
Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)",
|
|
Documentation = "Removes all image projections from 67P.",
|
|
Name = "Clear 67P projections",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
-- {
|
|
-- Key = "q",
|
|
-- Command = propertyHelper.invert('Scene.SunMarker.Renderable.Enabled'),
|
|
-- Documentation = "Toggles the visibility of the text marking the location of the Sun.",
|
|
-- Name = "Toggle Sun marker",
|
|
-- GuiPath = "/Missions/Rosetta",
|
|
-- Local = false
|
|
-- },
|
|
{
|
|
Key = "e",
|
|
Command = renderableHelper.toggle('Scene.JupiterTrail') .. renderableHelper.toggle('Scene.SaturnTrail') ..
|
|
renderableHelper.toggle('Scene.UranusTrail') .. renderableHelper.toggle('Scene.NeptuneTrail'),
|
|
Documentation = "Toggles the visibility of all trails further from the Sun than 67P.",
|
|
Name = "Toggle outer planetary trails",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "i",
|
|
Command = renderableHelper.toggle('Scene.ImagePlaneRosetta'),
|
|
Documentation = "Toggles the visibility of the free floating image plane.",
|
|
Name = "Toggle image plane",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "o",
|
|
Command = renderableHelper.toggle('Scene.PhilaeTrail'),
|
|
Documentation = "Toggles the visibility of Philae's trail.",
|
|
Name = "Toggle Philae trail",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "p",
|
|
Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection'),
|
|
Documentation = "Enables or disables the image projection on 67P.",
|
|
Name = "Toggle 67P projection",
|
|
GuiPath = "/Missions/Rosetta",
|
|
Local = false
|
|
}
|
|
}
|
|
|
|
local Comet67PAsset = asset.require('scene/solarsystem/missions/rosetta/67p')
|
|
|
|
assetHelper.registerDashboardItems(asset, {
|
|
{
|
|
Type = "DashboardItemSpacing",
|
|
Identifier = "RosettaSpacing",
|
|
GuiName = "Rosetta Spacing",
|
|
Spacing = 25
|
|
},
|
|
{
|
|
Type = "DashboardItemDistance",
|
|
Identifier = "Rosetta67PDistance",
|
|
GuiName = "Rosetta 67P Distance",
|
|
SourceType = "Node",
|
|
SourceNodeName = "Rosetta",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "67P"
|
|
},
|
|
{
|
|
Type = "DashboardItemInstruments",
|
|
Identifier = "RosettaInstruments",
|
|
GuiName = "Rosetta Instruments",
|
|
}
|
|
})
|
|
|
|
asset.onInitialize(function ()
|
|
openspace.time.setTime("2014-08-01T03:05:00.000")
|
|
sceneHelper.bindKeys(Keybindings)
|
|
|
|
openspace.markInterestingNodes({ "67P", "Rosetta", "Philae" })
|
|
|
|
sceneHelper.setDeltaTimeKeys({
|
|
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
|
|
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
|
|
})
|
|
|
|
openspace.navigation.setNavigationState({
|
|
Anchor = Comet67PAsset.Comet67P.Identifier,
|
|
ReferenceFrame = "Root",
|
|
Position = { -7.294781E5 , -6.657894E5, 2.509047E6 },
|
|
Up = { 0.146529E0, 0.944727E0, 0.293290E0 }
|
|
})
|
|
|
|
openspace.setPropertyValue('Scene.67P.Renderable.PerformShading', false);
|
|
openspace.setPropertyValue('Scene.ImagePlaneRosetta.Renderable.Enabled', false);
|
|
|
|
end)
|
|
|
|
asset.onDeinitialize(function ()
|
|
sceneHelper.unbindKeys(Keybindings)
|
|
openspace.removeInterestingNodes({ "67P", "Rosetta", "Philae" })
|
|
end)
|