mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 19:50:03 -06:00
First adjustment due to NCMNS suggestions
- Add Shift+A keybind for New Horizons scene to set the Aim+Anchor method, restoring the A keybind to the previous usage - Various fixes in the New Horizons scene to make it operable - Added optional keybinds CTRL+I, CTRL+K, CTRL+O, and CTRL+L for situations where the keypad is not available - Various fixes for the Rosetta scene - Updated the rosetta images to only download a single zip file that gets extracted - Rebound the Philae trail visibility from F to G so that it is not on the same key as the friction - Disable the Rosetta image plane on default - Added optional F12 keybind to create a screenshot if the PRINT_SCREEN button is not available - Automatically remove old delta time keybindings when new ones are set in order to prevent double-binding
This commit is contained in:
@@ -11,6 +11,16 @@ local renderableHelper = asset.require('util/renderable_helper')
|
||||
local Keybindings = {
|
||||
{
|
||||
Key = "a",
|
||||
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');" ..
|
||||
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
||||
Documentation = "Sets the focus of the camera on 'NewHorizons'.",
|
||||
Name = "Focus on New Horizons",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "SHIFT+a",
|
||||
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');" ..
|
||||
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', 'Pluto');" ..
|
||||
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
|
||||
@@ -42,9 +52,9 @@ local Keybindings = {
|
||||
{
|
||||
Key = "F7",
|
||||
Command =
|
||||
[[local enabled = openspace.getPropertyValue('Scene.Pluto.Renderable.ProjectionComponent.PerformProjection')
|
||||
openspace.setPropertyValue('Scene.Pluto.Renderable.ProjectionComponent.PerformProjection', not enabled)
|
||||
openspace.setPropertyValue('Scene.Charon.Renderable.ProjectionComponent.PerformProjection', not enabled)
|
||||
[[local enabled = openspace.getPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection')
|
||||
openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection', not enabled)
|
||||
openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.PerformProjection', not enabled)
|
||||
openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not enabled)]],
|
||||
Documentation = "Toggles New Horizons image projection.",
|
||||
Name = "Toggle NH Image Projection",
|
||||
@@ -63,8 +73,8 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
{
|
||||
Key = "F9",
|
||||
Command = "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
|
||||
"openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ClearAllProjections', true);" ..
|
||||
"openspace.setPropertyValue('Scene.CharonProjection.Renderable.ClearAllProjections', true);",
|
||||
"openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);" ..
|
||||
"openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true);",
|
||||
Documentation = "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections.",
|
||||
Name = "Reset time and projections",
|
||||
GuiPath = "/New Horizons",
|
||||
@@ -78,6 +88,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "CTRL+I",
|
||||
Command = propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000),
|
||||
Documentation = "Increases the height map exaggeration on Pluto.",
|
||||
Name = "Pluto HeightExaggeration +",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "KP_2",
|
||||
Command = propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000),
|
||||
@@ -86,6 +104,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "CTRL+K",
|
||||
Command = propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000),
|
||||
Documentation = "Decreases the height map exaggeration on Pluto.",
|
||||
Name = "Pluto HeightExaggeration -",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "KP_9",
|
||||
Command = propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000),
|
||||
@@ -94,6 +120,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "CTRL+O",
|
||||
Command = propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000),
|
||||
Documentation = "Increases the height map exaggeration on Charon.",
|
||||
Name = "Charon HeightExaggeration +",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "KP_3",
|
||||
Command = propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000),
|
||||
@@ -102,6 +136,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "CTRL+L",
|
||||
Command = propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000),
|
||||
Documentation = "Decreases the height map exaggeration on Charon.",
|
||||
Name = "Charon HeightExaggeration -",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "o",
|
||||
Command = propertyHelper.invert('Scene.PlutoBarycentricTrail.Renderable.Enabled'),
|
||||
|
||||
@@ -13,13 +13,17 @@ asset.require('scene/solarsystem/missions/rosetta/rosetta')
|
||||
local Keybindings = {
|
||||
{
|
||||
Key = "a",
|
||||
Command = "openspace.setPropertyValue('NavigationHandler.Origin', '67P')",
|
||||
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'.",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "s",
|
||||
Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'Rosetta')",
|
||||
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'",
|
||||
Local = false
|
||||
},
|
||||
@@ -37,7 +41,7 @@ local Keybindings = {
|
||||
},
|
||||
{
|
||||
Key = "F8",
|
||||
Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.clearAllProjections', true)",
|
||||
Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)",
|
||||
Documentation = "Removes all image projections from 67P.",
|
||||
Local = false
|
||||
},
|
||||
@@ -61,14 +65,14 @@ local Keybindings = {
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "f",
|
||||
Key = "g",
|
||||
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'),
|
||||
Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection'),
|
||||
Documentation = "Enables or disables the image projection on 67P.",
|
||||
Local = false
|
||||
}
|
||||
@@ -117,6 +121,8 @@ asset.onInitialize(function ()
|
||||
})
|
||||
|
||||
openspace.setPropertyValue('Scene.67P.Renderable.PerformShading', false);
|
||||
openspace.setPropertyValue('Scene.ImagePlaneRosetta.Renderable.Enabled', false);
|
||||
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
|
||||
@@ -21,9 +21,11 @@ local images = asset.syncedResource({
|
||||
Name = "Rosetta Images",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "rosettaimages",
|
||||
Version = 1
|
||||
Version = 2
|
||||
})
|
||||
|
||||
local imagesDestination = images .. "/images"
|
||||
|
||||
local Barycenter = {
|
||||
Identifier = "67PBarycenter",
|
||||
Parent = transforms.SolarSystemBarycenter.Identifier,
|
||||
@@ -58,7 +60,7 @@ local Comet67P = {
|
||||
},
|
||||
ColorTexture = textures .. "/gray.jpg",
|
||||
Projection = {
|
||||
Sequence = { images },
|
||||
Sequence = { imagesDestination },
|
||||
SequenceType = "image-sequence",
|
||||
Observer = "ROSETTA",
|
||||
Target = "CHURYUMOV-GERASIMENKO",
|
||||
@@ -133,6 +135,13 @@ local Trail67P = {
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
if not openspace.directoryExists(imagesDestination) then
|
||||
openspace.printInfo("Extracting Rosetta images")
|
||||
openspace.unzipFile(images .. "/images_v1_v2.zip", imagesDestination, true)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, {
|
||||
|
||||
@@ -33,6 +33,14 @@ local Keybindings = {
|
||||
GuiPath = "/Rendering",
|
||||
Local = true
|
||||
},
|
||||
{
|
||||
Key = "F12",
|
||||
Name = "Take Screenshot",
|
||||
Command = "openspace.setPropertyValueSingle('RenderEngine.TakeScreenshot', nil)",
|
||||
Documentation = "Saves the contents of the screen to a file in the working directory.",
|
||||
GuiPath = "/Rendering",
|
||||
Local = true
|
||||
},
|
||||
{
|
||||
Key = "SPACE",
|
||||
Name = "Toggle Pause (Interpolated)",
|
||||
@@ -115,7 +123,7 @@ openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]],
|
||||
local DeltaTimeKeys
|
||||
|
||||
asset.onInitialize(function()
|
||||
Keys = sceneHelper.bindKeys(Keybindings)
|
||||
sceneHelper.bindKeys(Keybindings)
|
||||
|
||||
DeltaTimeKeys = sceneHelper.setDeltaTimeKeys({
|
||||
-- 1 2 3 4 5 6 7 8 9 0
|
||||
|
||||
@@ -31,6 +31,8 @@ local unbindKeys = function(keys)
|
||||
end
|
||||
asset.export("unbindKeys", unbindKeys)
|
||||
|
||||
local deltaTimeKeys = {}
|
||||
|
||||
local setDeltaTimeKeys = function(t)
|
||||
local Keys = {
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||
@@ -44,6 +46,8 @@ local setDeltaTimeKeys = function(t)
|
||||
return
|
||||
end
|
||||
|
||||
unbindKeys(deltaTimeKeys)
|
||||
|
||||
result = {}
|
||||
for i, v in ipairs(t) do
|
||||
openspace.bindKeyLocal(
|
||||
@@ -56,6 +60,8 @@ local setDeltaTimeKeys = function(t)
|
||||
table.insert(result, Keys[i])
|
||||
end
|
||||
|
||||
deltaTimeKeys = result
|
||||
|
||||
return result
|
||||
end
|
||||
asset.export("setDeltaTimeKeys", setDeltaTimeKeys)
|
||||
|
||||
Reference in New Issue
Block a user