Merge branch 'master' into issue/733

This commit is contained in:
Emma Broman
2020-07-08 15:33:39 +02:00
committed by GitHub
155 changed files with 3456 additions and 2102 deletions

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@
.vscode
CMakeCache.txt
CMakeFiles
CMakeLists.txt.user
cmake-build-*
cmake_install.cmake
install_manifest.txt

View File

@@ -353,7 +353,6 @@ void mainInitFunc(GLFWwindow*) {
//
// Screenshots
//
std::string screenshotPath = "${SCREENSHOTS}";
if (global::configuration.shouldUseScreenshotDate) {
std::time_t now = std::time(nullptr);
@@ -520,7 +519,7 @@ void mainPostSyncPreDrawFunc() {
void mainRenderFunc(const RenderData& data) {
void mainRenderFunc(const sgct::RenderData& data) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
@@ -595,7 +594,7 @@ void mainRenderFunc(const RenderData& data) {
void mainDraw2DFunc(const RenderData& data) {
void mainDraw2DFunc(const sgct::RenderData& data) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
@@ -1304,9 +1303,9 @@ int main(int argc, char** argv) {
ghoul::deinitialize();
}
catch (...) {
Engine::destroy();
global::openSpaceEngine.deinitialize();
ghoul::deinitialize();
Engine::destroy();
throw;
}

View File

@@ -1,127 +0,0 @@
--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)

View File

@@ -1,113 +0,0 @@
asset.require('./base')
local sceneHelper = asset.require('util/scene_helper')
-- local station2 = asset.require('scene/solarsystem/missions/apollo/17/bouldersstation2')
-- local station6 = asset.require('scene/solarsystem/missions/apollo/17/bouldersstation6')
-- local station7 = asset.require('scene/solarsystem/missions/apollo/17/bouldersstation7')
asset.require('scene/solarsystem/missions/apollo/8/apollo8')
asset.require('scene/solarsystem/missions/apollo/11/apollo11')
asset.require('scene/solarsystem/missions/apollo/17/lem')
asset.require('scene/solarsystem/missions/apollo/apollo_globebrowsing')
asset.require('scene/solarsystem/missions/apollo/11/lem_flipbook')
asset.require('scene/solarsystem/missions/apollo/insignias_map')
local Keybindings = {
{
Key = "m",
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Moon'); " ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
Documentation = "Focus on Moon",
Name = "Focus on Moon",
GuiPath = "/Missions/Apollo",
Local = false
},
{
Key = "F9",
Command = "openspace.setPropertyValue('Scene.Moon.Renderable.Layers.ColorLayers.A17_*.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', false);"..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', false);",
Documentation = "Disable apollo site on moon when switching",
Name = "Disable Apollo site",
GuiPath = "/Missions/Apollo",
Local = false
},
{
Key = "F11",
Command = "openspace.time.setTime('1969 JUL 20 20:17:40');" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.LodScaleFactor', 20.11);" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo11LemPosition');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);" ..
"openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', true);",
Documentation = "Setup for A11 site",
Name = "Setup A11 site",
GuiPath = "/Missions/Apollo/11",
Local = false
},
{
Key = "F7",
Command = "openspace.time.setTime('1972 DEC 12 19:47:11');" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode', 0.000000);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', true);" ..
-- "openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station6a.Enabled', true);" ..
-- "openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station6a.BlendMode', 0.000000);" ..
-- "openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station2.Enabled', true);" ..
-- "openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station2.BlendMode', 0.000000);" ..
-- "openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station7.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.BlendMode', 0.000000);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.BlendMode', 0.000000);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.LodScaleFactor', 20.17);" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo17LemModel');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);" ..
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station7.BlendMode', 0.000000);",
Documentation = "Setup for A17 site",
Name = "Setup A17 site",
GuiPath = "/Missions/Apollo/17",
Local = false
}
}
local moonAsset = asset.require('scene/solarsystem/planets/earth/moon/moon')
asset.onInitialize(function ()
openspace.time.setTime("1972 DEC 12 19:47:11")
sceneHelper.bindKeys(Keybindings)
openspace.markInterestingNodes({
"Moon", "Apollo11LemModel", "Apollo17LemModel",
"Apollo11", "Apollo11LunarLander",
-- "Station_2_Boulder2", "Station_6_Fragment1"
})
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode', 0);
-- To enable both sites by default, uncomment these lines
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.BlendMode', 0.000000);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.BlendMode', 0.000000);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station7.BlendMode', 0.000000);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', true);
openspace.globebrowsing.goToGeo(moonAsset.Moon.Identifier, 20, -60, 15000000)
openspace.setPropertyValueSingle("Scene.Moon.Renderable.PerformShading", false)
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({
"Moon", "Apollo11Lem", "Apollo17Lem",
"Apollo11", "Apollo11LemPosition",
-- "Station_6_Fragment1", "Station_6_Fragments_2_3"
})
end)

View File

@@ -1,36 +0,0 @@
asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/sssb/amor_asteroid')
asset.require('scene/solarsystem/sssb/apollo_asteroid')
asset.require('scene/solarsystem/sssb/aten_asteroid')
asset.require('scene/solarsystem/sssb/atira_asteroid')
asset.require('scene/solarsystem/sssb/centaur_asteroid')
asset.require('scene/solarsystem/sssb/chiron-type_comet')
asset.require('scene/solarsystem/sssb/encke-type_comet')
asset.require('scene/solarsystem/sssb/halley-type_comet')
asset.require('scene/solarsystem/sssb/inner_main_belt_asteroid')
asset.require('scene/solarsystem/sssb/jupiter_trojan_asteroid')
asset.require('scene/solarsystem/sssb/jupiter-family_comet')
asset.require('scene/solarsystem/sssb/main_belt_asteroid')
asset.require('scene/solarsystem/sssb/mars-crossing_asteroid')
asset.require('scene/solarsystem/sssb/outer_main_belt_asteroid')
asset.require('scene/solarsystem/sssb/transneptunian_object_asteroid')
asset.require('scene/solarsystem/sssb/pha')
asset.require('scene/solarsystem/sssb/c2019y4atlas')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
-- Jump back one day to be able to show complete weather data on Earth.
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
openspace.globebrowsing.goToGeo("Earth", 58.5877, 16.1924, 2.7e12)
openspace.markInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
openspace.setPropertyValue('Scene.C2019Y4AtlasTrail.Renderable.Enabled', false)
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
end)

View File

@@ -1,25 +0,0 @@
-- This is a base scene that is included in most other scenes to set up defaults
-- loading this scene directly without any other elements added on top of it will
-- probably not work
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
-- Load web gui
local webGui = asset.require('util/webgui')
asset.onInitialize(function ()
webGui.setCefRoute("onscreen")
openspace.setDefaultGuiSorting()
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${DATA}/globebrowsing_servers.lua")
)
end)

View File

@@ -1,18 +0,0 @@
#Version
1.0
#Asset
scene/solarsystem/missions/dawn/ceres required
scene/solarsystem/missions/dawn/dawn required
scene/solarsystem/missions/dawn/vesta required
#Time
absolute 2011 AUG 06 00:00:00
#Camera
setNavigationState "Dawn" 526781518487.171326, 257168309890.072144, -1381125204152.817383
#MarkNodes
Dawn
Ceres
Vesta

View File

@@ -1,21 +0,0 @@
asset.require('./base')
asset.require('scene/solarsystem/missions/dawn/ceres')
asset.require('scene/solarsystem/missions/dawn/dawn')
asset.require('scene/solarsystem/missions/dawn/vesta')
local DawnAsset = asset.require('scene/solarsystem/missions/dawn/dawn')
asset.onInitialize(function ()
openspace.time.setTime("2011 AUG 06 00:00:00")
openspace.markInterestingNodes({ "Dawn", "Ceres", "Vesta" })
openspace.navigation.setNavigationState({
Anchor = DawnAsset.Dawn.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Dawn", "Ceres", "Vesta" })
end)

View File

@@ -1,21 +0,0 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/earth required
scene/solarsystem/planets/earth/satellites/satellites required
#Property
setPropertyValue {earth_satellites}.Renderable.Enabled false
#Time
relative -1d
#Camera
goToGeo "Earth" 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -1,29 +0,0 @@
asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
-- Jump back one day to be able to show complete weather data on Earth.
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
openspace.globebrowsing.goToGeo("Earth", 58.5877, 16.1924, 20000000)
openspace.markInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
openspace.setPropertyValue("{earth_satellites}.Renderable.Enabled", false)
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
end)
asset.meta = {
Name = "Default scene",
Version = "1.0",
Description = [[ Bla bla, something something asteroids ]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -1,23 +0,0 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/earth required
scene/solarsystem/planets/jupiter/minor_moons required
scene/solarsystem/planets/saturn/minor_moons required
scene/solarsystem/planets/uranus/minor_moons required
scene/solarsystem/planets/neptune/inner_moons required
scene/solarsystem/planets/neptune/irregular_prograde_moons required
scene/solarsystem/planets/neptune/irregular_retrograde_moons required
#Time
relative -1d
#Camera
goToGeo "Earth" 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -1,7 +0,0 @@
asset.require('./default')
asset.require('scene/solarsystem/planets/jupiter/minor_moons')
asset.require('scene/solarsystem/planets/saturn/minor_moons')
asset.require('scene/solarsystem/planets/uranus/minor_moons')
asset.require('scene/solarsystem/planets/neptune/inner_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_prograde_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_retrograde_moons')

View File

@@ -1,22 +0,0 @@
#Version
1.0
#Module
Gaia openspace.printFatal('Could not load scene due to missing module "gaia"')
#Asset
scene/solarsystem/planets/earth/earth required
scene/milkyway/gaia/gaiastars required
scene/milkyway/gaia/apogee required
scene/milkyway/gaia/galah required
scene/solarsystem/missions/gaia/gaia required
scene/solarsystem/missions/gaia/trail required
#Property
setPropertyValueSingle Scene.Stars.Renderable.Enabled false
#Camera
setNavigationState "Earth" 1000000000000.0, 1000000000000.0, 1000000000000.0
#MarkNodes
Gaia

View File

@@ -1,46 +0,0 @@
local has_gaia = openspace.modules.isLoaded('Gaia')
if not has_gaia then
openspace.printFatal('Could not load scene "' .. asset.filePath .. '" due to missing module "gaia"')
do return end
end
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
-- Augment default scene with gaia data, 3D model and trail
asset.require('scene/milkyway/gaia/gaiastars')
asset.require('scene/milkyway/gaia/apogee')
asset.require('scene/milkyway/gaia/galah')
asset.require('scene/solarsystem/missions/gaia/gaia')
asset.require('scene/solarsystem/missions/gaia/trail')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "GaiaEarthDistance",
GuiName = "Gaia Earth Distance",
SourceType = "Node",
SourceNodeName = "Gaia",
DestinationType = "Node Surface",
DestinationNodeName = "Earth"
}
})
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.onInitialize(function ()
openspace.setPropertyValueSingle('Scene.Stars.Renderable.Enabled', false);
openspace.markInterestingNodes({ "Gaia" })
openspace.navigation.setNavigationState({
Anchor = earthAsset.Earth.Identifier,
Position = { 1000000000000.0, 1000000000000.0, 1000000000000.0 },
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Gaia" })
end)

View File

@@ -1,87 +0,0 @@
asset.require('./base')
local sceneHelper = asset.require('util/scene_helper')
-- Keybindings that are specific for this scene
local Keybindings = {
{
Key = "i",
Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);" ..
-- "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 3.098590);" ..
-- "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 3.568080);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.816900);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);",
Documentation = "Setup Insight landing layers",
Name = "Setup Insight layers",
GuiPath = "/Missions/Insight",
Local = false
},
{
Key = "SHIFT+i",
Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);",
-- "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 1.0);" ..
-- "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);";
Documentation = "Undo Insight landing layers setup",
Name = "Unset Insight layers",
GuiPath = "/Missions/Insight",
Local = false
}
}
local insightAsset = asset.require('scene/solarsystem/missions/insight/edl')
asset.onInitialize(function ()
openspace.time.setTime("2018 NOV 26 19:39:03.68")
sceneHelper.bindKeys(Keybindings)
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 3.098590);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 3.568080);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.81690);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);
openspace.markInterestingNodes({ "Insight" })
openspace.navigation.setNavigationState({
Anchor = insightAsset.Insight.Identifier,
Position = { 8.430115E0, -1.791710E1, 2.813660E0 },
ReferenceFrame = "Root",
Up = { 0.494659E0,0.357162E0,0.792306E0 },
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 1.0);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);
openspace.removeInterestingNodes({ "Insight" })
end)

View File

@@ -1,31 +0,0 @@
asset.request('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
assetHelper.requireAll(asset, 'scene/solarsystem/missions/juno')
local junoAsset = asset.require('scene/solarsystem/missions/juno/juno')
asset.onInitialize(function ()
openspace.time.setTime("2016-07-01T10:05:00.00")
openspace.markInterestingNodes({ "Jupiter", "Juno" })
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 = junoAsset.Juno.Identifier,
Position = { 1.243398E8, 7.176068E7, -1.519733E7 },
ReferenceFrame = "Root",
Up = { -0.377400E0, 0.764573E0, 0.522492E0 },
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Jupiter", "Juno" })
end)

View File

@@ -1,61 +0,0 @@
asset.require('./base')
local sceneHelper = asset.require('util/scene_helper')
local perseveranceAsset = asset.require('scene/solarsystem/missions/perseverance/perseverance')
local perseveranceShortcuts = asset.require('scene/solarsystem/missions/perseverance/shortcuts')
local insightAsset = asset.require('scene/solarsystem/missions/insight/edl')
local insightShortcuts = asset.require('scene/solarsystem/missions/insight/shortcuts')
local insightEDLShortcuts = sceneHelper.extractShortcuts({"Insight Height Offset",
"Enable HiRISE",
"Insight EDL Time",
"Insight EDL NavigationState"},
insightShortcuts.Shortcuts)
local insightDisableShortcuts = sceneHelper.extractShortcuts({
"Default Height Offset",
"Disable HiRISE"},
insightShortcuts.Shortcuts)
local PerseverenceLandedShortcuts = sceneHelper.extractShortcuts({
"Perseverance Height Offset",
"Perseverance landed time",
"Enable HiRISE"},
perseveranceShortcuts.Shortcuts)
local Keybindings = {
sceneHelper.createKeyBindFromShortcuts("i",
insightEDLShortcuts,
"/Missions/Insight",
"Set and goto Insight Landing",
"Setup scene for insight EDL"
),
sceneHelper.createKeyBindFromShortcuts("SHIFT+i",
insightDisableShortcuts,
"/Missions/Insight",
"Unset Insight Landing",
"Disable Mars layer settings used for insight EDL"
),
sceneHelper.createKeyBindFromShortcuts("p",
PerseverenceLandedShortcuts,
"/Missions/Perseverance"
)
}
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
openspace.time.setTime(now)
sceneHelper.bindKeys(Keybindings)
openspace.globebrowsing.goToGeo("Mars", 58.5877, 16.1924, 8000000)
openspace.markInterestingNodes({ "Mars", insightAsset.Insight.Identifier, "Perseverance" })
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeInterestingNodes({ "Mars", insightAsset.Insight.Identifier})
end)

View File

@@ -1,46 +0,0 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local MessengerAsset = asset.require('scene/solarsystem/missions/messenger/messengerSC')
if not openspace.modules.isLoaded("Volume") then
openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
else
asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere')
end
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "MessengerDistance",
GuiName = "Messenger - Mercury Distance",
SourceType = "Node",
SourceNodeName = "Messenger",
DestinationType = "Node",
DestinationNodeName = "Mercury"
}
})
asset.onInitialize(function ()
openspace.time.setTime("2011 MAY 13 00:05:18")
openspace.markInterestingNodes({ "Mercury", "Messenger", "Sun" })
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 = "Mercury",
Position = { 2.423690E11, 1.979038E11, -2.241483E10 },
ReferenceFrame = "Root",
Up = { -0.492046E0, 0.666088E0, 0.560551E0 }
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Mercury", "Messenger", "Sun" })
end)

View File

@@ -1,274 +0,0 @@
asset.require('./base');
asset.require('scene/solarsystem/missions/newhorizons/newhorizons')
local NewHorizonsAsset = asset.require('scene/solarsystem/missions/newhorizons/model')
local assetHelper = asset.require('util/asset_helper')
local propertyHelper = asset.require('util/property_helper')
local sceneHelper = asset.require('util/scene_helper')
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)",
Documentation = "Sets the focus of the camera on 'NewHorizons'.",
Name = "Anchor at New Horizons, Aim at Pluto",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "s",
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Pluto');"..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
Documentation = "Sets the focus of the camera on 'Pluto'",
Name = "Focus on Pluto",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "d",
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Charon');"..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
Documentation = "Sets the focus of the camera on 'Charon'.",
Name = "Focus on New Charon",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "F7",
Command =
[[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",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "F8",
Command = "openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true);",
Documentation = "Removes all image projections from Pluto and Charon.",
Name = "Clear image projections",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "F9",
Command = "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
"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",
Local = false
},
{
Key = "KP_8",
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 = "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),
Documentation = "Decreases the height map exaggeration on Pluto.",
Name = "Pluto HeightExaggeration -",
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),
Documentation = "Increases the height map exaggeration on Charon.",
Name = "Charon HeightExaggeration +",
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),
Documentation = "Decreases the height map exaggeration on Charon.",
Name = "Charon HeightExaggeration -",
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'),
Documentation = "Toggles the visibility of the trail behind Pluto.",
Name = "Toggle Pluto Trail",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "j",
Command = renderableHelper.toggle('Scene.PlutoText') .. renderableHelper.toggle('Scene.CharonText') ..
renderableHelper.toggle('Scene.HydraText') .. renderableHelper.toggle('Scene.NixText') ..
renderableHelper.toggle('Scene.KerberosText') .. renderableHelper.toggle('Scene.StyxText'),
Documentation = "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx.",
Name = "Toggle Pluto Labels",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "l",
Command = propertyHelper.fadeInOut('Scene.Labels.Renderable.Opacity', 2.0),
Documentation = "Toggles the visibility of the labels for the New Horizons instruments.",
Name = "Toggle New Horizons Labels",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "m",
Command = propertyHelper.invert('Scene.NH_LORRI.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_LEISA.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN1.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN2.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_RED.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_BLUE.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_FT.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_METHANE.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_RALPH_MVIC_NIR.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_ALICE_AIRGLOW.Renderable.SolidDraw') ..
propertyHelper.invert('Scene.NH_ALICE_SOC.Renderable.SolidDraw'),
Documentation = "Draws the instrument field of views in a solid color or as lines.",
Name = "Toggle instrument FOVs",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "Shift+t",
Command = renderableHelper.toggle('Scene.PlutoShadow') .. renderableHelper.toggle('Scene.CharonShadow'),
Documentation = "Toggles the visibility of the shadow visualization of Pluto and Charon.",
Name = "Toggle Shadows",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "t",
Command = renderableHelper.toggle('Scene.NewHorizonsTrailPluto'),
Documentation = "Toggles the trail of New Horizons.",
Name = "Toggle NH Trail",
GuiPath = "/New Horizons",
Local = false
},
{
Key = "h",
Name="Hide Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "NewHorizonsSpacing",
GuiName = "New Horizons Spacing",
Spacing = 25
},
{
Type = "DashboardItemDistance",
Identifier = "NewHorizonsPlutoDistance",
GuiName = "New Horizons Pluto Distance",
SourceType = "Node",
SourceNodeName = "NewHorizons",
DestinationType = "Node Surface",
DestinationNodeName = "PlutoProjection"
},
{
Type = "DashboardItemInstruments",
Identifier = "NewHorizonsInstruments",
GuiName = "NewHorizons Instruments",
}
})
asset.onInitialize(function ()
openspace.time.setTime("2015-07-14T08:00:00.00")
sceneHelper.bindKeys(Keybindings)
openspace.markInterestingNodes({ "Pluto", "NewHorizons", "Charon" })
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
2160, 4320, 8640
})
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance', 20.000000);
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', false)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
openspace.setPropertyValueSingle("Scene.PlutoBarycenterTrail.Renderable.Enabled", false)
openspace.navigation.setNavigationState({
Anchor = "NewHorizons",
ReferenceFrame = "Root",
Position = { -6.572656E1, -7.239404E1, -2.111890E1 },
Up = { 0.102164, -0.362945, 0.926193 }
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeInterestingNodes({ "Pluto", "NewHorizons", "Charon" })
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', true)
end)

View File

@@ -1,147 +0,0 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
asset.require('scene/solarsystem/missions/osirisrex/osirisrex')
-- Custom Keybindings
local Keybindings = {
{
Key = "a",
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex')" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
Documentation = "Sets the focus of the camera on 'OsirisRex'.",
Name = "Focus on OsirisRex",
GuiPath = "/Missions/Osiris Rex",
Local = false
},
{
Key = "s",
Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'BennuBarycenter')" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" ..
"openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)",
Documentation = "Sets the focus of the camera on 'Bennu'",
Name = "Focus on Bennu",
GuiPath = "/Missions/Osiris Rex",
Local = false
},
-- TODO
-- Maybe these can be fixed later
-- {
-- Key = "F6",
-- Command = "openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');",
-- Documentation = "Sets the time to the launch of Osiris Rex.",
-- Name = "Set launch time",
-- GuiPath = "/Missions/Osiris Rex",
-- Local = false
-- },
-- {
-- Key = "F7",
-- Command = "openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');",
-- Documentation = "Sets the time to the Earth gravity assist.",
-- Name = "Set Earth gravity assist time",
-- GuiPath = "/Missions/Osiris Rex",
-- Local = false
-- },
{
Key = "F8",
Command = "openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');",
Documentation = "Sets the time to the approach at Bennu.",
Name = "Set Bennu approach time",
GuiPath = "/Missions/Osiris Rex",
Local = false
},
{
Key = "F9",
Command = "openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');",
Documentation = "Sets the time to the preliminary survey of Bennu.",
Name = "Set Bennu survey time",
GuiPath = "/Missions/Osiris Rex",
Local = false
},
{
Key = "F10",
Command = "openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');",
Documentation = "Sets the time to the orbital B event.",
Name = "Set orbital B event time",
GuiPath = "/Missions/Osiris Rex",
Local = false
},
{
Key = "F11",
Command = "openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');",
Documentation = "Sets the time to the recon event.",
Name = "Set recon event time",
GuiPath = "/Missions/Osiris Rex",
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/Osiris Rex",
Local = false
},
-- {
-- Key = "e",
-- Command = propertyHelper.invert('Scene.EarthMarker.Renderable.Enabled'),
-- Documentation = "Toggles the visibility of the text marking the location of the Earth.",
-- Name = "Toggle Earth marker",
-- GuiPath = "/Missions/Osiris Rex",
-- Local = false
-- }
}
local OsirisRexAsset = asset.require('scene/solarsystem/missions/osirisrex/model')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "OsirisRexSpacing",
GuiName = "OSIRIS-REx Spacing",
Spacing = 25
},
{
Type = "DashboardItemDistance",
Identifier = "OsirisRexBennuDistance",
GuiName = "OSIRIS-REx Bennu Distance",
SourceType = "Node",
SourceNodeName = "OsirisRex",
DestinationType = "Node",
DestinationNodeName = "BennuBarycenter"
},
{
Type = "DashboardItemInstruments",
Identifier = "OsirisRexInstruments",
GuiName = "OSIRIS-REx Instruments",
}
})
asset.onInitialize(function ()
openspace.time.setTime("2018 10 30 23:00:00.500")
sceneHelper.bindKeys(Keybindings)
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
2160, 4320, 8640
})
openspace.markInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" })
openspace.navigation.setNavigationState({
Anchor = OsirisRexAsset.OsirisRex.Identifier,
Position = { 26974590199.661884, 76314608558.908020, -127086452897.101791 }
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" })
end)

View File

@@ -1,152 +0,0 @@
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)

View File

@@ -1,3 +1,7 @@
<<<<<<< HEAD
local constellationsCSV = asset.localResource('constellation_data.csv')
=======
>>>>>>> master
local transforms = asset.require("scene/solarsystem/sun/transforms")
local images = asset.syncedResource({
@@ -80,8 +84,11 @@ end
local nodes = {}
asset.onInitialize(function ()
<<<<<<< HEAD
=======
local constellationsCSV = images .. "/constellation_data.csv"
>>>>>>> master
nodes = createConstellations('Constellation Art', constellationsCSV)
for _, n in ipairs(nodes) do
openspace.addSceneGraphNode(n);

View File

@@ -22,7 +22,8 @@ local LaunchTrail = {
Color = { 0.70, 0.50, 0.20 },
StartTime = "1968 DEC 21 12:51:00",
EndTime = "1968 DEC 21 23:23:22",
SampleInterval = 30
SampleInterval = 30,
RenderBinMode = "PostDeferredTransparent"
},
GUI = {
Name = "Apollo 8 Launch Trail",

View File

@@ -0,0 +1,12 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "GaiaEarthDistance",
GuiName = "Gaia Earth Distance",
SourceType = "Node",
SourceNodeName = "Gaia",
DestinationType = "Node Surface",
DestinationNodeName = "Earth"
}
})

View File

@@ -0,0 +1,13 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "MessengerDistance",
GuiName = "Messenger - Mercury Distance",
SourceType = "Node",
SourceNodeName = "Messenger",
DestinationType = "Node",
DestinationNodeName = "Mercury"
}
})

View File

@@ -0,0 +1,24 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "NewHorizonsSpacing",
GuiName = "New Horizons Spacing",
Spacing = 25
},
{
Type = "DashboardItemDistance",
Identifier = "NewHorizonsPlutoDistance",
GuiName = "New Horizons Pluto Distance",
SourceType = "Node",
SourceNodeName = "NewHorizons",
DestinationType = "Node Surface",
DestinationNodeName = "PlutoProjection"
},
{
Type = "DashboardItemInstruments",
Identifier = "NewHorizonsInstruments",
GuiName = "NewHorizons Instruments",
}
})

View File

@@ -0,0 +1,24 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "OsirisRexSpacing",
GuiName = "OSIRIS-REx Spacing",
Spacing = 25
},
{
Type = "DashboardItemDistance",
Identifier = "OsirisRexBennuDistance",
GuiName = "OSIRIS-REx Bennu Distance",
SourceType = "Node",
SourceNodeName = "OsirisRex",
DestinationType = "Node",
DestinationNodeName = "BennuBarycenter"
},
{
Type = "DashboardItemInstruments",
Identifier = "OsirisRexInstruments",
GuiName = "OSIRIS-REx Instruments",
}
})

View File

@@ -0,0 +1,24 @@
local assetHelper = asset.require('util/asset_helper')
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",
}
})

View File

@@ -0,0 +1,22 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "Voyager1Distance",
GuiName = "Voyager 1 - Earth Distance",
SourceType = "Node",
SourceNodeName = "Voyager_1",
DestinationType = "Node",
DestinationNodeName = "Earth"
},
{
Type = "DashboardItemDistance",
Identifier = "Voyager2Distance",
GuiName = "Voyager 2 - Earth Distance",
SourceType = "Node",
SourceNodeName = "Voyager_2",
DestinationType = "Node",
DestinationNodeName = "Earth"
}
})

View File

@@ -91,7 +91,8 @@ local initializeAndAddNodes = function()
Body = identifier,
Observer = transforms.EarthInertial.Identifier,
File = path,
LineNumber = 1
LineNumber = 1,
RenderBinMode = "PostDeferredTransparent"
},
Color = { 0.9, 0.6715, 0.0 },
Fade = 1.5,

View File

@@ -16,7 +16,7 @@ local SunGlare = {
Texture = textures .. "/halo.png",
BlendMode = "Additive",
Opacity = 0.65,
RenderableType = "Transparency"
RenderableType = "PreDeferredTransparency"
},
Transform = {
Translation = {

View File

@@ -1,37 +0,0 @@
local has_touch = openspace.modules.isLoaded('Touch')
if not has_touch then
openspace.printFatal('Could not load scene "' .. asset.filePath .. '" due to missing module "touch"')
do return end
end
asset.require('./base')
local webGui = asset.require('util/webgui')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
-- Jump back one day to be able to show complete weather data on Earth.
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
openspace.markInterestingNodes(
{ "Earth", "Mars", "Moon" }
)
openspace.navigation.setNavigationState({
Anchor = earthAsset.Earth.Identifier,
Position = { 58.5877, 16.1924, 20000000 }
})
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', false)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', false)
webGui.setCefRoute("ontouch")
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes(
{ "Earth", "Mars", "Moon" }
)
end)

View File

@@ -9,7 +9,6 @@ local bindKeys = function(t, ignoreWarning)
local currentKey = openspace.getKeyBinding(k.Key)
if (next(currentKey) ~= nil) and (not ignoreWarning) then
openspace.printWarning('New keybind for "' .. k.Key .. '" is added, but a previous keybind already existed. If you want to silence this warning, pass "true", to this call to bindKeys')
end

View File

@@ -84,7 +84,8 @@ function satellites(title, file, color, group)
Path = file,
SegmentQuality = 3,
Color = color,
Fade = 1.5
Fade = 1.5,
RenderBinMode = "PostDeferredTransparent"
},
Tag = { "earth_satellites" },
GUI = {

View File

@@ -1,61 +0,0 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
asset.require('scene/solarsystem/planets/jupiter/minor_moons')
asset.require('scene/solarsystem/planets/saturn/minor_moons')
asset.require('scene/solarsystem/planets/uranus/minor_moons')
asset.require('scene/solarsystem/planets/neptune/inner_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_prograde_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_retrograde_moons')
asset.require('scene/solarsystem/missions/voyager/voyager1')
asset.require('scene/solarsystem/missions/voyager/voyager2')
local VoyagerAsset = asset.require('scene/solarsystem/missions/voyager/voyager1')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
Identifier = "Voyager1Distance",
GuiName = "Voyager 1 - Earth Distance",
SourceType = "Node",
SourceNodeName = "Voyager_1",
DestinationType = "Node",
DestinationNodeName = "Earth"
},
{
Type = "DashboardItemDistance",
Identifier = "Voyager2Distance",
GuiName = "Voyager 2 - Earth Distance",
SourceType = "Node",
SourceNodeName = "Voyager_2",
DestinationType = "Node",
DestinationNodeName = "Earth"
}
})
asset.onInitialize(function ()
openspace.time.setTime("1977 SEP 10 12:00:00")
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.markInterestingNodes({
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})
openspace.navigation.setNavigationState({
Anchor = VoyagerAsset.Voyager_1.Identifier,
ReferenceFrame = "Root",
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 }
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})
end)

View File

@@ -2,13 +2,14 @@
1.0
#Asset
scene/solarsystem/planets/earth/moon/moon required
scene/solarsystem/missions/apollo/8/apollo8 required
scene/solarsystem/planets/earth/earth required
util/property_helper propertyHelper
base
scene/solarsystem/planets/earth/moon/moon
scene/solarsystem/missions/apollo/8/apollo8
scene/solarsystem/planets/earth/earth earthAsset
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.MinimumAllowedDistance 0.000000
setPropertyValueSingle Scene.Moon.Renderable.LodScaleFactor 24.0
#Keybinding
E Jump to right before the earthrise photo Set Earthrise time /Missions/Apollo/8 false "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)"
@@ -26,7 +27,7 @@ HOME Set camera focus to the Earth Focus on Earth /Missions/Apollo false "opensp
absolute 1968-12-21T12:51:51.0
#Camera
goToGeo "Earth" 20 -60 15000000
goToGeo earthAsset.Earth.Identifier 20 -60 15000000
#MarkNodes
Earth

View File

@@ -2,13 +2,14 @@
1.0
#Asset
scene/solarsystem/planets/earth/moon/moon required
scene/solarsystem/missions/apollo/8/apollo8 required
scene/solarsystem/missions/apollo/11/apollo11 required
scene/solarsystem/missions/apollo/17/lem required
scene/solarsystem/missions/apollo/apollo_globebrowsing required
scene/solarsystem/missions/apollo/11/lem_flipbook required
scene/solarsystem/missions/apollo/insignias_map required
base
scene/solarsystem/planets/earth/moon/moon moonAsset
scene/solarsystem/missions/apollo/8/apollo8
scene/solarsystem/missions/apollo/11/apollo11
scene/solarsystem/missions/apollo/17/lem
scene/solarsystem/missions/apollo/apollo_globebrowsing
scene/solarsystem/missions/apollo/11/lem_flipbook
scene/solarsystem/missions/apollo/insignias_map
#Property
setPropertyValueSingle Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode 0
@@ -24,7 +25,7 @@ F7 Setup for A17 site Setup A17 site /Missions/Apollo/17 false "openspace.time.s
absolute 1972 DEC 12 19:47:11
#Camera
goToGeo "Moon" 20 -60 15000000
goToGeo moonAsset.Moon.Identifier 20 -60 15000000
#MarkNodes
Moon

View File

@@ -0,0 +1,34 @@
#Version
1.0
#Asset
base
scene/solarsystem/planets/earth/earth earthAsset
scene/solarsystem/sssb/amor_asteroid
scene/solarsystem/sssb/apollo_asteroid
scene/solarsystem/sssb/aten_asteroid
scene/solarsystem/sssb/atira_asteroid
scene/solarsystem/sssb/centaur_asteroid
scene/solarsystem/sssb/chiron-type_comet
scene/solarsystem/sssb/encke-type_comet
scene/solarsystem/sssb/halley-type_comet
scene/solarsystem/sssb/inner_main_belt_asteroid
scene/solarsystem/sssb/jupiter_trojan_asteroid
scene/solarsystem/sssb/jupiter-family_comet
scene/solarsystem/sssb/main_belt_asteroid
scene/solarsystem/sssb/mars-crossing_asteroid
scene/solarsystem/sssb/outer_main_belt_asteroid
scene/solarsystem/sssb/transneptunian_object_asteroid
scene/solarsystem/sssb/pha
#Time
relative -1d
#Camera
goToGeo earthAsset.Earth.Identifier 58.5877 16.1924 2.7e12
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -0,0 +1,19 @@
#Version
1.0
#Asset
base
scene/solarsystem/missions/dawn/ceres
scene/solarsystem/missions/dawn/dawn DawnAsset
scene/solarsystem/missions/dawn/vesta
#Time
absolute 2011 AUG 06 00:00:00
#Camera
setNavigationState DawnAsset.Dawn.Identifier 526781518487.171326, 257168309890.072144, -1381125204152.817383
#MarkNodes
Dawn
Ceres
Vesta

View File

@@ -0,0 +1,22 @@
#Version
1.0
#Asset
base
scene/solarsystem/planets/earth/earth earthAsset
scene/solarsystem/planets/earth/satellites/satellites
#Property
setPropertyValue {earth_satellites}.Renderable.Enabled false
#Time
relative -1d
#Camera
goToGeo earthAsset.Earth.Identifier 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -0,0 +1,28 @@
#Version
1.0
#Asset
base
scene/solarsystem/planets/earth/earth
scene/solarsystem/planets/earth/satellites/satellites
scene/solarsystem/planets/jupiter/minor_moons
scene/solarsystem/planets/saturn/minor_moons
scene/solarsystem/planets/uranus/minor_moons
scene/solarsystem/planets/neptune/inner_moons
scene/solarsystem/planets/neptune/irregular_prograde_moons
scene/solarsystem/planets/neptune/irregular_retrograde_moons
#Property
setPropertyValue {earth_satellites}.Renderable.Enabled false
#Time
relative -1d
#Camera
goToGeo "Earth" 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -0,0 +1,24 @@
#Version
1.0
#Module
Gaia openspace.printFatal('Could not load gaia profile due to missing module "gaia"')
#Asset
base
scene/solarsystem/planets/earth/earth
scene/milkyway/gaia/gaiastars
scene/milkyway/gaia/apogee
scene/milkyway/gaia/galah
scene/solarsystem/missions/gaia/gaia
scene/solarsystem/missions/gaia/trail
scene/solarsystem/missions/gaia/dashboard
#Property
setPropertyValueSingle Scene.Stars.Renderable.Enabled false
#Camera
setNavigationState "Earth" 1000000000000.0, 1000000000000.0, 1000000000000.0
#MarkNodes
Gaia

View File

@@ -2,7 +2,8 @@
1.0
#Asset
scene/solarsystem/missions/insight/edl required
base
scene/solarsystem/missions/insight/edl insightAsset
#Property
setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
@@ -23,7 +24,7 @@ SHIFT+i Undo Insight landing layers setup Unset Insight layers /Missions/Insight
absolute 2018 NOV 26 19:39:03.68
#Camera
setNavigationState "Insight" "Root" 8.430115E0, -1.791710E1, 2.813660E0 0.494659E0,0.357162E0,0.792306E0
setNavigationState insightAsset.Insight.Identifier "Root" 8.430115E0, -1.791710E1, 2.813660E0 0.494659E0,0.357162E0,0.792306E0
#MarkNodes
Insight

View File

@@ -2,7 +2,8 @@
1.0
#Asset
scene/solarsystem/missions/juno/juno required
base
scene/solarsystem/missions/juno/juno junoAsset
#Keybinding
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
@@ -30,7 +31,7 @@ Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set
absolute 2016-07-01T10:05:00.00
#Camera
setNavigationState "Juno" "Root" 1.243398E8, 7.176068E7, -1.519733E7 -0.377400E0, 0.764573E0, 0.522492E0
setNavigationState junoAsset.Juno.Identifier "Root" 1.243398E8, 7.176068E7, -1.519733E7 -0.377400E0, 0.764573E0, 0.522492E0
#MarkNodes
Jupiter

View File

@@ -0,0 +1,25 @@
#Version
1.0
#Asset
util/scene_helper sceneHelper
base
scene/solarsystem/missions/perseverance/perseverance
scene/solarsystem/missions/perseverance/shortcuts perseveranceShortcuts
scene/solarsystem/missions/insight/edl insightAsset
scene/solarsystem/missions/insight/shortcuts insightShortcuts
#Camera
goToGeo "Mars" 58.5877 16.1924 8000000
#MarkNodes
Mars
Insight
Perseverance
#AdditionalScripts
local insightEDLShortcuts = sceneHelper.extractShortcuts({"Insight Height Offset", "Enable HiRISE", "Insight EDL Time", "Insight EDL NavigationState"}, insightShortcuts.Shortcuts)
local insightDisableShortcuts = sceneHelper.extractShortcuts({"Default Height Offset", "Disable HiRISE"}, insightShortcuts.Shortcuts)
local PerseverenceLandedShortcuts = sceneHelper.extractShortcuts({"Perseverance Height Offset", "Perseverance landed time", "Enable HiRISE"}, perseveranceShortcuts.Shortcuts)
local Keybindings = { sceneHelper.createKeyBindFromShortcuts("i", insightEDLShortcuts, "/Missions/Insight", "Set and goto Insight Landing", "Setup scene for insight EDL" ), sceneHelper.createKeyBindFromShortcuts("SHIFT+i", insightDisableShortcuts, "/Missions/Insight", "Unset Insight Landing", "Disable Mars layer settings used for insight EDL" ), sceneHelper.createKeyBindFromShortcuts("p", PerseverenceLandedShortcuts, "/Missions/Perseverance" )}
sceneHelper.bindKeys(Keybindings)

View File

@@ -5,7 +5,9 @@
Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
#Asset
scene/solarsystem/missions/messenger/messengerSC required
base
scene/solarsystem/missions/messenger/dashboard
scene/solarsystem/missions/messenger/messengerSC
#Keybinding
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"

View File

@@ -2,8 +2,12 @@
1.0
#Asset
scene/solarsystem/missions/newhorizons/newhorizons required
scene/solarsystem/missions/newhorizons/model required
util/property_helper propertyHelper
util/renderable_helper renderableHelper
base
scene/solarsystem/missions/newhorizons/newhorizons
scene/solarsystem/missions/newhorizons/model
scene/solarsystem/missions/newhorizons/dashboard
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000

View File

@@ -2,8 +2,11 @@
1.0
#Asset
scene/solarsystem/missions/osirisrex/model required
scene/solarsystem/missions/osirisrex/osirisrex required
util/property_helper propertyHelper
base
scene/solarsystem/missions/osirisrex/model OsirisRexAsset
scene/solarsystem/missions/osirisrex/osirisrex
scene/solarsystem/missions/osirisrex/dashboard
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000
@@ -12,13 +15,13 @@ setPropertyValueSingle Scene.Charon.Renderable.Enabled false
setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
#Keybinding
a Sets the focus of the camera on 'OsirisRex'. Focus on OsirisRex /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
a Sets the focus of the camera on 'OsirisRex' Focus on OsirisRex /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
s Sets the focus of the camera on 'Bennu' Focus on Bennu /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'BennuBarycenter'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
F8 Sets the time to the approach at Bennu. Set Bennu approach time /Missions/Osiris Rex false "openspace.printInfo('Set time: Approach'); openspace.time.setTime('2018-SEP-11 21:31:01.183')"
F9 Sets the time to the preliminary survey of Bennu. Set Bennu survey time /Missions/Osiris Rex false "openspace.printInfo('Set time: Preliminary Survey'); openspace.time.setTime('2018-NOV-20 01:13:12.183')"
F10 Sets the time to the orbital B event. Set orbital B event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Orbital B'); openspace.time.setTime('2019-APR-08 10:35:27.186')"
F11 Sets the time to the recon event. Set recon event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Recon'); openspace.time.setTime('2019-MAY-25 03:50:31.195')"
q Toggles the visibility of the text marking the location of the Sun. Toggle Sun marker /Missions/Osiris Rex false propertyHelper.invert('Scene.SunMarker.Renderable.Enabled')
F8 Sets the time to the approach at Bennu Set Bennu approach time /Missions/Osiris Rex false "openspace.printInfo('Set time: Approach'); openspace.time.setTime('2018-SEP-11 21:31:01.183')"
F9 Sets the time to the preliminary survey of Bennu Set Bennu survey time /Missions/Osiris Rex false "openspace.printInfo('Set time: Preliminary Survey'); openspace.time.setTime('2018-NOV-20 01:13:12.183')"
F10 Sets the time to the orbital B event Set orbital B event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Orbital B'); openspace.time.setTime('2019-APR-08 10:35:27.186')"
F11 Sets the time to the recon event Set recon event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Recon'); openspace.time.setTime('2019-MAY-25 03:50:31.195')"
q Toggles the visibility of the text marking the location of the Sun Toggle Sun marker /Missions/Osiris Rex false propertyHelper.invert('Scene.SunMarker.Renderable.Enabled')
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)"
3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)"
@@ -37,7 +40,7 @@ Shift+3 Setting the simulation speed to 8640 seconds per realtime second Set sim
absolute 2018 10 30 23:00:00.500
#Camera
setNavigationState "OsirisRex" 26974590199.661884, 76314608558.908020, -127086452897.101791
setNavigationState OsirisRexAsset.OsirisRex.Identifier 26974590199.661884, 76314608558.908020, -127086452897.101791
#MarkNodes
OsirisRex

View File

@@ -5,29 +5,33 @@
Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
#Asset
scene/solarsystem/missions/rosetta/67p required
scene/solarsystem/missions/rosetta/rosetta required
util/property_helper propertyHelper
util/renderable_helper renderableHelper
base
scene/solarsystem/missions/rosetta/67p Comet67PAsset
scene/solarsystem/missions/rosetta/rosetta
scene/solarsystem/missions/rosetta/dashboard
#Property
setPropertyValue Scene.67P.Renderable.PerformShading false
setPropertyValue Scene.ImagePlaneRosetta.Renderable.Enabled false
#Keybinding
a Sets the focus of the camera on '67P'. Focus on 67P /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
a Sets the focus of the camera on '67P' Focus on 67P /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
s Sets the focus of the camera on 'Rosetta' Focus on Rosetta /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
F5 Jumps to the time of initial approach of Rosetta to 67P. Set initial approach time /Missions/Rosetta false "openspace.time.setTime('2014-08-01T03:05:18.101')"
F6 Jumps to the time when the Philae lander is released. Set lander release time /Missions/Rosetta false "openspace.time.setTime('2014-11-12T08:20:00.00')"
Shift+F6 Jumps to the time of initial approach of Rosetta to 67P. Set initial approach time /Missions/Rosetta false "openspace.time.setTime('2014-08-01T03:05:18.101')"
F8 Removes all image projections from 67P. Clear 67P projections /Missions/Rosetta false "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)"
e Toggles the visibility of all trails further from the Sun than 67P. Toggle outer planetary trails /Missions/Rosetta false renderableHelper.toggle('Scene.JupiterTrail')..renderableHelper.toggle('Scene.SaturnTrail')..renderableHelper.toggle('Scene.UranusTrail')..renderableHelper.toggle('Scene.NeptuneTrail')
i Toggles the visibility of the free floating image plane. Toggle image plane /Missions/Rosetta false renderableHelper.toggle('Scene.ImagePlaneRosetta')
g Toggles the visibility of Philae's trail. Toggle Philae trail /Missions/Rosetta false renderableHelper.toggle('Scene.PhilaeTrail')
o Toggles the visibility of Philae's trail. Toggle Philae trail /Missions/Rosetta false renderableHelper.toggle('Scene.PhilaeTrail')
p Enables or disables the image projection on 67P. Toggle 67P projection /Missions/Rosetta false propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection')
#Time
absolute 2014-08-01T03:05:00.000
#Camera
setNavigationState "67P" "Root" -7.294781E5 , -6.657894E5, 2.509047E6 0.146529E0, 0.944727E0, 0.293290E0
setNavigationState Comet67PAsset.Comet67P.Identifier "Root" -7.294781E5 , -6.657894E5, 2.509047E6 0.146529E0, 0.944727E0, 0.293290E0
#MarkNodes
67P

View File

@@ -5,8 +5,9 @@
Touch local webGui = asset.require('util/webgui'); webGui.setCefRoute("ontouch") openspace.printFatal('Could not load scene due to missing module "touch"')
#Asset
scene/solarsystem/planets/earth/earth required
util/webgui required
base
scene/solarsystem/planets/earth/earth earthAsset
util/webgui
#Property
setPropertyValueSingle Scene.Pluto.Renderable.Enabled false
@@ -17,7 +18,7 @@ setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
relative -1d
#Camera
setNavigationState "Earth" 58.5877,16.1924,20000000
setNavigationState earthAsset.Earth.Identifier 58.5877,16.1924,20000000
#MarkNodes
Earth

View File

@@ -2,14 +2,16 @@
1.0
#Asset
scene/solarsystem/planets/jupiter/minor_moons required
scene/solarsystem/planets/saturn/minor_moons required
scene/solarsystem/planets/uranus/minor_moons required
scene/solarsystem/planets/neptune/inner_moons required
scene/solarsystem/planets/neptune/irregular_prograde_moons required
scene/solarsystem/planets/neptune/irregular_retrograde_moons required
scene/solarsystem/missions/voyager/voyager1 required
scene/solarsystem/missions/voyager/voyager2 required
base
scene/solarsystem/planets/jupiter/minor_moons
scene/solarsystem/planets/saturn/minor_moons
scene/solarsystem/planets/uranus/minor_moons
scene/solarsystem/planets/neptune/inner_moons
scene/solarsystem/planets/neptune/irregular_prograde_moons
scene/solarsystem/planets/neptune/irregular_retrograde_moons
scene/solarsystem/missions/voyager/voyager1 VoyagerAsset
scene/solarsystem/missions/voyager/voyager2
scene/solarsystem/missions/voyager/dashboard
#Keybinding
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
@@ -42,7 +44,7 @@ setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
absolute 1977 SEP 10 12:00:00
#Camera
setNavigationState "Voyager_1" "Root" 526781518487.171326, 257168309890.072144, -1381125204152.817383
setNavigationState VoyagerAsset.Voyager_1.Identifier "Root" 526781518487.171326, 257168309890.072144, -1381125204152.817383
#MarkNodes
Earth

View File

@@ -91,6 +91,7 @@ struct Configuration {
glm::dvec3 screenSpaceRotation = glm::dvec3(0.0);
glm::dvec3 masterRotation = glm::dvec3(0.0);
bool isConsoleDisabled = false;
bool usingProfile = false;
std::map<std::string, ghoul::Dictionary> moduleConfigurations;

View File

@@ -65,6 +65,7 @@ namespace scripting {
class ScriptEngine;
class ScriptScheduler;
} // namespace scripting
class Profile;
namespace global {
@@ -100,6 +101,7 @@ properties::PropertyOwner& gRootPropertyOwner();
properties::PropertyOwner& gScreenSpaceRootPropertyOwner();
scripting::ScriptEngine& gScriptEngine();
scripting::ScriptScheduler& gScriptScheduler();
Profile& gProfile();
} // namespace detail
@@ -139,6 +141,7 @@ static properties::PropertyOwner& screenSpaceRootPropertyOwner =
detail::gScreenSpaceRootPropertyOwner();
static scripting::ScriptEngine& scriptEngine = detail::gScriptEngine();
static scripting::ScriptScheduler& scriptScheduler = detail::gScriptScheduler();
static Profile& profile = detail::gProfile();
void initialize();
void initializeGL();

View File

@@ -76,6 +76,7 @@ public:
const glm::mat4& projectionMatrix);
void drawOverlays();
void postDraw();
void resetPropertyChangeFlags();
void keyboardCallback(Key key, KeyModifier mod, KeyAction action);
void charCallback(unsigned int codepoint, KeyModifier modifier);
void mouseButtonCallback(MouseButton button, MouseAction action, KeyModifier mods);
@@ -110,6 +111,7 @@ private:
void runGlobalCustomizationScripts();
void configureLogging();
std::string generateFilePath(std::string openspaceRelativePath);
void resetPropertyChangeFlagsOfSubowners(openspace::properties::PropertyOwner* po);
std::unique_ptr<Scene> _scene;
std::unique_ptr<AssetManager> _assetManager;

View File

@@ -27,6 +27,7 @@
#include <openspace/interaction/externinteraction.h>
#include <openspace/interaction/keyframenavigator.h>
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/scripting/lualibrary.h>
#include <vector>
@@ -65,6 +66,12 @@ public:
*/
void preSynchronization();
/**
* If enabled, calling this function will render information about the session
* recording that is currently taking place to the screen.
*/
void render();
/**
* Current time based on playback mode
*/
@@ -209,6 +216,8 @@ public:
std::vector<std::string> playbackList() const;
private:
properties::BoolProperty _renderPlaybackInformation;
enum class RecordedType {
Camera = 0,
Time,

View File

@@ -495,6 +495,18 @@ public:
*/
virtual std::string generateAdditionalJsonDescription() const;
/**
* Returns whether or not the property value has changed.
*
* \return true if the property has changed
*/
bool hasChanged() const;
/**
* Reset the valChanged flag to an unchanged state, as if value has not been changed.
*/
void resetToUnchanged();
protected:
static const char* IdentifierKey;
static const char* NameKey;
@@ -531,6 +543,9 @@ protected:
/// The callback function sthat will be invoked whenever the value changes
std::vector<std::pair<OnDeleteHandle, std::function<void()>>> _onDeleteCallbacks;
/// Flag indicating that this property value has been changed after initialization
bool _isValueDirty = false;
private:
void notifyDeleteListeners();

View File

@@ -176,6 +176,7 @@ void openspace::properties::TemplateProperty<T>::setValue(T val) {
if (val != _value) {
_value = std::move(val);
notifyChangeListeners();
_isValueDirty = true;
}
}
@@ -196,6 +197,7 @@ void TemplateProperty<T>::set(std::any value) {
if (v != _value) {
_value = std::move(v);
notifyChangeListeners();
_isValueDirty = true;
}
}

View File

@@ -53,8 +53,9 @@ public:
enum class RenderBin : int {
Background = 1,
Opaque = 2,
Transparent = 4,
Overlay = 8
PreDeferredTransparent = 4,
PostDeferredTransparent = 8,
Overlay = 16
};
static std::unique_ptr<Renderable> createFromDictionary(

View File

@@ -218,6 +218,7 @@ private:
_onDependencyInitializationFunctionRefs;
std::unordered_map<Asset*, std::map<Asset*, std::vector<int>>>
_onDependencyDeinitializationFunctionRefs;
int _assetsTableRef = 0;
};

View File

@@ -0,0 +1,163 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___PROFILE___H__
#define __OPENSPACE_CORE___PROFILE___H__
#include <openspace/engine/globals.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/properties/propertyowner.h>
#include <openspace/util/keys.h>
#include <optional>
#include <string>
#include <variant>
#include <vector>
namespace openspace {
namespace scripting { struct LuaLibrary; }
class Profile {
public:
// Version
struct Version {
int major = 0;
int minor = 0;
};
struct Module {
std::string name;
std::string loadedInstruction;
std::string notLoadedInstruction;
};
struct Meta {
std::string name;
std::string version;
std::string description;
std::string author;
std::string url;
std::string license;
};
struct Asset {
std::string path;
std::string name;
};
struct Property {
enum class SetType {
SetPropertyValue,
SetPropertyValueSingle
};
SetType setType;
std::string name;
std::string value;
};
struct Keybinding {
KeyWithModifier key;
std::string documentation;
std::string name;
std::string guiPath;
bool isLocal;
std::string script;
};
struct Time {
enum class Type {
Absolute,
Relative
};
Type type;
std::string time;
};
struct CameraNavState {
static constexpr const char* Type = "setNavigationState";
std::string anchor;
std::string aim;
std::string referenceFrame;
glm::dvec3 position;
std::optional<glm::dvec3> up;
std::optional<double> yaw;
std::optional<double> pitch;
};
struct CameraGoToGeo {
static constexpr const char* Type = "goToGeo";
std::string anchor;
double latitude;
double longitude;
std::optional<double> altitude;
};
using CameraType = std::variant<CameraNavState, CameraGoToGeo>;
Profile() = default;
Profile(const std::vector<std::string>& content);
std::string serialize() const;
std::string convertToScene() const;
/**
* Saves all current settings, starting from the profile that was loaded at startup,
* and all of the property & asset changes that were made since startup.
*/
void saveCurrentSettingsToProfile(const properties::PropertyOwner& rootOwner,
const std::string& currentTime,
interaction::NavigationHandler::NavigationState navState);
/// If the value passed to this function is 'true', the addAsset and removeAsset
/// functions will be no-ops instead
void setIgnoreUpdates(bool ignoreUpdates);
/// Adds a new asset and checks for duplicates
void addAsset(const std::string& path);
/// Removes an asset
void removeAsset(const std::string& path);
/**
* Returns the Lua library that contains all Lua functions available to provide
* profile functionality.
* \return The Lua library that contains all Lua functions available for profiles
*/
static scripting::LuaLibrary luaLibrary();
private:
static constexpr const Version CurrentVersion = Version { 1, 0 };
Version version = CurrentVersion;
std::vector<Module> modules;
std::optional<Meta> meta;
std::vector<Asset> assets;
std::vector<Property> properties;
std::vector<Keybinding> keybindings;
std::optional<Time> time;
std::optional<CameraType> camera;
std::vector<std::string> markNodes;
std::vector<std::string> additionalScripts;
bool _ignoreUpdates = false;
};
} // namespace openspace
#endif // __OPENSPACE_CORE___PROFILE___H__

View File

@@ -60,11 +60,14 @@
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
#include <openspace/util/updatestructures.h>
#include <openspace/util/spicemanager.h>
#include <openspace/engine/globals.h>
#include <openspace/rendering/renderable.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/rendering/renderer.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/scene/scene.h>
#include <openspace/util/updatestructures.h>
#include <openspace/util/spicemanager.h>
#include <ghoul/glm.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/logmanager.h>
@@ -111,6 +114,37 @@ namespace {
constexpr const float ATM_EPS = 2.f;
constexpr const float KM_TO_M = 1000.f;
void createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size) {
glGenVertexArrays(1, vao);
glGenBuffers(1, vbo);
glBindVertexArray(*vao);
glBindBuffer(GL_ARRAY_BUFFER, *vbo);
const GLfloat vertex_data[] = {
// x y z w
-size, -size, 0.0f, 1.0f,
size, size, 0.0f, 1.0f,
-size, size, 0.0f, 1.0f,
-size, -size, 0.0f, 1.0f,
size, -size, 0.0f, 1.0f,
size, size, 0.0f, 1.0f
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glVertexAttribPointer(
0,
4,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 4,
nullptr
);
glEnableVertexAttribArray(0);
glBindVertexArray(0);
}
} // namespace
namespace openspace {
@@ -169,12 +203,8 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
renderData.camera.sgctInternal.projectionMatrix()
) * renderData.camera.combinedViewMatrix();
if (!isAtmosphereInFrustum(
MV,
tPlanetPosWorld,
(_atmosphereRadius + ATM_EPS)*KM_TO_M)
)
{
const float totalAtmosphere = (_atmosphereRadius + ATM_EPS)* KM_TO_M;
if (!isAtmosphereInFrustum(MV, tPlanetPosWorld, totalAtmosphere)) {
program.setUniform(_uniformCache.cullAtmosphere, 1);
}
else {
@@ -290,6 +320,32 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
);
casterPos *= KM_TO_M; // converting to meters
const std::string source = shadowConf.source.first;
SceneGraphNode* sourceNode =
global::renderEngine.scene()->sceneGraphNode(source);
const std::string caster = shadowConf.caster.first;
SceneGraphNode* casterNode =
global::renderEngine.scene()->sceneGraphNode(caster);
const double sourceRadiusScale = std::max(
glm::compMax(sourceNode->scale()),
1.0
);
const double casterRadiusScale = std::max(
glm::compMax(casterNode->scale()),
1.0
);
if ((sourceNode == nullptr) || (casterNode == nullptr)) {
LERRORC(
"AtmosphereDeferredcaster",
"Invalid scenegraph node for the shadow's caster or shadow's "
"receiver."
);
return;
}
// First we determine if the caster is shadowing the current planet
// (all calculations in World Coordinates):
glm::dvec3 planetCasterVec =
@@ -300,9 +356,11 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
glm::dot(planetCasterVec, sourceCasterVec) /
(sc_length*sc_length)) * sourceCasterVec;
double d_test = glm::length(planetCasterVec - planetCaster_proj);
double xp_test = shadowConf.caster.second *
sc_length / (shadowConf.source.second + shadowConf.caster.second);
double rp_test = shadowConf.caster.second *
double xp_test = shadowConf.caster.second * casterRadiusScale *
sc_length /
(shadowConf.source.second * sourceRadiusScale +
shadowConf.caster.second * casterRadiusScale);
double rp_test = shadowConf.caster.second * casterRadiusScale *
(glm::length(planetCaster_proj) + xp_test) / xp_test;
double casterDistSun = glm::length(casterPos - sunPosWorld);
@@ -314,12 +372,12 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
shadowData.isShadowing = false;
if (((d_test - rp_test) < (_atmospherePlanetRadius * KM_TO_M)) &&
//if (((d_test - rp_test) < (_atmosphereRadius * KM_TO_M)) &&
(casterDistSun < planetDistSun)) {
(casterDistSun < planetDistSun))
{
// The current caster is shadowing the current planet
shadowData.isShadowing = true;
shadowData.rs = shadowConf.source.second;
shadowData.rc = shadowConf.caster.second;
shadowData.rs = shadowConf.source.second * sourceRadiusScale;
shadowData.rc = shadowConf.caster.second * casterRadiusScale;
shadowData.sourceCasterVec = glm::normalize(sourceCasterVec);
shadowData.xp = xp_test;
shadowData.xu = shadowData.rc * sc_length /
@@ -331,7 +389,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
const std::string uniformVarName("shadowDataArray[");
unsigned int counter = 0;
for (const ShadowRenderingStruct & sd : shadowDataArray) {
for (const ShadowRenderingStruct& sd : shadowDataArray) {
std::stringstream ss;
ss << uniformVarName << counter << "].isShadowing";
program.setUniform(ss.str(), sd.isShadowing);
@@ -464,30 +522,24 @@ void AtmosphereDeferredcaster::setSunRadianceIntensity(float sunRadiance) {
_sunRadianceIntensity = sunRadiance;
}
void AtmosphereDeferredcaster::setRayleighScatteringCoefficients(
const glm::vec3& rayScattCoeff)
void AtmosphereDeferredcaster::setRayleighScatteringCoefficients(glm::vec3 rayScattCoeff)
{
_rayleighScatteringCoeff = std::move(rayScattCoeff);
}
void AtmosphereDeferredcaster::setOzoneExtinctionCoefficients(
const glm::vec3& ozoneExtCoeff)
{
void AtmosphereDeferredcaster::setOzoneExtinctionCoefficients(glm::vec3 ozoneExtCoeff) {
_ozoneExtinctionCoeff = std::move(ozoneExtCoeff);
}
void AtmosphereDeferredcaster::setMieScatteringCoefficients(
const glm::vec3& mieScattCoeff)
{
void AtmosphereDeferredcaster::setMieScatteringCoefficients(glm::vec3 mieScattCoeff) {
_mieScatteringCoeff = std::move(mieScattCoeff);
}
void AtmosphereDeferredcaster::setMieExtinctionCoefficients(const glm::vec3& mieExtCoeff)
{
void AtmosphereDeferredcaster::setMieExtinctionCoefficients(glm::vec3 mieExtCoeff) {
_mieExtinctionCoeff = std::move(mieExtCoeff);
}
void AtmosphereDeferredcaster::setEllipsoidRadii(const glm::dvec3& radii) {
void AtmosphereDeferredcaster::setEllipsoidRadii(glm::dvec3 radii) {
_ellipsoidRadii = std::move(radii);
}
@@ -496,7 +548,7 @@ void AtmosphereDeferredcaster::setHardShadows(bool enabled) {
}
void AtmosphereDeferredcaster::setShadowConfigArray(
const std::vector<ShadowConfiguration>& shadowConfigArray)
std::vector<ShadowConfiguration> shadowConfigArray)
{
_shadowConfArray = std::move(shadowConfigArray);
}
@@ -1210,36 +1262,6 @@ void AtmosphereDeferredcaster::preCalculateAtmosphereParam() {
LDEBUG("Ended precalculations for Atmosphere effects...");
}
void AtmosphereDeferredcaster::createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size) {
glGenVertexArrays(1, vao);
glGenBuffers(1, vbo);
glBindVertexArray(*vao);
glBindBuffer(GL_ARRAY_BUFFER, *vbo);
const GLfloat vertex_data[] = {
// x y z w
-size, -size, 0.0f, 1.0f,
size, size, 0.0f, 1.0f,
-size, size, 0.0f, 1.0f,
-size, -size, 0.0f, 1.0f,
size, -size, 0.0f, 1.0f,
size, size, 0.0f, 1.0f
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glVertexAttribPointer(
0,
4,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 4,
nullptr
);
glEnableVertexAttribArray(0);
glBindVertexArray(0);
}
void AtmosphereDeferredcaster::loadAtmosphereDataIntoShaderProgram(
std::unique_ptr<ghoul::opengl::ProgramObject>& shaderProg)
{

View File

@@ -79,12 +79,12 @@ public:
void setMieHeightScale(float mieHeightScale);
void setMiePhaseConstant(float miePhaseConstant);
void setSunRadianceIntensity(float sunRadiance);
void setRayleighScatteringCoefficients(const glm::vec3& rayScattCoeff);
void setOzoneExtinctionCoefficients(const glm::vec3& ozoneExtCoeff);
void setMieScatteringCoefficients(const glm::vec3& mieScattCoeff);
void setMieExtinctionCoefficients(const glm::vec3& mieExtCoeff);
void setEllipsoidRadii(const glm::dvec3& radii);
void setShadowConfigArray(const std::vector<ShadowConfiguration>& shadowConfigArray);
void setRayleighScatteringCoefficients(glm::vec3 rayScattCoeff);
void setOzoneExtinctionCoefficients(glm::vec3 ozoneExtCoeff);
void setMieScatteringCoefficients(glm::vec3 mieScattCoeff);
void setMieExtinctionCoefficients(glm::vec3 mieExtCoeff);
void setEllipsoidRadii(glm::dvec3 radii);
void setShadowConfigArray(std::vector<ShadowConfiguration> shadowConfigArray);
void setHardShadows(bool enabled);
void enableSunFollowing(bool enable);
@@ -99,7 +99,6 @@ private:
void deleteUnusedComputationTextures();
void executeCalculations(GLuint quadCalcVAO, GLenum drawBuffers[1],
GLsizei vertexSize);
void createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size);
void step3DTexture(std::unique_ptr<ghoul::opengl::ProgramObject>& shaderProg,
int layer, bool doCalculation = true);
void checkFrameBufferState(const std::string& codePosition) const;

View File

@@ -130,7 +130,7 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co
return vec4(0.2, 0.2, 0.2, 1.0);
}
else {
return butterworthFunc(length_d, r_u_pi, 4.0);
return butterworthFunc(length_d, r_u_pi, 2.0);
}
}
else {
@@ -138,7 +138,8 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co
return vec4(0.5, 0.5, 0.5, 1.0);
}
else {
return vec4(vec3(length_d/r_p_pi), 1.0);
//return vec4(vec3(length_d/r_p_pi), 1.0);
return butterworthFunc(length_d, r_u_pi, 2.0);
}
}
}
@@ -621,7 +622,7 @@ void main() {
// All calculations are done in Km:
pixelDepth *= 0.001;
positionObjectsCoords.xyz *= 0.001;
if (pixelDepth < offset) {
// ATM Occluded - Something in fron of ATM.
atmosphereFinalColor += color;

View File

@@ -350,7 +350,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
setRenderBinFromOpacity();
break;
case BlendModeAdditive:
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
break;
default:
throw ghoul::MissingCaseException();
@@ -608,7 +608,7 @@ void RenderableLabels::initialize() {
throw ghoul::RuntimeError("Error loading objects labels data.");
}
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
void RenderableLabels::initializeGL() {

View File

@@ -47,10 +47,11 @@ namespace {
constexpr const char* ProgramName = "ModelProgram";
constexpr const char* KeyGeometry = "Geometry";
constexpr const std::array<const char*, 11> UniformNames = {
constexpr const std::array<const char*, 12> UniformNames = {
"opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities",
"modelViewTransform", "projectionTransform", "performShading", "texture1",
"ambientIntensity", "diffuseIntensity", "specularIntensity"
"modelViewTransform", "crippedModelViewTransform", "projectionTransform",
"performShading", "texture1", "ambientIntensity", "diffuseIntensity",
"specularIntensity"
};
constexpr openspace::properties::Property::PropertyInfo TextureInfo = {
@@ -380,6 +381,16 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
_uniformCache.modelViewTransform,
glm::mat4(modelViewTransform)
);
glm::dmat4 crippedModelViewTransform = glm::transpose(glm::inverse(
glm::dmat4(glm::inverse(data.camera.sgctInternal.viewMatrix())) * modelViewTransform
));
_program->setUniform(
_uniformCache.crippedModelViewTransform,
glm::mat4(crippedModelViewTransform)
);
_program->setUniform(
_uniformCache.projectionTransform,
data.camera.projectionMatrix()

View File

@@ -88,8 +88,9 @@ private:
ghoul::opengl::ProgramObject* _program = nullptr;
UniformCache(opacity, nLightSources, lightDirectionsViewSpace, lightIntensities,
modelViewTransform, projectionTransform, performShading, texture,
ambientIntensity, diffuseIntensity, specularIntensity) _uniformCache;
modelViewTransform, crippedModelViewTransform, projectionTransform,
performShading, texture, ambientIntensity, diffuseIntensity,
specularIntensity) _uniformCache;
std::unique_ptr<ghoul::opengl::Texture> _texture;
std::vector<std::unique_ptr<LightSource>> _lightSources;

View File

@@ -130,7 +130,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
setRenderBinFromOpacity();
break;
case BlendModeAdditive:
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
break;
default:
throw ghoul::MissingCaseException();

View File

@@ -117,8 +117,11 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di
else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
else if (renderType == "PreDeferredTransparent") {
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
else if (renderType == "PostDeferredTransparent") {
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);

View File

@@ -264,7 +264,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
_useAdditiveBlending = dictionary.value<bool>(UseAdditiveBlendingInfo.identifier);
if (_useAdditiveBlending) {
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
}

View File

@@ -68,6 +68,14 @@ namespace {
{ "Points+Lines", RenderingModeLinesPoints }
};
// Fragile! Keep in sync with documentation
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinModeConversion = {
{ "Background", openspace::Renderable::RenderBin::Background },
{ "Opaque", openspace::Renderable::RenderBin::Opaque },
{ "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent},
{ "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent}
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo
AppearanceInfo = {
"Appearance",
@@ -122,6 +130,13 @@ namespace {
"corresponding points (and subpoints) are shown. 'Lines+Points' shows both parts."
};
constexpr openspace::properties::Property::PropertyInfo RenderBinModeInfo = {
"RenderBinMode",
"RenderBin Mode",
"Determines if the trails will be rendered after all other elements, including"
"atmospheres if needed."
};
} // namespace
namespace openspace {
@@ -255,6 +270,13 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
}
addPropertySubOwner(_appearance);
if (dictionary.hasKeyAndValue<std::string>(RenderBinModeInfo.identifier)) {
openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at(
dictionary.value<std::string>(RenderBinModeInfo.identifier)
);
setRenderBin(cfgRenderBin);
}
}
void RenderableTrail::initializeGL() {

View File

@@ -184,8 +184,11 @@ RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary)
else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
else if (renderType == "PreDeferredTransparent") {
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
else if (renderType == "PostDeferredTransparent") {
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);

View File

@@ -37,7 +37,7 @@ out vec4 vs_positionCameraSpace;
uniform mat4 modelViewTransform;
uniform mat4 projectionTransform;
uniform mat4 crippedModelViewTransform;
void main() {
vs_positionCameraSpace = modelViewTransform * in_position;
@@ -48,6 +48,6 @@ void main() {
vs_st = in_st;
vs_screenSpaceDepth = positionScreenSpace.w;
// The normal transform should be the transposed inverse of the model transform?
vs_normalViewSpace = normalize(mat3(modelViewTransform) * in_normal);
//vs_normalViewSpace = normalize(transpose(inverse(mat3(crippedModelViewTransform))) * in_normal);
vs_normalViewSpace = normalize(mat3(crippedModelViewTransform) * in_normal);
}

View File

@@ -67,13 +67,16 @@ Fragment getFragment() {
if (distanceCenter > dLW) {
frag.color.a = 0.0;
//discard;
}
else {
frag.color.a *= pow(float((dLW - distanceCenter) / dLW), blendFactor);
// if (frag.color.a < 0.4)
// discard;
}
frag.gPosition = vs_gPosition;
// There is no normal here
frag.gNormal = vec4(0.0, 0.0, -1.0, 1.0);

View File

@@ -699,7 +699,7 @@ void RenderableBillboardsCloud::initialize() {
_colorOption.setValue(static_cast<int>(_colorRangeData.size() - 1));
}
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
void RenderableBillboardsCloud::initializeGL() {

View File

@@ -435,7 +435,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
setRenderBin(Renderable::RenderBin::Opaque);
break;
case BlendModeAdditive:
setRenderBin(Renderable::RenderBin::Transparent);
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
break;
default:
throw ghoul::MissingCaseException();

View File

@@ -114,7 +114,7 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows],
return vec4(0.2, 0.2, 0.2, 1.0);
#else
// butterworthFunc
return vec4(vec3(sqrt(r_u_pi / (r_u_pi + pow(length_d, 8.0)))), 1.0);
return vec4(vec3(sqrt(r_u_pi / (r_u_pi + pow(length_d, 2.0)))), 1.0);
#endif
}
else {

View File

@@ -24,19 +24,21 @@
#include <modules/globebrowsing/src/renderableglobe.h>
#include <modules/debugging/rendering/debugrenderer.h>
#include <modules/globebrowsing/src/basictypes.h>
#include <modules/globebrowsing/src/gpulayergroup.h>
#include <modules/globebrowsing/src/layer.h>
#include <modules/globebrowsing/src/layergroup.h>
#include <modules/globebrowsing/src/renderableglobe.h>
#include <modules/globebrowsing/src/tileprovider.h>
#include <modules/debugging/rendering/debugrenderer.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/globals.h>
#include <openspace/performance/performancemanager.h>
#include <openspace/performance/performancemeasurement.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/scene/scene.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/time.h>
#include <openspace/util/updatestructures.h>
@@ -518,8 +520,8 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f),
IntProperty(NActiveLayersInfo, 0, 0, OpenGLCap.maxTextureUnits() / 3)
})
, _shadowMappingPropertyOwner({ "ShadowMapping" })
, _debugPropertyOwner({ "Debug" })
, _shadowMappingPropertyOwner({ "ShadowMapping" })
, _grid(DefaultSkirtedGridSegments, DefaultSkirtedGridSegments)
, _leftRoot(Chunk(LeftHemisphereIndex))
, _rightRoot(Chunk(RightHemisphereIndex))
@@ -774,7 +776,6 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
if (distanceToCamera < distance) {
try {
// Before Shadows
//renderChunks(data, rendererTask);
_globeLabelsComponent.draw(data);
if (_hasShadows && _shadowComponent.isEnabled()) {
@@ -2058,25 +2059,45 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
lt
);
casterPos *= KM_TO_M; // converting to meters
// psc caster_pos = PowerScaledCoordinate::CreatePowerScaledCoordinate(
// casterPos.x,
// casterPos.y,
// casterPos.z
// );
const std::string source = shadowConf.source.first;
SceneGraphNode* sourceNode = global::renderEngine.scene()->sceneGraphNode(source);
const std::string caster = shadowConf.caster.first;
SceneGraphNode* casterNode = global::renderEngine.scene()->sceneGraphNode(caster);
const double sourceRadiusScale = std::max(
glm::compMax(sourceNode->scale()),
1.0
);
const double casterRadiusScale = std::max(
glm::compMax(casterNode->scale()),
1.0
);
if ((sourceNode == nullptr) || (casterNode == nullptr)) {
LERRORC(
"Renderableglobe",
"Invalid scenegraph node for the shadow's caster or shadow's receiver."
);
return;
}
// First we determine if the caster is shadowing the current planet (all
// calculations in World Coordinates):
const glm::dvec3 planetCasterVec = casterPos - data.modelTransform.translation;
const glm::dvec3 sourceCasterVec = casterPos - sourcePos;
const double sc_length = glm::length(sourceCasterVec);
const glm::dvec3 planetCaster_proj =
(glm::dot(planetCasterVec, sourceCasterVec) / (sc_length*sc_length)) *
sourceCasterVec;
const double d_test = glm::length(planetCasterVec - planetCaster_proj);
const double xp_test = shadowConf.caster.second * sc_length /
(shadowConf.source.second + shadowConf.caster.second);
const double rp_test = shadowConf.caster.second *
const double d_test = glm::length(planetCasterVec - planetCaster_proj);
const double xp_test = shadowConf.caster.second * casterRadiusScale *
sc_length / (shadowConf.source.second * sourceRadiusScale +
shadowConf.caster.second * casterRadiusScale);
const double rp_test = shadowConf.caster.second * casterRadiusScale *
(glm::length(planetCaster_proj) + xp_test) / xp_test;
const glm::dvec3 sunPos = SpiceManager::ref().targetPosition(
@@ -2099,13 +2120,13 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
(casterDistSun < planetDistSun))
{
// The current caster is shadowing the current planet
shadowData.isShadowing = true;
shadowData.rs = shadowConf.source.second;
shadowData.rc = shadowConf.caster.second;
shadowData.sourceCasterVec = glm::normalize(sourceCasterVec);
shadowData.xp = xp_test;
shadowData.xu = shadowData.rc * sc_length /
(shadowData.rs - shadowData.rc);
shadowData.isShadowing = true;
shadowData.rs = shadowConf.source.second * sourceRadiusScale;
shadowData.rc = shadowConf.caster.second * casterRadiusScale;
shadowData.sourceCasterVec = glm::normalize(sourceCasterVec);
shadowData.xp = xp_test;
shadowData.xu = shadowData.rc * sc_length /
(shadowData.rs - shadowData.rc);
shadowData.casterPositionVec = casterPos;
}
shadowDataArray.push_back(shadowData);
@@ -2115,15 +2136,16 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
unsigned int counter = 0;
for (const ShadowRenderingStruct& sd : shadowDataArray) {
constexpr const char* NameIsShadowing = "shadowDataArray[{}].isShadowing";
constexpr const char* NameXp = "shadowDataArray[{}].xp";
constexpr const char* NameXu = "shadowDataArray[{}].xu";
constexpr const char* NameRc = "shadowDataArray[{}].rc";
constexpr const char* NameSource = "shadowDataArray[{}].sourceCasterVec";
constexpr const char* NamePos = "shadowDataArray[{}].casterPositionVec";
constexpr const char* NameXp = "shadowDataArray[{}].xp";
constexpr const char* NameXu = "shadowDataArray[{}].xu";
constexpr const char* NameRc = "shadowDataArray[{}].rc";
constexpr const char* NameSource = "shadowDataArray[{}].sourceCasterVec";
constexpr const char* NamePos = "shadowDataArray[{}].casterPositionVec";
programObject.setUniform(
fmt::format(NameIsShadowing, counter), sd.isShadowing
);
if (sd.isShadowing) {
programObject.setUniform(fmt::format(NameXp, counter), sd.xp);
programObject.setUniform(fmt::format(NameXu, counter), sd.xu);

View File

@@ -190,16 +190,13 @@ GUI::GUI()
GUI::~GUI() {} // NOLINT
void GUI::initialize() {
}
void GUI::initialize() {}
void GUI::deinitialize() {
ImGui::Shutdown();
int nWindows = global::windowDelegate.nWindows();
for (int i = 0; i < nWindows; ++i) {
ImGui::DestroyContext(_contexts[i]);
for (ImGuiContext* ctx : _contexts) {
ImGui::DestroyContext(ctx);
}
for (GuiComponent* comp : _components) {

View File

@@ -50,6 +50,14 @@ namespace {
constexpr const char* KeyFile = "Path";
constexpr const char* KeyLineNum = "LineNumber";
// Fragile! Keep in sync with documentation
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinModeConversion = {
{ "Background", openspace::Renderable::RenderBin::Background },
{ "Opaque", openspace::Renderable::RenderBin::Opaque },
{ "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent},
{ "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent}
};
constexpr const std::array<int, 36> LeapYears = {
1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996,
2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040,
@@ -152,6 +160,13 @@ namespace {
"Number of objects to render sequentially from StartRenderIdx"
};
constexpr openspace::properties::Property::PropertyInfo RenderBinModeInfo = {
"RenderBinMode",
"RenderBin Mode",
"Determines if the trails will be rendered after all other elements, including"
"atmospheres if needed."
};
// Count the number of full days since the beginning of 2000 to the beginning of
// the parameter 'year'
int countDays(int year) {
@@ -345,8 +360,8 @@ double RenderableOrbitalKepler::epochFromYMDdSubstring(const std::string& epochS
RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict)
: Renderable(dict)
, _path(PathInfo)
, _segmentQuality(SegmentQualityInfo, 2, 1, 10)
, _path(PathInfo)
, _upperLimit(UpperLimitInfo, 1000, 1, 1000000)
, _startRenderIdx(StartRenderIdxInfo, 0, 0, 1)
, _sizeRender(RenderSizeInfo, 1, 1, 2)
@@ -400,7 +415,14 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict)
_startRenderIdxCallbackHandle = _startRenderIdx.onChange(_updateStartRenderIdxSelect);
_sizeRenderCallbackHandle = _sizeRender.onChange(_updateRenderSizeSelect);
setRenderBin(Renderable::RenderBin::Overlay);
if (dict.hasKeyAndValue<std::string>(RenderBinModeInfo.identifier)) {
openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at(
dict.value<std::string>(RenderBinModeInfo.identifier)
);
setRenderBin(cfgRenderBin);
} else {
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
}
}
void RenderableOrbitalKepler::initializeGL() {

View File

@@ -45,7 +45,7 @@ SGCTConfig = sgct.config.single{}
-- Sets the scene that is to be loaded by OpenSpace. A scene file is a description
-- of all entities that will be visible during an instance of OpenSpace
Asset = "default"
-- Asset = "default"
-- Asset = "asteroids"
-- Asset = "default_full"
-- Asset = "newhorizons"
@@ -65,7 +65,22 @@ Asset = "default"
-- Sets the profile that should be loaded by OpenSpace. Profiles are going to replace
-- assets in a future versions and shouldn't be used at the same time as the 'Asset'
-- setting above
-- Profile = "default"
-- Profile = "apollo_sites"
-- Profile = "apollo8"
-- Profile = "asteroids"
-- Profile = "dawn"
Profile = "default"
-- Profile = "default_full"
-- Profile = "gaia"
-- Profile = "insight"
-- Profile = "juno"
-- Profile = "mars"
-- Profile = "messenger"
-- Profile = "newhorizons"
-- Profile = "osirisrex"
-- Profile = "rosetta"
-- Profile = "touch"
-- Profile = "voyager"
-- These scripts are executed after the initialization of each scene, thus making
-- it possible to have global overrides to default values or execute other scripts
@@ -77,6 +92,7 @@ GlobalCustomizationScripts = {
Paths = {
DATA = "${BASE}/data",
ASSETS = "${DATA}/assets",
PROFILES = "${DATA}/profiles",
FONTS = "${DATA}/fonts",
TASKS = "${DATA}/tasks",
SYNC = "${BASE}/sync",

View File

@@ -1,473 +0,0 @@
version = ''
modulesTable = {}
assetsTable = {}
propertiesTable = {}
timeTable = {}
cameraTable = {}
markNodesTable = {}
keybindingsTable = {}
resultTable = {}
insideSection = false
currFunction = 'None'
currSection = 'None'
numLinesVersion = 0
lineIndex = 1
function printError(message)
print('Error @ line ' .. lineIndex .. ': ' .. message)
end
function splitByTab(inputstr)
sep = "\t"
t = {}
for match in (inputstr .. sep):gmatch('(.-)' .. sep) do
table.insert(t, match)
end
return t;
end
function parseVersion(line)
numLinesVersion = numLinesVersion + 1
if numLinesVersion > 1 then
printError('Too many lines in Version section')
os.exit()
else
lineS = splitByTab(line)
if tableLen(lineS) > 1 then
printError('No tabs allowed in version entry')
os.exit()
else
version = line
end
end
end
function parseMarkNodes(line)
lineS = splitByTab(line)
if tableLen(lineS) > 1 then
printError('No tabs allowed in MarkNodes entry')
os.exit()
else
table.insert(markNodesTable, line)
end
end
function parseModule(line)
t = {}
t = splitByTab(line)
if tableLen(t) ~= 3 then
printError('3 fields requried in a Module entry')
os.exit()
else
table.insert(modulesTable, t)
end
end
function parseAsset(line)
t = {}
t = splitByTab(line)
if tableLen(t) ~= 2 then
printError('2 fields required in a Asset entry')
os.exit()
else
local req = 'required'
if t[2] == 'requested' then
req = 'requested'
end
table.insert(assetsTable, {t[1], req})
end
end
function parseProperty(line)
t = {}
t = splitByTab(line)
if tableLen(t) ~= 3 then
printError('3 fields required in a Property entry')
os.exit()
elseif isBlank(t[1]) then
printError('Property set command (arg 1/3) is required')
os.exit()
elseif isBlank(t[2]) then
printError('Property name (arg 2/3) is required')
os.exit()
elseif isBlank(t[3]) then
printError('Property value to set (arg 3/3) is required')
os.exit()
end
if t[1] ~= 'setPropertyValue' and t[1] ~= 'setPropertyValueSingle' then
printError('Property set command "' .. t[1] .. '" is not supported')
os.exit()
end
table.insert(propertiesTable, t)
end
function parseKeybinding(line)
local numReqFields = 6
t = {}
t = splitByTab(line)
if tableLen(t) < numReqFields then
printError(numReqFields .. ' fields required in a Keybinding entry')
os.exit()
elseif isBlank(t[1]) then
printError('Keybinding key (arg 1/6) is required')
os.exit()
elseif isBlank(t[2]) then
printError('Keybinding documentation (arg 2/6) is required')
os.exit()
elseif isBlank(t[3]) then
printError('Keybinding name (arg 3/6) is required')
os.exit()
elseif isBlank(t[4]) then
printError('Keybinding GuiPath (arg 4/6) is required')
os.exit()
elseif isBlank(t[5]) then
printError('Keybinding local(T/F) (arg 5/6) is required')
os.exit()
elseif isBlank(t[6]) then
printError('Keybinding script to execute (arg 6/6) is required')
os.exit()
end
--If there are more than 6 fields then combine the final fields together
--assuming that this is a lua script that contains tabs
if tableLen(t) > numReqFields then
for i=(numReqFields + 1),tableLen(t) do
t[numReqFields] = t[numReqFields]..t[i]
end
end
if t[5] ~= 'true' and t[5] ~= 'false' then
printError('Keybinding local arg must be true or false')
os.exit()
end
table.insert(keybindingsTable, { t[1], t[2], t[3], t[4], t[5], t[6] })
end
function parseTime(line)
t = {}
t = splitByTab(line)
if tableLen(t) ~= 2 then
printError('2 fields required in a Time entry')
os.exit()
elseif isBlank(t[1]) then
printError('Time set type (arg 1/2) is required')
os.exit()
elseif isBlank(t[2]) then
printError('Time value to set (arg 2/2) is required')
os.exit()
end
if t[1] ~= 'absolute' and t[1] ~= 'relative' then
printError('Time set type "' .. t[1] .. '" is not supported')
os.exit()
end
table.insert(timeTable, t)
end
function parseCamera(line)
t = {}
t = splitByTab(line)
local cmd = t[1]
if cmd == 'setNavigationState' then
if tableLen(t) ~= 8 then
printError('8 fields required in camera "setNavigationState" line')
os.exit()
elseif isBlank(t[2]) then
printError('Camera setNavigationState Anchor (arg 1/7) is required')
os.exit()
elseif isBlank(t[5]) then
printError('Camera setNavigationState position vector (arg 4/7) is required')
os.exit()
end
elseif cmd == 'goToGeo' then
if tableLen(t) ~= 5 then
printError('5 fields required in camera "goToGeo" line')
os.exit()
elseif isBlank(t[3]) then
printError('Camera goToGeo Latitude (arg 2/4) is required')
os.exit()
elseif isBlank(t[4]) then
printError('Camera goToGeo Longitude (arg 3/4) is required')
os.exit()
end
else
printError('Camera position command "' .. cmd .. '" is not supported')
os.exit()
end
table.insert(cameraTable, t)
end
function file_exists(file)
local f = io.open(file, 'rb')
if f then
f:close()
end
return f ~= nil
end
function lines_from(file)
if not file_exists(file) then
return {}
end
lines = {}
for line in io.lines(file) do
lines[#lines + 1] = line
end
return lines
end
function determineSection(header)
header = header:sub(2)
for _,i in pairs(parsingSections) do
if i.section == header then
currSection = i.section
currFunction = i.func
return true
end
end
return false
end
function isBlank(line)
return line:match('%S') == nil
end
function parseCurrentSection(line)
currFunction(line)
end
function tableLen(T)
local size = 0
for _ in pairs(T) do
size = size + 1
end
return size
end
function parseProfile(fileIn)
local lines = lines_from(fileIn)
for k,v in pairs(lines) do
if insideSection then
if isBlank(v) then
insideSection = false
else
parseCurrentSection(v)
end
elseif v:sub(1, 1) == '#' then
if determineSection(v) then
insideSection = true
end
end
lineIndex = lineIndex + 1
end
resultTable['Version'] = version
resultTable['Module'] = modulesTable
resultTable['Asset'] = assetsTable
resultTable['Property'] = propertiesTable
resultTable['Time'] = timeTable
resultTable['Camera'] = cameraTable
resultTable['MarkNodes'] = markNodesTable
resultTable['Keybinding'] = keybindingsTable
return resultTable
end
function tableSize(T)
local size = 0
for _ in pairs(T) do
size = size + 1
end
return size
end
function generateAsset(T, fileOut)
file = io.open(fileOut, 'w')
io.output(file)
--Module section
for i,j in pairs(T['Module']) do
if not isBlank(j[2]) and not isBlank(j[3]) then
ModuleStr = ModuleStr .. 'if openspace.modules.isLoaded("' .. j[1] .. '") then\n'
ModuleStr = ModuleStr .. ' ' .. j[2] .. '\nelse\n' .. ' ' .. j[3] .. '\nend\n'
elseif not isBlank(j[3]) then
ModuleStr = ModuleStr .. 'if not openspace.modules.isLoaded("' .. j[1] .. '") then\n'
ModuleStr = ModuleStr .. ' ' .. j[3] .. '\nend\n'
elseif not isBlank(j[2]) then
ModuleStr = ModuleStr .. 'if openspace.modules.isLoaded("' .. j[1] .. '") then\n'
ModuleStr = ModuleStr .. ' ' .. j[2] .. '\nend\n'
end
end
--Asset section
AssetStr = AssetStr .. 'asset.require("base");\n'
AssetStr = AssetStr .. 'local assetHelper = asset.require("util/asset_helper")\n'
AssetStr = AssetStr .. 'local propertyHelper = asset.require("util/property_helper")\n'
AssetStr = AssetStr .. 'local sceneHelper = asset.require("util/scene_helper")\n'
AssetStr = AssetStr .. 'local renderableHelper = asset.require("util/renderable_helper")\n'
local assetType = ''
for i,j in pairs(T['Asset']) do
if isBlank(j[2]) then
assetType = 'require'
else
if (j[2] == 'required') then
assetType = 'require'
elseif (j[2] == 'requested') then
assetType = 'request'
else
printError('Asset arg 2/2 must be either "required" or "requested"')
os.exit()
end
end
AssetStr = AssetStr .. 'asset.' .. assetType .. '("' .. j[1] .. '")\n'
end
--Keybindings section
if not (tableSize(T['Keybinding']) == 0) then
KeyStr = KeyStr .. 'local Keybindings = {\n'
for i,j in pairs(T['Keybinding']) do
KeyStr = KeyStr..' {\n'
KeyStr = KeyStr..' Key = "' .. j[1] .. '",\n'
KeyStr = KeyStr..' Documentation = "' .. j[2] .. '",\n'
KeyStr = KeyStr..' Name = "' .. j[3] .. '",\n'
KeyStr = KeyStr..' GuiPath = "' .. j[4] .. '",\n'
KeyStr = KeyStr..' Local = ' .. j[5] .. ',\n'
KeyStr = KeyStr..' Command = ' .. j[6] .. '\n'
KeyStr = KeyStr..' },\n'
end
KeyStr = KeyStr.."}\n"
end
--Time section
for i,j in pairs(T['Time']) do
if not (j[1] == 'absolute') and not (j[1] == 'relative') then
printError('Time arg 1/1 must be either "absolute" or "relative"')
os.exit()
elseif (j[1] == 'absolute') then
TimeStr = TimeStr .. ' openspace.time.setTime("' .. j[2] .. '")\n'
elseif (j[1] == 'relative') then
TimeStr = TimeStr .. ' local now = openspace.time.currentWallTime();'
TimeStr = TimeStr .. ' openspace.time.setTime('
TimeStr = TimeStr .. 'openspace.time.advancedTime(now, "' .. j[2] .. '"))\n'
end
end
--MarkNodes section
mkNodLen = tableSize(T['MarkNodes'])
if not (mkNodLen == 0) then
MarkNodesStr = MarkNodesStr .. ' openspace.markInterestingNodes({'
for i, j in pairs(T['MarkNodes']) do
MarkNodesStr = MarkNodesStr .. '"' .. j .. '"'
if (i < mkNodLen) then
MarkNodesStr = MarkNodesStr .. ', '
end
end
MarkNodesStr = MarkNodesStr .. '})\n'
end
--Property section
for i, j in pairs(T['Property']) do
if not (j[1] == 'setPropertyValue') and not (j[1] == 'setPropertyValueSingle') then
printError('Property arg 1/1 must be "setPropertyValue[Single]"')
os.exit()
else
PropertyStr = PropertyStr .. ' openspace.' .. j[1] .. '("' .. j[2] .. '", ' .. j[3] .. ')\n'
end
end
--Camera section
for i,j in pairs(T['Camera']) do
if (j[1] == 'setNavigationState') then
CameraStr = CameraStr .. ' openspace.navigation.setNavigationState({'
CameraStr = CameraStr .. 'Anchor = ' .. j[2] .. ', '
if not isBlank(j[3]) then
CameraStr = CameraStr .. 'Aim = ' .. j[3] .. ', '
end
if not isBlank(j[4]) then
CameraStr = CameraStr .. 'ReferenceFrame = ' .. j[4] .. ', '
end
CameraStr = CameraStr .. 'Position = {' .. j[5] .. '}, '
if not isBlank(j[6]) then
CameraStr = CameraStr .. 'Up = {' .. j[6] .. '}, '
end
if not isBlank(j[7]) then
CameraStr = CameraStr .. 'Yaw = ' .. j[7] .. ', '
end
if not isBlank(j[8]) then
CameraStr = CameraStr .. 'Pitch = ' .. j[8]
end
CameraStr = CameraStr .. '})\n'
elseif (j[1] == 'goToGeo') then
CameraStr = CameraStr .. ' openspace.globebrowsing.goToGeo('
if not isBlank(j[2]) then
CameraStr = CameraStr .. j[2] .. ', '
end
CameraStr = CameraStr .. j[3] .. ', ' .. j[4]
if not isBlank(j[5]) then
CameraStr = CameraStr .. ', ' .. j[5]
end
CameraStr = CameraStr .. ')\n'
else
printError('Camera arg 1/1 must be "setNavigationState" or "goToGeo"')
os.exit()
end
end
--Write the file
io.write(ModuleStr .. '\n')
io.write(AssetStr .. '\n')
io.write(KeyStr .. '\n')
io.write('asset.onInitialize(function ()\n')
io.write(TimeStr .. '\n')
if not (tableSize(T['Keybinding']) == 0) then
io.write(' sceneHelper.bindKeys(Keybindings)\n')
end
io.write(MarkNodesStr .. '\n')
io.write(PropertyStr .. '\n')
io.write(CameraStr .. '\n')
io.write('end)\n')
io.close(file)
end
--[[
##########################################################################################
M a i n
##########################################################################################
]]--
ModuleStr = ''
AssetStr = ''
KeyStr = ''
TimeStr = ''
MarkNodesStr = ''
PropertyStr = ''
CameraStr = ''
parsingSections = {
{ section = 'Version', func = parseVersion },
{ section = 'Module', func = parseModule },
{ section = 'Asset', func = parseAsset },
{ section = 'Property', func = parseProperty },
{ section = 'Keybinding', func = parseKeybinding },
{ section = 'Time', func = parseTime },
{ section = 'Camera', func = parseCamera },
{ section = 'MarkNodes', func = parseMarkNodes }
}
profilePathIn = openspace.profile.getProfileInputPath()
scenePathOut = openspace.profile.getSceneOutputPath()
profileIn = profilePathIn .. '.profile'
assetOut = scenePathOut .. '.scene'
local resultTable = parseProfile(profileIn)
generateAsset(resultTable, assetOut)

View File

@@ -152,6 +152,8 @@ set(OPENSPACE_SOURCE
${OPENSPACE_BASE_DIR}/src/scene/assetmanager.cpp
${OPENSPACE_BASE_DIR}/src/scene/assetmanager_lua.inl
${OPENSPACE_BASE_DIR}/src/scene/lightsource.cpp
${OPENSPACE_BASE_DIR}/src/scene/profile.cpp
${OPENSPACE_BASE_DIR}/src/scene/profile_lua.inl
${OPENSPACE_BASE_DIR}/src/scene/rotation.cpp
${OPENSPACE_BASE_DIR}/src/scene/scale.cpp
${OPENSPACE_BASE_DIR}/src/scene/scene.cpp
@@ -341,6 +343,7 @@ set(OPENSPACE_HEADER
${OPENSPACE_BASE_DIR}/include/openspace/scene/assetloader.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/assetmanager.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/lightsource.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/profile.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/rotation.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/scale.h
${OPENSPACE_BASE_DIR}/include/openspace/scene/scene.h

View File

@@ -40,6 +40,7 @@
#include <openspace/rendering/renderengine.h>
#include <openspace/rendering/screenspacerenderable.h>
#include <openspace/scene/lightsource.h>
#include <openspace/scene/profile.h>
#include <openspace/scene/rotation.h>
#include <openspace/scene/scene.h>
#include <openspace/scene/scenegraphnode.h>
@@ -83,6 +84,7 @@ void registerCoreClasses(scripting::ScriptEngine& engine) {
engine.addLibrary(ParallelPeer::luaLibrary());
engine.addLibrary(RenderEngine::luaLibrary());
engine.addLibrary(SpiceManager::luaLibrary());
engine.addLibrary(Profile::luaLibrary());
engine.addLibrary(Scene::luaLibrary());
engine.addLibrary(Time::luaLibrary());
engine.addLibrary(interaction::KeybindingManager::luaLibrary());

View File

@@ -48,6 +48,7 @@
#include <openspace/rendering/raycastermanager.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/rendering/screenspacerenderable.h>
#include <openspace/scene/profile.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/scripting/scriptscheduler.h>
#include <openspace/util/versionchecker.h>
@@ -182,7 +183,6 @@ interaction::SessionRecording& gSessionRecording() {
return g;
}
interaction::ShortcutManager& gShortcutManager() {
static interaction::ShortcutManager g;
return g;
@@ -213,6 +213,11 @@ scripting::ScriptScheduler& gScriptScheduler() {
return g;
}
Profile& gProfile() {
static Profile g;
return g;
}
} // namespace detail
void initialize() {

View File

@@ -51,6 +51,7 @@
#include <openspace/rendering/renderable.h>
#include <openspace/scene/assetmanager.h>
#include <openspace/scene/assetloader.h>
#include <openspace/scene/profile.h>
#include <openspace/scene/scene.h>
#include <openspace/scene/rotation.h>
#include <openspace/scene/scale.h>
@@ -99,8 +100,6 @@
namespace {
constexpr const char* _loggerCat = "OpenSpaceEngine";
constexpr const int CacheVersion = 1;
constexpr const char* ProfileToSceneConverter
= "${BASE}/scripts/convert_profile_to_scene.lua";
} // namespace
@@ -300,44 +299,51 @@ void OpenSpaceEngine::initialize() {
// Convert profile to scene file (if was provided in configuration file)
if (!global::configuration.profile.empty()) {
LINFO(
fmt::format("Run Lua script to convert {}.profile to scene",
global::configuration.profile)
);
ghoul::lua::LuaState lState;
std::string inputProfilePath = absPath("${PROFILES}");
std::string outputScenePath = absPath("${TEMPORARY}");
std::string inputProfile = inputProfilePath + "/" + global::configuration.profile
+ ".profile";
std::string outputAsset = outputScenePath + "/" + global::configuration.profile
+ ".asset";
// We can't use the absPath function here because we pass the path into the Lua
// function, which requires additional escaping
std::string inputProfilePath = generateFilePath("${ASSETS}");
std::string outputScenePath = generateFilePath("${TEMPORARY}");
if (!FileSys.fileExists(inputProfile)) {
LERROR(fmt::format(
"Could not load profile '{}': File does not exist", inputProfile)
);
}
else {
// Load the profile
std::ifstream inFile;
try {
inFile.open(inputProfile, std::ifstream::in);
}
catch (const std::ifstream::failure& e) {
throw ghoul::RuntimeError(fmt::format(
"Exception opening profile file for read: {} ({})",
inputProfile, e.what())
);
}
std::string setProfileFilenameInLuaState = fmt::format(R"(
openspace = {{}}
openspace.profile = {{}}
function openspace.profile.getFilename()
return "{}.profile"
end
function openspace.profile.getProfileInputPath()
return "{}"
end
function openspace.profile.getSceneOutputPath()
return "{}"
end
)",
global::configuration.profile,
inputProfilePath,
outputScenePath
);
std::vector<std::string> content;
std::string line;
while (std::getline(inFile, line)) {
content.push_back(std::move(line));
}
ghoul::lua::runScript(lState, setProfileFilenameInLuaState);
ghoul::lua::runScriptFile(lState, absPath(ProfileToSceneConverter));
global::profile = Profile(content);
// Then save the profile to a scene so that we can load it with the
// existing infrastructure
std::ofstream scene(outputAsset);
std::string sceneContent = global::profile.convertToScene();
scene << sceneContent;
// Set asset name to that of the profile because a new scene file will be
// created with that name, and also because the profile name will override
// an asset name if both are provided.
global::configuration.asset =
absPath("${TEMPORARY}/") + global::configuration.profile;
// Set asset name to that of the profile because a new scene file will be
// created with that name, and also because the profile name will override
// an asset name if both are provided.
global::configuration.asset = outputAsset;
global::configuration.usingProfile = true;
}
}
// Set up asset loader
@@ -1067,7 +1073,10 @@ void OpenSpaceEngine::preSynchronization() {
if (_hasScheduledAssetLoading) {
LINFO(fmt::format("Loading asset: {}", _scheduledAssetPathToLoad));
global::profile.setIgnoreUpdates(true);
loadSingleAsset(_scheduledAssetPathToLoad);
global::profile.setIgnoreUpdates(false);
resetPropertyChangeFlagsOfSubowners(&global::rootPropertyOwner);
_hasScheduledAssetLoading = false;
_scheduledAssetPathToLoad.clear();
}
@@ -1250,6 +1259,8 @@ void OpenSpaceEngine::drawOverlays() {
if (isGuiWindow) {
global::renderEngine.renderOverlays(_shutdown);
global::luaConsole.render();
global::sessionRecording.render();
}
for (const std::function<void()>& func : global::callback::draw2D) {
@@ -1283,12 +1294,32 @@ void OpenSpaceEngine::postDraw() {
if (_isFirstRenderingFirstFrame) {
global::windowDelegate.setSynchronization(true);
resetPropertyChangeFlags();
_isFirstRenderingFirstFrame = false;
}
LTRACE("OpenSpaceEngine::postDraw(end)");
}
void OpenSpaceEngine::resetPropertyChangeFlags() {
ZoneScoped
std::vector<SceneGraphNode*> nodes =
global::renderEngine.scene()->allSceneGraphNodes();
for (SceneGraphNode* n : nodes) {
resetPropertyChangeFlagsOfSubowners(n);
}
}
void OpenSpaceEngine::resetPropertyChangeFlagsOfSubowners(properties::PropertyOwner* po) {
for (properties::PropertyOwner* subOwner : po->propertySubOwners()) {
resetPropertyChangeFlagsOfSubowners(subOwner);
}
for (properties::Property* p : po->properties()) {
p->resetToUnchanged();
}
}
void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction action) {
ZoneScoped

View File

@@ -39,6 +39,8 @@
#include <openspace/util/timemanager.h>
#include <ghoul/filesystem/file.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/profiling.h>
#include <iomanip>
@@ -46,6 +48,13 @@
namespace {
constexpr const char* _loggerCat = "SessionRecording";
constexpr openspace::properties::Property::PropertyInfo RenderPlaybackInfo = {
"RenderInfo",
"Render Playback Information",
"If enabled, information about a currently played back session "
"recording is rendering to screen"
};
constexpr const bool UsingTimeKeyframes = false;
const std::string FileHeaderTitle = "OpenSpace_record/playback";
constexpr const size_t FileHeaderVersionLength = 5;
@@ -101,7 +110,10 @@ namespace openspace::interaction {
SessionRecording::SessionRecording()
: properties::PropertyOwner({ "SessionRecording", "Session Recording" })
{}
, _renderPlaybackInformation(RenderPlaybackInfo, false)
{
addProperty(_renderPlaybackInformation);
}
SessionRecording::~SessionRecording() {} // NOLINT
@@ -615,6 +627,28 @@ void SessionRecording::preSynchronization() {
_lastState = _state;
}
void SessionRecording::render() {
ZoneScoped
if (!(_renderPlaybackInformation && isPlayingBack())) {
return;
}
constexpr const char* FontName = "Mono";
constexpr const float FontSizeFrameinfo = 32.f;
std::shared_ptr<ghoul::fontrendering::Font> font =
global::fontManager.font(FontName, FontSizeFrameinfo);
glm::vec2 res = global::renderEngine.fontResolution();
glm::vec2 penPosition = glm::vec2(
res.x / 2 - 150.f,
res.y / 4
);
std::string text = std::to_string(currentTime());
ghoul::fontrendering::RenderFont(*font, penPosition, text, glm::vec4(1.f));
}
bool SessionRecording::isRecording() const {
return (_state == SessionState::Recording);
}

View File

@@ -312,6 +312,14 @@ void Property::notifyDeleteListeners() {
}
}
bool Property::hasChanged() const {
return _isValueDirty;
}
void Property::resetToUnchanged() {
_isValueDirty = false;
}
std::string Property::generateBaseJsonDescription() const {
std::string cName = className();
std::string cNameSan = sanitizeString(cName);

View File

@@ -585,7 +585,8 @@ void ABufferRenderer::render(Scene* scene, Camera* camera, float blackoutFactor)
// Render the scene to the fragment buffer. Collect renderer tasks (active raycasters)
int renderBinMask = static_cast<int>(Renderable::RenderBin::Background) |
static_cast<int>(Renderable::RenderBin::Opaque) |
static_cast<int>(Renderable::RenderBin::Transparent) |
static_cast<int>(Renderable::RenderBin::PreDeferredTransparent) |
static_cast<int>(Renderable::RenderBin::PostDeferredTransparent) |
static_cast<int>(Renderable::RenderBin::Overlay);
Time time = global::timeManager.time();

View File

@@ -1226,8 +1226,8 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
}
{
GLDebugGroup group("Transparent");
data.renderBinMask = static_cast<int>(Renderable::RenderBin::Transparent);
GLDebugGroup group("PreDeferredTransparent");
data.renderBinMask = static_cast<int>(Renderable::RenderBin::PreDeferredTransparent);
scene->render(data, tasks);
}
@@ -1265,10 +1265,16 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
}
performDeferredTasks(tasks.deferredcasterTasks);
}
glDrawBuffers(1, &ColorAttachment01Array[_pingPongIndex]);
glEnablei(GL_BLEND, 0);
{
GLDebugGroup group("PostDeferredTransparent");
data.renderBinMask = static_cast<int>(Renderable::RenderBin::PostDeferredTransparent);
scene->render(data, tasks);
}
{
GLDebugGroup group("Overlay");
data.renderBinMask = static_cast<int>(Renderable::RenderBin::Overlay);

View File

@@ -235,21 +235,25 @@ void Renderable::onEnabledChange(std::function<void(bool)> callback) {
}
void Renderable::setRenderBinFromOpacity() {
if (_opacity > 0.f && _opacity < 1.f) {
setRenderBin(Renderable::RenderBin::Transparent);
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
if (_renderBin != Renderable::RenderBin::PostDeferredTransparent) {
if (_opacity >= 0.f && _opacity < 1.f) {
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
}
void Renderable::registerUpdateRenderBinFromOpacity() {
_opacity.onChange([this](){
if (_opacity > 0.f && _opacity < 1.f) {
setRenderBin(Renderable::RenderBin::Transparent);
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
if (_renderBin != Renderable::RenderBin::PostDeferredTransparent) {
if (_opacity >= 0.f && _opacity < 1.f) {
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
});
}

View File

@@ -24,7 +24,9 @@
#include <openspace/scene/assetmanager.h>
#include <openspace/engine/globals.h>
#include <openspace/scene/assetloader.h>
#include <openspace/scene/profile.h>
#include <openspace/scripting/lualibrary.h>
#include <openspace/util/synchronizationwatcher.h>
#include <ghoul/filesystem/file.h>
@@ -60,6 +62,7 @@ bool AssetManager::update() {
const bool add = c.second;
if (add) {
_assetLoader.add(path);
global::profile.addAsset(path);
}
}
// Remove assets
@@ -68,6 +71,7 @@ bool AssetManager::update() {
const bool remove = !c.second;
if (remove && _assetLoader.has(path)) {
_assetLoader.remove(path);
global::profile.removeAsset(path);
}
}
_pendingStateChangeCommands.clear();

1075
src/scene/profile.cpp Normal file

File diff suppressed because it is too large Load Diff

145
src/scene/profile_lua.inl Normal file
View File

@@ -0,0 +1,145 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/engine/configuration.h>
#include <openspace/engine/globals.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/util/timemanager.h>
#include <ghoul/filesystem/file.h>
#include <ghoul/filesystem/filesystem.h>
#include <ctime>
#include <filesystem>
namespace openspace::luascriptfunctions {
int saveSettingsToProfile(lua_State* L) {
if (!global::configuration.usingProfile) {
return luaL_error(
L,
"Program was not started with a profile, so cannot use this "
"save-current-settings feature"
);
}
const int n = ghoul::lua::checkArgumentsAndThrow(
L,
{ 0, 2 },
"lua::saveSettingsToProfile"
);
std::string saveFilePath;
if (n == 0) {
const ghoul::filesystem::File f = global::configuration.profile;
std::time_t t = std::time(nullptr);
std::tm* utcTime = std::gmtime(&t);
ghoul_assert(utcTime, "Conversion to UTC failed");
std::string time = fmt::format(
"{:04d}-{:02d}-{:02d}T{:02d}_{:02d}_{:02d}",
utcTime->tm_year + 1900,
utcTime->tm_mon + 1,
utcTime->tm_mday,
utcTime->tm_hour,
utcTime->tm_min,
utcTime->tm_sec
);
std::string newFile = fmt::format(
"{}_{}.{}",
f.fullBaseName(), time, f.fileExtension()
);
std::filesystem::copy(global::configuration.profile, newFile);
saveFilePath = global::configuration.profile;
}
else {
saveFilePath = ghoul::lua::value<std::string>(L, 1);
if (saveFilePath.empty()) {
return luaL_error(L, "save filepath string is empty");
}
}
const properties::PropertyOwner& root = global::rootPropertyOwner;
std::string currentTime = global::timeManager.time().ISO8601();
interaction::NavigationHandler::NavigationState navState =
global::navigationHandler.navigationState();
global::profile.saveCurrentSettingsToProfile(root, currentTime, navState);
global::configuration.profile = saveFilePath;
if (saveFilePath.find('/') != std::string::npos) {
return luaL_error(L, "Profile filename must not contain path (/) elements");
}
else if (saveFilePath.find(':') != std::string::npos) {
return luaL_error(L, "Profile filename must not contain path (:) elements");
}
else if (saveFilePath.find('.') != std::string::npos) {
return luaL_error(L, "Only provide the filename to save without file extension");
}
const std::string absFilename = absPath("${PROFILES}/" + saveFilePath + ".profile");
const bool overwrite = (n == 2) ? ghoul::lua::value<bool>(L, 2) : false;
if (FileSys.fileExists(absFilename) && !overwrite) {
return luaL_error(
L,
fmt::format(
"Unable to save profile '{}'. File of same name already exists.",
absFilename.c_str()
).c_str()
);
}
std::ofstream outFile;
// @TODO (abock, 2020-06-15) Replace with non-throwing stream
try {
outFile.open(absFilename, std::ofstream::out);
}
catch (const std::ofstream::failure& e) {
return luaL_error(
L,
fmt::format(
"Exception opening profile file for write: {} ({})", absFilename, e.what()
).c_str()
);
}
try {
outFile << global::profile.serialize();
}
catch (const std::ofstream::failure& e) {
return luaL_error(
L,
fmt::format(
"Data write error to file: {} ({})",
absFilename, e.what()
).c_str()
);
}
outFile.close();
lua_settop(L, 0);
return 0;
}
} // namespace openspace::luascriptfunctions

View File

@@ -57,9 +57,12 @@ namespace {
return "Opaque";
}
else if (renderBin == 4) {
return "Transparent";
return "PreDeferredTransparent";
}
else if (renderBin == 8) {
return "PostDeferredTransparent";
}
else if (renderBin == 16) {
return "Overlay";
}
else {
@@ -607,19 +610,19 @@ scripting::LuaLibrary Scene::luaLibrary() {
"to match the type that the property (or properties) expect. If the "
"third is not present or is '0', the value changes instantly, otherwise "
"the change will take that many seconds and the value is interpolated at "
"each steap in between. The fourth parameter is an optional easing "
"each step in between. The fourth parameter is an optional easing "
"function if a 'duration' has been specified. If 'duration' is 0, this "
"parameter value is ignored. Otherwise, it can be one of many supported "
"easing functions. See easing.h for available functions. The fifth "
"argument must be either empty, 'regex', or 'single'. If the last "
"argument must be either empty, 'regex', or 'single'. If the fifth"
"argument is empty (the default), the URI is interpreted using a "
"wildcard in which '*' is expanded to '(.*)' and bracketed components "
"'{ }' are interpreted as group tag names. Then, the passed value will "
"be set on all properties that fit the regex + group name combination. "
"If the third argument is 'regex' neither the '*' expansion, nor the "
"If the fifth argument is 'regex' neither the '*' expansion, nor the "
"group tag expansion is performed and the first argument is used as an "
"ECMAScript style regular expression that matches against the fully "
"qualified IDs of properties. If the third arugment is 'single' no "
"qualified IDs of properties. If the fifth argument is 'single' no "
"substitutions are performed and exactly 0 or 1 properties are changed."
},
{
@@ -631,7 +634,7 @@ scripting::LuaLibrary Scene::luaLibrary() {
"second argument can be any type, but it has to match the type that the "
"property expects. If the third is not present or is '0', the value "
"changes instantly, otherwise the change will take that many seconds and "
"the value is interpolated at each steap in between. The fourth "
"the value is interpolated at each step in between. The fourth "
"parameter is an optional easing function if a 'duration' has been "
"specified. If 'duration' is 0, this parameter value is ignored. "
"Otherwise, it has to be 'linear', 'easein', 'easeout', or 'easeinout'. "

View File

@@ -27,6 +27,7 @@
#include <ghoul/fmt.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/exception.h>
#include <ghoul/misc/misc.h>
#include <algorithm>
#include <vector>
@@ -82,11 +83,13 @@ KeyWithModifier stringToKey(std::string str) {
std::vector<std::string> tokens = ghoul::tokenizeString(str, '+');
// default is unknown
Key k = Key::Unknown;
const auto itKey = KeyMapping.find(tokens.back());
if (itKey != KeyMapping.end()) {
k = itKey->second;
if (itKey == KeyMapping.cend()) {
throw ghoul::RuntimeError(
fmt::format("Could not find key for '{}'", tokens.back())
);
}
Key k = itKey->second;
KeyModifier m = KeyModifier::NoModifier;
@@ -102,7 +105,7 @@ KeyWithModifier stringToKey(std::string str) {
);
}
else {
LERROR(fmt::format("Unknown modifier key '{}'", s));
throw ghoul::RuntimeError(fmt::format("Unknown modifier key '{}'", s));
}
}
);

View File

@@ -34,6 +34,7 @@ add_executable(
test_lrucache.cpp
test_luaconversions.cpp
test_optionproperty.cpp
test_profile.cpp
test_rawvolumeio.cpp
test_scriptscheduler.cpp
test_spicemanager.cpp
@@ -47,7 +48,7 @@ add_executable(
set_openspace_compile_settings(OpenSpaceTest)
target_include_directories(OpenSpaceTest PUBLIC
"${GHOUL_BASE_DIR}/ext/catch2/single_include"
"${GHOUL_BASE_DIR}/ext/catch2/single_include"
)
target_compile_definitions(OpenSpaceTest PUBLIC "GHL_THROW_ON_ASSERT")
target_link_libraries(OpenSpaceTest openspace-core)

View File

@@ -0,0 +1,7 @@
#Version
12.13
#AdditionalScripts
script-1
script-2
script-3

Some files were not shown because too many files have changed in this diff Show More