Files
OpenSpace/data/assets/rosetta.scene
Alexander Bock 3a687b5c57 Cleanup of scene files by introducing a new base.scene from which all others derive
Add asset.filePath to the warning when trying to register an empty list
Correctly add HyperionTrail
2019-05-20 11:03:55 -06:00

126 lines
4.2 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.Origin', '67P')",
Documentation = "Sets the focus of the camera on '67P'.",
Local = false
},
{
Key = "s",
Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'Rosetta')",
Documentation = "Sets the focus of the camera on 'Rosetta'",
Local = false
},
{
Key = "F5",
Command = "openspace.time.setTime('2014-08-01T03:05:18.101')",
Documentation = "Jumps to the time of initial approach of Rosetta to 67P.",
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.",
Local = false
},
{
Key = "F8",
Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.clearAllProjections', true)",
Documentation = "Removes all image projections from 67P.",
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 = 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.",
Local = false
},
{
Key = "i",
Command = renderableHelper.toggle('Scene.ImagePlaneRosetta'),
Documentation = "Toggles the visibility of the free floating image plane.",
Local = false
},
{
Key = "f",
Command = renderableHelper.toggle('Scene.PhilaeTrail'),
Documentation = "Toggles the visibility of Philae's trail.",
Local = false
},
{
Key = "p",
Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.performProjection'),
Documentation = "Enables or disables the image projection on 67P.",
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.setCameraState({
Anchor = Comet67PAsset.Comet67P.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
Rotation = { -0.106166, 0.981574, -0.084545, 0.134513 },
})
openspace.setPropertyValue('Scene.67P.Renderable.PerformShading', false);
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeInterestingNodes({ "67P", "Rosetta", "Philae" })
end)