diff --git a/CMakeLists.txt b/CMakeLists.txt index 96ab1ca6c9..c3e35daafc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,9 +134,19 @@ endif () option(OPENSPACE_WITH_ABUFFER_RENDERER "Compile ABuffer Renderer" OFF) -if (UNIX AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi") +if (UNIX) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi") + else () + if(NOT CMAKE_BUILD_TYPE) + #Can set to "RelWithDebInfo" or "Debug" also, but problems occur if this is blank by default + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build type" FORCE) + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLM_ENABLE_EXPERIMENTAL" CACHE STRING "" FORCE) + set(OpenGL_GL_PREFERENCE "GLVND" CACHE STRING "OpenGL Preference setting necessary for linux" FORCE) + set(ASSIMP_BUILD_MINIZIP ON CACHE BOOL "Set to have assimp build minizip" FORCE) + endif () endif () add_subdirectory(ext) diff --git a/Jenkinsfile b/Jenkinsfile index 4c98d8f77f..c29f718631 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,7 +107,8 @@ linux_gcc_make: { } stage('linux-gcc-make/build') { def cmakeCompileOptions = moduleCMakeFlags(); - cmakeCompileOptions += ' -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS:STRING="-DGLM_ENABLE_EXPERIMENTAL" -DOpenGL_GL_PREFERENCE:STRING=GLVND'; + cmakeCompileOptions += ' -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS:STRING="-DGLM_ENABLE_EXPERIMENTAL"'; + cmakeCompileOptions += ' -DOpenGL_GL_PREFERENCE:STRING=GLVND -DASSIMP_BUILD_MINIZIP=1'; // Not sure why the linking of OpenSpaceTest takes so long compileHelper.build(compileHelper.Make(), compileHelper.Gcc(), cmakeCompileOptions, 'OpenSpace', 'build-make'); compileHelper.recordCompileIssues(compileHelper.Gcc()); diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index c651841a49..669fbc16a9 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit c651841a49c468f2371713f23e90561f0c080d52 +Subproject commit 669fbc16a9910b28333427f5e07235baa43ea7a6 diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index 76b37e0f5e..7e038fe34d 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -122,7 +122,13 @@ int main(int argc, char** argv) { ); std::string configFile = configuration::findConfiguration(); - *global::configuration = configuration::loadConfigurationFromFile(configFile); + + // Register the base path as the directory where the configuration file lives + std::string base = ghoul::filesystem::File(configFile).directoryName(); + constexpr const char* BasePathToken = "${BASE}"; + FileSys.registerPathToken(BasePathToken, base); + + *global::configuration = configuration::loadConfigurationFromFile(configFile, ""); openspace::global::openSpaceEngine->registerPathTokens(); global::openSpaceEngine->initialize(); @@ -131,7 +137,7 @@ int main(int argc, char** argv) { ghoul::cmdparser::CommandlineParser::AllowUnknownCommands::Yes ); - std::string tasksPath = ""; + std::string tasksPath; commandlineParser.addCommand( std::make_unique>( tasksPath, @@ -146,7 +152,7 @@ int main(int argc, char** argv) { //FileSys.setCurrentDirectory(launchDirectory); - if (tasksPath != "") { + if (!tasksPath.empty()) { performTasks(tasksPath); return 0; } diff --git a/config/gui_projector.xml b/config/gui_projector.xml index 21e9d09a9f..9ac213193b 100644 --- a/config/gui_projector.xml +++ b/config/gui_projector.xml @@ -4,7 +4,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/config/spherical_mirror.xml b/config/spherical_mirror.xml index fc98729758..f15de39d45 100644 --- a/config/spherical_mirror.xml +++ b/config/spherical_mirror.xml @@ -19,7 +19,7 @@ --> - + diff --git a/data/assets/examples/spheres.asset b/data/assets/examples/spheres.asset index 2510084d70..f19458eacd 100644 --- a/data/assets/examples/spheres.asset +++ b/data/assets/examples/spheres.asset @@ -18,7 +18,7 @@ for z=1,3 do Size = 0.20 + i * 0.01, Segments = 80, Opacity = 1, - Texture = "${DATA}/test2.jpg", + Texture = openspace.absPath("${DATA}/test2.jpg"), Orientation = "Both", }, GUI = { diff --git a/data/assets/scene/digitaluniverse/kepler.asset b/data/assets/scene/digitaluniverse/kepler.asset index 04fc503c77..1d5834487a 100644 --- a/data/assets/scene/digitaluniverse/kepler.asset +++ b/data/assets/scene/digitaluniverse/kepler.asset @@ -13,7 +13,7 @@ local speck = asset.syncedResource({ Name = "Kepler Speck Files", Type = "HttpSynchronization", Identifier = "digitaluniverse_kepler_speck", - Version = 2 + Version = 3 }) local object = { diff --git a/data/assets/scene/milkyway/constellations/constellation_art.asset b/data/assets/scene/milkyway/constellations/constellation_art.asset index c77fa2e29f..cc0db4c8d9 100644 --- a/data/assets/scene/milkyway/constellations/constellation_art.asset +++ b/data/assets/scene/milkyway/constellations/constellation_art.asset @@ -5,7 +5,7 @@ local images = asset.syncedResource({ Name = "Constellation Images", Type = "HttpSynchronization", Identifier = "constellation_images", - Version = 2 + Version = 3 }) --function that reads the file diff --git a/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset b/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset new file mode 100644 index 0000000000..35ea29873f --- /dev/null +++ b/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset @@ -0,0 +1,40 @@ +local scene_helper = asset.require('util/scene_helper') + +local Keybindings = { + + { + Key = "v", + Name = "Show Constellation Art", + Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0);" .. + "openspace.setPropertyValue('{zodiac}.Renderable.Enabled',true);" .. + "openspace.setPropertyValue('{zodiac}.Renderable.Opacity', 1, 2);", + Documentation = "Enables and fades up zodiac art work", + GuiPath = "/Rendering", + Local = false + }, + { + Key = "Shift+v", + Name = "Show Constellation Art", + Command = "openspace.setPropertyValue('{zodiac}.Renderable.Opacity', 0, 2);", + Documentation = "fades down zodiac art work", + GuiPath = "/Rendering", + Local = false + }, +} + +asset.onInitialize(function () + scene_helper.bindKeys(Keybindings) +end) + +asset.onDeinitialize(function () + scene_helper.unbindKeys(Keybindings) +end) + +asset.meta = { + Name = "Constellation Image Extra Keybinds", + Version = "1.0", + Description = "Artistic images depicting the constellations", + Author = "James Hedberg", + URL = "http://jameshedberg.com", + License = "CC-BY" +} diff --git a/data/assets/scene/milkyway/constellations/constellation_keybinds.asset b/data/assets/scene/milkyway/constellations/constellation_keybinds.asset index ac310f24a2..08765add84 100644 --- a/data/assets/scene/milkyway/constellations/constellation_keybinds.asset +++ b/data/assets/scene/milkyway/constellations/constellation_keybinds.asset @@ -6,7 +6,7 @@ local Keybindings = { Name = "Show Constellation Art", Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0);" .. "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Enabled', true);" .. - "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0.1, 2);", + "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0.2, 2);", Documentation = "Enables and fades up constellation art work", GuiPath = "/Rendering", Local = false @@ -39,10 +39,10 @@ end) asset.meta = { - Name = "Constellation Image Keybinds", - Version = "1.0", - Description = "Keybinds for fading in and out the constellations", - Author = "OpenSpace Team", - URL = "http://openspaceproject.com", - License = "MIT License" + Name = "Constellation Image Keybinds", + Version = "1.0", + Description = "Artistic images depicting the constellations", + Author = "James Hedberg", + URL = "http://jameshedberg.com", + License = "CC-BY" } diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset index 4b6aa574c2..0d45b5abd9 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset @@ -13,8 +13,7 @@ local Charon = { Translation = { Type = "SpiceTranslation", Target = "CHARON", - Observer = "PLUTO BARYCENTER", - Kernels = NewHorizonsKernels + Observer = "PLUTO BARYCENTER" }, Rotation = { Type = "SpiceRotation", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset index 0434de709b..fb2ddb43a6 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset @@ -11,8 +11,7 @@ local Kerberos = { Translation = { Type = "SpiceTranslation", Target = "KERBEROS", - Observer = "PLUTO BARYCENTER", - Kernels = PlutoKernels + Observer = "PLUTO BARYCENTER" } }, Renderable = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset index bea389470d..c5f7e03923 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset @@ -11,8 +11,7 @@ local Nix = { Translation = { Type = "SpiceTranslation", Target = "NIX", - Observer = "PLUTO BARYCENTER", - Kernels = PlutoKernels + Observer = "PLUTO BARYCENTER" } }, Renderable = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset index 25c369e4e7..bc54df433a 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset @@ -3,7 +3,6 @@ local transforms = asset.require('../transforms') local kernels = asset.require('../kernels').PlutoKernels - local Styx = { Identifier = "Styx", Parent = transforms.PlutoBarycenter.Identifier, @@ -11,8 +10,7 @@ local Styx = { Translation = { Type = "SpiceTranslation", Target = "STYX", - Observer = "PLUTO BARYCENTER", - Kernels = PlutoKernels + Observer = "PLUTO BARYCENTER" } }, Renderable = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 5299ebc5dd..968a7edd86 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -13,8 +13,7 @@ local Pluto = { Translation = { Type = "SpiceTranslation", Target = "PLUTO", - Observer = "PLUTO BARYCENTER", - Kernels = NewHorizonsKernels + Observer = "PLUTO BARYCENTER" }, Rotation = { Type = "SpiceRotation", diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset index a716eb4626..06e4259d50 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset @@ -18,13 +18,8 @@ asset.onInitialize(function () openspace.globebrowsing.addBlendingLayersFromDirectory(vrts, assetGlobe); flipbook = helper.createFlipbook(assetPrefix, assetGlobe, 19); - function nextFlip() - helper.nextFlipbookPage(flipbook); - end - - function previousFlip() - helper.previousFlipbookPage(flipbook); - end + rawset(_G, "nextFlip", function() helper.nextFlipbookPage(flipbook) end) + rawset(_G, "previousFlip", function() helper.previousFlipbookPage(flipbook) end) openspace.bindKey("p", "nextFlip()", "Show the next Apollo 11 flipbook image.", "Next A11 flip", "/Missions/Apollo/11") openspace.bindKey("o", "previousFlip()","Show the previous Apollo 11 flipbook image.", "Prev A11 flip", "/Missions/Apollo/11") diff --git a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset index 7e6001679f..900a9631af 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset @@ -1,8 +1,8 @@ local assetHelper = asset.require('util/asset_helper') local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local csm = asset.require('../apollo_csm') asset.require('spice/base') +local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models local kernels = asset.require('scene/solarsystem/missions/apollo/15/kernels').kernels @@ -47,6 +47,20 @@ local Apollo15 = { DestinationFrame = "GALACTIC" } }, + Renderable = { + Type = "RenderableModel", + GeometryFile = models .. "/ApolloCSM.fbx", + LightSources = { + { + Type = "SceneGraphLightSource", + Identifier = "Sun", + Node = sun_transforms.SolarSystemBarycenter.Identifier, + Intensity = 1.0 + } + }, + PerformShading = true, + DisableFaceCulling = true + }, TimeFrame = { Type = "TimeFrameInterval", Start = "1971-07-30T02:22:00.00", @@ -101,13 +115,6 @@ local Apollo15Trail = { } } - -local model_part = csm.createCsmModel(Apollo15.Identifier) - local list = { Apollo15, Apollo15Trail } -for k,v in pairs(model_part) do - v.GUI.Path = "/Solar System/Missions/Apollo/15/Model" - table.insert(list, v) -end assetHelper.registerSceneGraphNodesAndExport(asset, list) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset index 1e76c60931..9e5b749c17 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset @@ -1,7 +1,8 @@ local asset_helper = asset.require('util/asset_helper') local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local kernels = asset.require('./kernels').kernels -local csm = asset.require('../apollo_csm') +local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models local apolloSpiceId = "-908" @@ -47,6 +48,20 @@ local Apollo8LaunchModel = { Rotation = {0.0, 0.0, -3.1415 / 2} } }, + Renderable = { + Type = "RenderableModel", + GeometryFile = models .. "/ApolloCSM.fbx", + LightSources = { + { + Type = "SceneGraphLightSource", + Identifier = "Sun", + Node = sun_transforms.SolarSystemBarycenter.Identifier, + Intensity = 1.0 + } + }, + PerformShading = true, + DisableFaceCulling = true + }, GUI = { Hidden = true, Name = "Apollo 8 Launch Model", @@ -54,12 +69,6 @@ local Apollo8LaunchModel = { } } -local launch_model_part = csm.createCsmModel(Apollo8LaunchModel.Identifier) - local list = { Apollo8Launch, Apollo8LaunchModel } -for k,v in pairs(launch_model_part) do - v.GUI.Path = "/Solar System/Missions/Apollo/8/Model" - table.insert(list, v) -end asset_helper.registerSceneGraphNodesAndExport(asset, list) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/model.asset b/data/assets/scene/solarsystem/missions/apollo/8/model.asset index 4b677cc818..00036a697a 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/model.asset @@ -1,7 +1,8 @@ local asset_helper = asset.require('util/asset_helper') local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local kernels = asset.require('./kernels').kernels -local csm = asset.require('../apollo_csm') +local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models local apolloSpiceId = "-908" @@ -59,6 +60,20 @@ local Apollo8Model = { Rotation = {0.0, 0.0, -3.1415 / 2} } }, + Renderable = { + Type = "RenderableModel", + GeometryFile = models .. "/ApolloCSM.fbx", + LightSources = { + { + Type = "SceneGraphLightSource", + Identifier = "Sun", + Node = sun_transforms.SolarSystemBarycenter.Identifier, + Intensity = 1.0 + } + }, + PerformShading = true, + DisableFaceCulling = true + }, GUI = { Hidden = true, Name = "Apollo 8 Model", @@ -82,12 +97,6 @@ local Apollo8Pivot = { } } -local model_part = csm.createCsmModel(Apollo8Model.Identifier) - local list = { Apollo8, Apollo8Model, Apollo8Pivot } -for k,v in pairs(model_part) do - v.GUI.Path = "/Solar System/Missions/Apollo/8/Model" - table.insert(list, v) -end asset_helper.registerSceneGraphNodesAndExport(asset, list) diff --git a/data/assets/scene/solarsystem/missions/apollo/apollo_csm.asset b/data/assets/scene/solarsystem/missions/apollo/apollo_csm.asset deleted file mode 100644 index 32581a1597..0000000000 --- a/data/assets/scene/solarsystem/missions/apollo/apollo_csm.asset +++ /dev/null @@ -1,280 +0,0 @@ --- This asset exports a function to create an Apollo Command and Service Module (CSM). --- Instead of hard-coding the scene graph node parent, --- client assets can decide which object that the CSM should be attached to. --- Usage example: createCsmModel(asset, Apollo8.Idenfitier) --- ...where Apollo8 is the scene graph node identifier to attach the CSM to. - -local asset_helper = asset.require('util/asset_helper') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') - -local models = asset.syncedResource({ - Name = "Apollo Models", - Type = "HttpSynchronization", - Identifier = "apollo_models", - Version = 1 -}) - -local partsInfo = { - -- Data is structured as: Geometry file name (except .obj suffix), texture file name, shading - - -- Exterior - { "AP08_cone_command_module", "Command_module_diff.png", true }, - { "AP08_cone_hatchdoor_handle_scratched_metal", "scratched_metal_gloss.png", true }, - { "AP08_cone_vent_ports_black", "black.png", true }, - { "AP08_cone_vent_ports_red", "red.png", true }, - { "AP08_cone_hatchdoor_interior", "apollo_hatchdoor_interior.jpg", false }, - - { "AP08_service_black", "black.png", true }, - { "AP08_service_brown", "brown.png", true }, - { "AP08_service_grey", "gray.png", true }, - { "AP08_service_high_gain_antenna", "Antenna_diff.png", true }, - { "AP08_service_module", "Service_module_diff.png", true }, - { "AP08_service_nozzle", "Nozzle_diff.png", true }, - { "AP08_service_pink", "pink.png", true }, - { "AP08_service_red", "red.png", true }, - { "AP08_service_scratched_metal", "scratched_metal_gloss.png", true }, - { "AP08_service_white", "white.png", true }, - - -- Interior - -- { "AP11_int_back_wall_left", "AP11_int_back_wall_left.png", false}, - -- { "AP11_int_back_wall_right", "AP11_int_back_wall_right.png", false }, - -- { "AP11_interior_back_wall_top_0Shape3", "back_wall_top_0Shape3_tpAmbient_paint_03.png", false }, - -- { "AP11_interior_belt_buckles_02_L2", "belt_buckles_02_L2Shape_tpAmbient.png", false }, - -- { "AP11_interior_belt_straps_02", "belt_straps_02Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_black_push_buttons", "push_buttonsShape_tpAmbient.png", false }, - -- { "AP11_interior_bottom_boxes_03", "bottom_boxes_03_paint_01.png", false }, - -- { "AP11_interior_bottom_floor_tp", "bottom_floor_tpAmbient_paint_v002.png", false }, - -- { "AP11_interior_box_back_01", "box_back_01_paint_v001.png", false }, - -- { "AP11_interior_box_back_02", "box_back_02_paint_v001.png", false }, - -- { "AP11_interior_box_back_04", "box_back_04_paint_v001.png", false }, - -- { "AP11_interior_box_lft_lower_01", "box_lft_lower_01Shape_Diffuse_paint_v002.png", false }, - -- { "AP11_interior_box_lft_top", "box_lft_topShape_Diffuse_paint_v009.png", false }, - -- { "AP11_interior_box_mid_tp", "box_mid_tpDiffuse_paint_v001.png", false }, - -- { "AP11_interior_box_rt_top_02", "box_rt_top_02_paint_04.png", false }, - -- { "AP11_interior_brushed_blue_ano", "brushed_blue_ano_paint_01.png", false }, - -- { "AP11_interior_brushed_brass", "brushed_brass_paint_01.png", false }, - -- { "AP11_interior_brushed_grey_ano", "brushed_grey_ano_paint_02.png", false }, - -- { "AP11_interior_canvas_cover", "canvas_coverShape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_Channel_attachment", "Channel_attachment_Diffuse.png", false }, - -- { "AP11_interior_Channel_baseMetal", "Channel_baseMetal_Diffuse.png", false }, - -- { "AP11_interior_Channel_Material", "Channel_Material_Diffuse.png", false }, - -- { "AP11_interior_Channel_rsMaterial2", "Channel_rsMaterial2_Diffuse.png", false }, - -- { "AP11_interior_cloth_01", "cloth_01Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_coiled_hose", "coiled_hoseShape_tpAmbient.png", false }, - -- { "AP11_interior_control_panel_left_win_plates", "control_panel_left_win_platesShape_tpAmbient.png", false }, - -- { "AP11_interior_control_panel_rt_win_plates", "control_panel_rt_win_platesShape_tpAmbient.png", false }, - -- { "AP11_interior_copper_parts_main_cp", "copper_parts_main_cpShape_tpAmbient.png", false }, - -- { "AP11_interior_dials_main2", "dials_main2Shape_tpAmbient.png", false }, - -- { "AP11_interior_dials_t2", "dials_t2Shape_tpAmbient.png", false }, - -- { "AP11_interior_dial_fixes_01", "dial_fixes_01Shape_tpAmbient.png", false }, - -- { "AP11_interior_fire_ex_02", "fire_ex_02_paint_v001.png", false }, - -- { "AP11_interior_floor_panels_3", "floor_panels_3Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_floor_tile_tex_01", "floor_tile_tex_01.png", false }, - -- { "AP11_interior_grey", "gray.png", false }, - -- { "AP11_interior_handholds_cp", "handholds_cpShape_tpAmbient_paint_05.png", false }, - -- { "AP11_interior_hatch_release_0Shape5", "hatch_release_0Shape5_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_headrests_02", "headrests_02Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_hoses_black_01", "hoses_black_01Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_hoses_white_0Shape1", "hoses_white_0Shape1_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_josticks1", "joysticks1Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_joysticks_fabric1", "joysticks_fabric1_Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_joystick_poles_lft_05", "joystick_poles_lft_05_paint_v002.png", false }, - -- { "AP11_interior_joystick_poles_lft_long_05", "joystick_poles_lft_long_05_paint_v002.png", false }, - -- { "AP11_interior_joystick_poles_rt_05", "joystick_poles_rt_05_paint_v002.png", false }, - -- { "AP11_interior_latch_mechanisms_01", "latch_mechanisms_01Shape_tpAmbient.png", false }, - -- { "AP11_interior_lower_push_buttons", "lower_push_buttonsShape_tpAmbient.png", false }, - -- { "AP11_interior_lower_walls_back", "lower_walls_back_paint_04.png", false }, - -- { "AP11_interior_lower_walls_boxes_head", "lower_walls_boxes_headShape_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_main_cp_left_smth_03", "main_cp_left_0Shape3_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_main_cp_mid_smth_02", "main_cp_mid_smth_02Shape_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_main_cp_rt_smth", "main_cp_rt_smthShape_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_main_cp_wheels", "main_cp_wheelsShape_tpAmbient.png", false }, - -- { "AP11_interior_metal_brackets_under_hatch", "metal_brackets_under_hatchShape_tpAmbient.png", false }, - -- { "AP11_interior_metal_tunnel_parts", "metal_tunnel_partsShape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_metal_window_parts", "metal_window_partsShape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_middle_walls_05", "middle_walls_05_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_middle_walls_0Shape8", "middle_walls_0Shape8_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_mid_tunnel_parts", "mid_tunnel_parts_03Shape_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_new_switch_rails1", "new_switch_rails1Shape_tpAmbient.png", false }, - -- { "AP11_interior_nozzles_02", "nozzles_02Shape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_outlet_fabric3", "outlet_fabric3Shape_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_pole_end_02", "pole_end_02.png", false }, - -- { "AP11_interior_pole_end_03", "pole_end_03.png", false }, - -- { "AP11_interior_pole_tex_03", "pole_tex_03.png", false }, - -- { "AP11_interior_pole_tex_04", "pole_tex_04.png", false }, - -- { "AP11_interior_pole_tex_05", "pole_tex_05.png", false }, - -- { "AP11_interior_pole_tex_lower_01", "pole_tex_lower_01.png", false }, - -- { "AP11_interior_pole_under_seat_paint_01", "pole_under_seat_paint_01.png", false }, - -- { "AP11_interior_pole_under_seat_square_bar", "pole_under_seat_square_bar_paint_01.png", false }, - -- { "AP11_interior_push_switches_lft1", "push_switches_lft1Shape_tpAmbient.png", false }, - -- { "AP11_interior_random_small_parts_01", "random_small_parts_01Shape_tpAmbient_paint_02.png", false }, - -- { "AP11_interior_red", "red.png", false }, - -- { "AP11_interior_reticle_wheel_tp", "reticle_wheel_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_rivet_paint_v001", "rivet_paint_v001.png", false }, - -- { "AP11_interior_seats_fabric", "seats_fabric_paint_01.png", false }, - -- { "AP11_interior_seat_left_tp", "seat_left_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_seat_lights_left", "seat_lights_left_Shape_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_seat_lights_rt", "seat_lights_rt_Shape_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_seat_middle_tp", "seat_middle_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_seat_poles_0Shape1", "seat_poles_0Shape1_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_seat_pole_mirror_0Shape1", "seat_pole_mirror_0Shape1_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_seat_rt_tp", "seat_rt_tpAmbient_paint_v001.png", false }, - -- { "AP11_interior_sextant_0Shape2", "sextant_0Shape2_tpAmbient.png", false }, - -- { "AP11_interior_switch_covers_main_middle1", "switch_covers_main_middle1Shape_tpAmbient.png", false }, - -- { "AP11_interior_switch_rails_lft", "switch_rails_lftShape_tpAmbient.png", false }, - -- { "AP11_interior_tunnel_main_cylinder1", "switch_rails_lftShape_tpAmbient.png", false }, - -- { "AP11_interior_tunnel_switches_01", "tunnel_switches_01Shape_tpAmbient.png", false }, - -- { "AP11_interior_tunnel_wheelsShape", "tunnel_wheelsShape_tpAmbient.png", false }, - -- { "AP11_interior_walls_mid_left", "walls_mid_leftShape_tpAmbient_paint_01.png", false }, - -- { "AP11_interior_windows_front_0Shape4", "windows_front_0Shape4_tpAmbient_paint_01.png", false } -} - - -local partsInfoFull = { - -- Data is structured as: Geometry file name (except .obj suffix), texture file name, shading - - -- Exterior - { "AP08_cone_command_module", "Command_module_diff.png", true }, - { "AP08_cone_hatchdoor_handle_scratched_metal", "scratched_metal_gloss.png", true }, - { "AP08_cone_vent_ports_black", "black.png", true }, - { "AP08_cone_vent_ports_red", "red.png", true }, - { "AP08_cone_hatchdoor_interior", "apollo_hatchdoor_interior.jpg", false }, - - { "AP08_service_black", "black.png", true }, - { "AP08_service_brown", "brown.png", true }, - { "AP08_service_grey", "gray.png", true }, - { "AP08_service_high_gain_antenna", "Antenna_diff.png", true }, - { "AP08_service_module", "Service_module_diff.png", true }, - { "AP08_service_nozzle", "Nozzle_diff.png", true }, - { "AP08_service_pink", "pink.png", true }, - { "AP08_service_red", "red.png", true }, - { "AP08_service_scratched_metal", "scratched_metal_gloss.png", true }, - { "AP08_service_white", "white.png", true }, - - -- Interior - { "AP11_int_back_wall_left", "AP11_int_back_wall_left.png", false }, - { "AP11_int_back_wall_right", "AP11_int_back_wall_right.png", false }, - { "AP11_interior_back_wall_top_0Shape3", "back_wall_top_0Shape3_tpAmbient_paint_03.png", false }, - { "AP11_interior_belt_buckles_02_L2", "belt_buckles_02_L2Shape_tpAmbient.png", false }, - { "AP11_interior_belt_straps_02", "belt_straps_02Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_black_push_buttons", "push_buttonsShape_tpAmbient.png", false }, - { "AP11_interior_bottom_boxes_03", "bottom_boxes_03_paint_01.png", false }, - { "AP11_interior_bottom_floor_tp", "bottom_floor_tpAmbient_paint_v002.png", false }, - { "AP11_interior_box_back_01", "box_back_01_paint_v001.png", false }, - { "AP11_interior_box_back_02", "box_back_02_paint_v001.png", false }, - { "AP11_interior_box_back_04", "box_back_04_paint_v001.png", false }, - { "AP11_interior_box_lft_lower_01", "box_lft_lower_01Shape_Diffuse_paint_v002.png", false }, - { "AP11_interior_box_lft_top", "box_lft_topShape_Diffuse_paint_v009.png", false }, - { "AP11_interior_box_mid_tp", "box_mid_tpDiffuse_paint_v001.png", false }, - { "AP11_interior_box_rt_top_02", "box_rt_top_02_paint_04.png", false }, - { "AP11_interior_brushed_blue_ano", "brushed_blue_ano_paint_01.png", false }, - { "AP11_interior_brushed_brass", "brushed_brass_paint_01.png", false }, - { "AP11_interior_brushed_grey_ano", "brushed_grey_ano_paint_02.png", false }, - { "AP11_interior_canvas_cover", "canvas_coverShape_tpAmbient_paint_01.png", false }, - { "AP11_interior_Channel_attachment", "Channel_attachment_Diffuse.png", false }, - { "AP11_interior_Channel_baseMetal", "Channel_baseMetal_Diffuse.png", false }, - { "AP11_interior_Channel_Material", "Channel_Material_Diffuse.png", false }, - { "AP11_interior_Channel_rsMaterial2", "Channel_rsMaterial2_Diffuse.png", false }, - { "AP11_interior_cloth_01", "cloth_01Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_coiled_hose", "coiled_hoseShape_tpAmbient.png", false }, - { "AP11_interior_control_panel_left_win_plates", "control_panel_left_win_platesShape_tpAmbient.png", false }, - { "AP11_interior_control_panel_rt_win_plates", "control_panel_rt_win_platesShape_tpAmbient.png", false }, - { "AP11_interior_copper_parts_main_cp", "copper_parts_main_cpShape_tpAmbient.png", false }, - { "AP11_interior_dials_main2", "dials_main2Shape_tpAmbient.png", false }, - { "AP11_interior_dials_t2", "dials_t2Shape_tpAmbient.png", false }, - { "AP11_interior_dial_fixes_01", "dial_fixes_01Shape_tpAmbient.png", false }, - { "AP11_interior_fire_ex_02", "fire_ex_02_paint_v001.png", false }, - { "AP11_interior_floor_panels_3", "floor_panels_3Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_floor_tile_tex_01", "floor_tile_tex_01.png", false }, - { "AP11_interior_grey", "gray.png", false }, - { "AP11_interior_handholds_cp", "handholds_cpShape_tpAmbient_paint_05.png", false }, - { "AP11_interior_hatch_release_0Shape5", "hatch_release_0Shape5_tpAmbient_paint_02.png", false }, - { "AP11_interior_headrests_02", "headrests_02Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_hoses_black_01", "hoses_black_01Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_hoses_white_0Shape1", "hoses_white_0Shape1_tpAmbient_paint_01.png", false }, - { "AP11_interior_josticks1", "joysticks1Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_joysticks_fabric1", "joysticks_fabric1_Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_joystick_poles_lft_05", "joystick_poles_lft_05_paint_v002.png", false }, - { "AP11_interior_joystick_poles_lft_long_05", "joystick_poles_lft_long_05_paint_v002.png", false }, - { "AP11_interior_joystick_poles_rt_05", "joystick_poles_rt_05_paint_v002.png", false }, - { "AP11_interior_latch_mechanisms_01", "latch_mechanisms_01Shape_tpAmbient.png", false }, - { "AP11_interior_lower_push_buttons", "lower_push_buttonsShape_tpAmbient.png", false }, - { "AP11_interior_lower_walls_back", "lower_walls_back_paint_04.png", false }, - { "AP11_interior_lower_walls_boxes_head", "lower_walls_boxes_headShape_tpAmbient_paint_v001.png", false }, - { "AP11_interior_main_cp_left_smth_03", "main_cp_left_0Shape3_tpAmbient_paint_02.png", false }, - { "AP11_interior_main_cp_mid_smth_02", "main_cp_mid_smth_02Shape_tpAmbient_paint_02.png", false }, - { "AP11_interior_main_cp_rt_smth", "main_cp_rt_smthShape_tpAmbient_paint_02.png", false }, - { "AP11_interior_main_cp_wheels", "main_cp_wheelsShape_tpAmbient.png", false }, - { "AP11_interior_metal_brackets_under_hatch", "metal_brackets_under_hatchShape_tpAmbient.png", false }, - { "AP11_interior_metal_tunnel_parts", "metal_tunnel_partsShape_tpAmbient_paint_01.png", false }, - { "AP11_interior_metal_window_parts", "metal_window_partsShape_tpAmbient_paint_01.png", false }, - { "AP11_interior_middle_walls_05", "middle_walls_05_tpAmbient_paint_02.png", false }, - { "AP11_interior_middle_walls_0Shape8", "middle_walls_0Shape8_tpAmbient_paint_01.png", false }, - { "AP11_interior_mid_tunnel_parts", "mid_tunnel_parts_03Shape_tpAmbient_paint_02.png", false }, - { "AP11_interior_new_switch_rails1", "new_switch_rails1Shape_tpAmbient.png", false }, - { "AP11_interior_nozzles_02", "nozzles_02Shape_tpAmbient_paint_01.png", false }, - { "AP11_interior_outlet_fabric3", "outlet_fabric3Shape_tpAmbient_paint_02.png", false }, - { "AP11_interior_pole_end_02", "pole_end_02.png", false }, - { "AP11_interior_pole_end_03", "pole_end_03.png", false }, - { "AP11_interior_pole_tex_03", "pole_tex_03.png", false }, - { "AP11_interior_pole_tex_04", "pole_tex_04.png", false }, - { "AP11_interior_pole_tex_05", "pole_tex_05.png", false }, - { "AP11_interior_pole_tex_lower_01", "pole_tex_lower_01.png", false }, - { "AP11_interior_pole_under_seat_paint_01", "pole_under_seat_paint_01.png", false }, - { "AP11_interior_pole_under_seat_square_bar", "pole_under_seat_square_bar_paint_01.png", false }, - { "AP11_interior_push_switches_lft1", "push_switches_lft1Shape_tpAmbient.png", false }, - { "AP11_interior_random_small_parts_01", "random_small_parts_01Shape_tpAmbient_paint_02.png", false }, - { "AP11_interior_red", "red.png", false }, - { "AP11_interior_reticle_wheel_tp", "reticle_wheel_tpAmbient_paint_01.png", false }, - { "AP11_interior_rivet_paint_v001", "rivet_paint_v001.png", false }, - { "AP11_interior_seats_fabric", "seats_fabric_paint_01.png", false }, - { "AP11_interior_seat_left_tp", "seat_left_tpAmbient_paint_v001.png", false }, - { "AP11_interior_seat_lights_left", "seat_lights_left_Shape_tpAmbient_paint_v001.png", false }, - { "AP11_interior_seat_lights_rt", "seat_lights_rt_Shape_tpAmbient_paint_v001.png", false }, - { "AP11_interior_seat_middle_tp", "seat_middle_tpAmbient_paint_v001.png", false }, - { "AP11_interior_seat_poles_0Shape1", "seat_poles_0Shape1_tpAmbient_paint_01.png", false }, - { "AP11_interior_seat_pole_mirror_0Shape1", "seat_pole_mirror_0Shape1_tpAmbient_paint_01.png", false }, - { "AP11_interior_seat_rt_tp", "seat_rt_tpAmbient_paint_v001.png", false }, - { "AP11_interior_sextant_0Shape2", "sextant_0Shape2_tpAmbient.png", false }, - { "AP11_interior_switch_covers_main_middle1", "switch_covers_main_middle1Shape_tpAmbient.png", false }, - { "AP11_interior_switch_rails_lft", "switch_rails_lftShape_tpAmbient.png", false }, - { "AP11_interior_tunnel_main_cylinder1", "switch_rails_lftShape_tpAmbient.png", false }, - { "AP11_interior_tunnel_switches_01", "tunnel_switches_01Shape_tpAmbient.png", false }, - { "AP11_interior_tunnel_wheelsShape", "tunnel_wheelsShape_tpAmbient.png", false }, - { "AP11_interior_walls_mid_left", "walls_mid_leftShape_tpAmbient_paint_01.png", false }, - { "AP11_interior_windows_front_0Shape4", "windows_front_0Shape4_tpAmbient_paint_01.png", false } -} - - - -asset.export("createCsmModel", function (parentNodeIdentifier) - local parts = {} - for i, info in ipairs(partsInfo) do - parts[#parts + 1] = asset_helper.createModelPart( - parentNodeIdentifier, - sun_transforms.SolarSystemBarycenter.Identifier, - models, - info[1], - info[2], - info[3] - ) - end - return parts -end) - - - -asset.export("createCsmModelFull", function (parentNodeIdentifier) - local parts = {} - for i, info in ipairs(partsInfoFull) do - parts[#parts + 1] = asset_helper.createModelPart( - parentNodeIdentifier, - sun_transforms.SolarSystemBarycenter.Identifier, - models, - info[1], - info[2], - info[3] - ) - end - return parts -end) diff --git a/data/assets/scene/solarsystem/missions/apollo/csm_model.asset b/data/assets/scene/solarsystem/missions/apollo/csm_model.asset new file mode 100644 index 0000000000..298640354c --- /dev/null +++ b/data/assets/scene/solarsystem/missions/apollo/csm_model.asset @@ -0,0 +1,8 @@ +local models = asset.syncedResource({ + Name = "Apollo Models", + Type = "HttpSynchronization", + Identifier = "apollo_models", + Version = 2 +}) + +asset.export('models', models) diff --git a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset index ce2f3b32bc..68e23b4742 100644 --- a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset +++ b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset @@ -172,7 +172,7 @@ local MessengerTrail = { Type = "SpiceTranslation", Target = "MESSENGER", Observer = "MERCURY BARYCENTER", - Kernels = Kernels + Kernels = LocalKernels }, Color = { 0.288, 0.375, 0.934 }, EnableFade = false, diff --git a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset index 3a963722e2..35210c0e09 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset @@ -1,6 +1,7 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local NewHorizonsKernels = asset.require('./kernels').NewHorizonsKernels local assets = asset.syncedResource({ Name = "Pluto Assets", diff --git a/data/assets/scene/solarsystem/missions/voyager/model.asset b/data/assets/scene/solarsystem/missions/voyager/model.asset index cb565ad315..e1d17adda6 100644 --- a/data/assets/scene/solarsystem/missions/voyager/model.asset +++ b/data/assets/scene/solarsystem/missions/voyager/model.asset @@ -1,5 +1,5 @@ local models = asset.syncedResource({ - Name = "New Horizons Model", + Name = "Voyager Model", Type = "HttpSynchronization", Identifier = "voyager_model", Version = 1 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset new file mode 100644 index 0000000000..030be3572d --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset @@ -0,0 +1,15 @@ +local moonAsset = asset.require("./../../moon").Moon +local globeIdentifier = moonAsset.Identifier + +local layer ={ + Identifier = "Size_Reference", + Name = "Size Reference", + Type = "SizeReferenceTileLayer", + Radii = moonAsset.Renderable.Radii +} + +asset.onInitialize(function () + openspace.globebrowsing.addLayer(globeIdentifier, "Overlays", layer) +end) + +asset.export("layer", layer) diff --git a/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset b/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset index 632ebd6859..826e6366c4 100644 --- a/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset @@ -3,7 +3,7 @@ local proceduralGlobes = asset.require('util/procedural_globe') local transforms = asset.require('./transforms') local kernels = asset.require('./kernels') local kernel081 = kernels.nep081 -local kernel087 = kernels.nep087 +local kernel086 = kernels.nep086 local kernel088 = kernels.nep088 diff --git a/data/assets/util/asset_helper.asset b/data/assets/util/asset_helper.asset index 77a28382f1..e5cf1582e6 100644 --- a/data/assets/util/asset_helper.asset +++ b/data/assets/util/asset_helper.asset @@ -13,7 +13,7 @@ local registerSpiceKernels = function (spiceAsset, kernels) end) spiceAsset.onDeinitialize(function () for i = #kernels, 1, -1 do - kernel = kernels[i] + local kernel = kernels[i] openspace.spice.unloadKernel(kernel) end end) @@ -75,7 +75,7 @@ local registerDashboardItems = function (dashboardAsset, items) ) dashboardAsset.onDeinitialize(function () for i = #items, 1, -1 do - item = items[i] + local item = items[i] openspace.dashboard.removeDashboardItem(item.Identifier) end end) @@ -103,7 +103,7 @@ local registerSceneGraphNodesAndExport = function (sceneAsset, nodes, override) end) sceneAsset.onDeinitialize(function () for i = #nodes, 1, -1 do - node = nodes[i] + local node = nodes[i] openspace.removeSceneGraphNode(node.Identifier) end end) diff --git a/data/assets/util/procedural_globe.asset b/data/assets/util/procedural_globe.asset index 23198f2e65..4c34de326a 100644 --- a/data/assets/util/procedural_globe.asset +++ b/data/assets/util/procedural_globe.asset @@ -68,7 +68,7 @@ local createGlobes = function(t) end end - result = {} + local result = {} for i, v in ipairs(t) do local globe = nil diff --git a/data/assets/util/static_server.asset b/data/assets/util/static_server.asset index 3e98da9fdd..936f18277f 100644 --- a/data/assets/util/static_server.asset +++ b/data/assets/util/static_server.asset @@ -10,7 +10,7 @@ local backend = asset.syncedResource({ asset.onInitialize(function () -- Unzip the server bundle - dest = backend .. "/backend" + local dest = backend .. "/backend" if not openspace.directoryExists(dest) then openspace.unzipFile(backend .. "/backend.zip", dest, true) end diff --git a/data/assets/util/tle_helper.asset b/data/assets/util/tle_helper.asset index fdcccdbb43..6a80121695 100644 --- a/data/assets/util/tle_helper.asset +++ b/data/assets/util/tle_helper.asset @@ -24,7 +24,7 @@ end -- Check format of a set of 3 TLE file lines and return nonzero if there is a format error function isValidTLEFileFormat(lineArr) - function isEmpty(s) return s == nil or s == '' end + local function isEmpty(s) return s == nil or s == '' end if isEmpty(lineArr[1]) or isEmpty(lineArr[2]) or isEmpty(lineArr[3]) then return false diff --git a/ext/ghoul b/ext/ghoul index 6ef01a676c..4db5e42c95 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6ef01a676c10da0613b1f59cccc893966bfc60ec +Subproject commit 4db5e42c95fc9735aa87903e514c5616da1080bc diff --git a/include/openspace/properties/list/doublelistproperty.h b/include/openspace/properties/list/doublelistproperty.h new file mode 100644 index 0000000000..b857dbc144 --- /dev/null +++ b/include/openspace/properties/list/doublelistproperty.h @@ -0,0 +1,65 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * 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___DOUBLELISTPROPERTY___H__ +#define __OPENSPACE_CORE___DOUBLELISTPROPERTY___H__ + +#include + +namespace openspace::properties { + +class DoubleListProperty : public ListProperty { +public: + DoubleListProperty(Property::PropertyInfo info); + DoubleListProperty(Property::PropertyInfo info, std::vector values); + + using TemplateProperty>::operator std::vector; + using TemplateProperty>::operator=; +}; + +template <> +std::string PropertyDelegate>>::className(); + +template <> +template <> +std::vector +PropertyDelegate>>::fromLuaValue( + lua_State* state, bool& success); + +template <> +template <> +bool PropertyDelegate>>::toLuaValue( + lua_State* state, const std::vector& value); + +template <> +int PropertyDelegate>>::typeLua(); + +template <> +template <> +bool PropertyDelegate>>::toString( + std::string& outValue, const std::vector& inValue); + +} // namespace openspace::properties + +#endif // __OPENSPACE_CORE___DOUBLELISTPROPERTY___H__ diff --git a/include/openspace/properties/list/intlistproperty.h b/include/openspace/properties/list/intlistproperty.h new file mode 100644 index 0000000000..2213968d0d --- /dev/null +++ b/include/openspace/properties/list/intlistproperty.h @@ -0,0 +1,64 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * 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___INTLISTPROPERTY___H__ +#define __OPENSPACE_CORE___INTLISTPROPERTY___H__ + +#include + +namespace openspace::properties { + +class IntListProperty : public ListProperty { +public: + IntListProperty(Property::PropertyInfo info); + IntListProperty(Property::PropertyInfo info, std::vector values); + + using TemplateProperty>::operator std::vector; + using TemplateProperty>::operator=; +}; + +template <> +std::string PropertyDelegate>>::className(); + +template <> +template <> +std::vector PropertyDelegate>>::fromLuaValue( + lua_State* state, bool& success); + +template <> +template <> +bool PropertyDelegate>>::toLuaValue( + lua_State* state, const std::vector& value); + +template <> +int PropertyDelegate>>::typeLua(); + +template <> +template <> +bool PropertyDelegate>>::toString( + std::string& outValue, const std::vector& inValue); + +} // namespace openspace::properties + +#endif // __OPENSPACE_CORE___INTLISTPROPERTY___H__ diff --git a/include/openspace/properties/list/stringlistproperty.h b/include/openspace/properties/list/stringlistproperty.h new file mode 100644 index 0000000000..8ed0259332 --- /dev/null +++ b/include/openspace/properties/list/stringlistproperty.h @@ -0,0 +1,66 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * 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___STRINGLISTPROPERTY___H__ +#define __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ + +#include +#include + +namespace openspace::properties { + +class StringListProperty : public ListProperty { +public: + StringListProperty(Property::PropertyInfo info); + StringListProperty(Property::PropertyInfo info, std::vector values); + + using TemplateProperty>::operator std::vector; + using TemplateProperty>::operator=; +}; + +template <> +std::string PropertyDelegate>>::className(); + +template <> +template <> +std::vector +PropertyDelegate>>::fromLuaValue( + lua_State* state, bool& success); + +template <> +template <> +bool PropertyDelegate>>::toLuaValue( + lua_State* state, const std::vector& value); + +template <> +int PropertyDelegate>>::typeLua(); + +template <> +template <> +bool PropertyDelegate>>::toString( + std::string& outValue, const std::vector& inValue); + +} // namespace openspace::properties + +#endif // __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ diff --git a/include/openspace/properties/listproperty.h b/include/openspace/properties/listproperty.h new file mode 100644 index 0000000000..9d7ef0f820 --- /dev/null +++ b/include/openspace/properties/listproperty.h @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * 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___LISTPROPERTY___H__ +#define __OPENSPACE_CORE___LISTPROPERTY___H__ + +#include +#include + +namespace openspace::properties { + +template +class ListProperty : public TemplateProperty> { +public: + ListProperty(Property::PropertyInfo info); + ListProperty(Property::PropertyInfo info, std::vector values); + + virtual ~ListProperty() = 0; +}; + +} // namespace openspace::properties + +#include "openspace/properties/listproperty.inl" + +#endif // __OPENSPACE_CORE___LISTPROPERTY___H__ diff --git a/include/openspace/properties/stringlistproperty.h b/include/openspace/properties/listproperty.inl similarity index 85% rename from include/openspace/properties/stringlistproperty.h rename to include/openspace/properties/listproperty.inl index b929273cf3..6bad6b2c09 100644 --- a/include/openspace/properties/stringlistproperty.h +++ b/include/openspace/properties/listproperty.inl @@ -22,18 +22,20 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ -#define __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ - -#include - -#include -#include - namespace openspace::properties { -REGISTER_TEMPLATEPROPERTY_HEADER(StringListProperty, std::vector) +template +ListProperty::ListProperty(Property::PropertyInfo info) + : TemplateProperty>(std::move(info)) +{} + +template +ListProperty::ListProperty(Property::PropertyInfo info, std::vector values) + : TemplateProperty>(std::move(info), std::move(values)) +{} + +template +ListProperty::~ListProperty() {} } // namespace openspace::properties -#endif // __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 53f2122125..05a88a48fb 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -46,7 +46,6 @@ public: int typeLua() const override; bool getStringValue(std::string& value) const override; - bool setStringValue(std::string value) override; T minValue() const; void setMinValue(T value); @@ -66,10 +65,8 @@ public: using TemplateProperty::operator=; - void setInterpolationTarget(std::any value) override; void setLuaInterpolationTarget(lua_State* state) override; - void setStringInterpolationTarget(std::string value) override; void interpolateValue(float t, ghoul::EasingFunc easingFunc = nullptr) override; diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 7417c2a212..57913c30de 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -75,16 +75,6 @@ namespace openspace::properties { \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(const std::string& value, \ - bool& success); \ - \ - template <> \ - template <> \ - TYPE PropertyDelegate>::fromString(const std::string& value, \ - bool& success); \ - \ - template <> \ - template <> \ bool PropertyDelegate>::toString(std::string& outValue, \ const TYPE& inValue); \ \ @@ -98,7 +88,6 @@ namespace openspace::properties { DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, \ DEFAULT_STEPPING, FROM_LUA_LAMBDA_EXPRESSION, \ TO_LUA_LAMBDA_EXPRESSION, \ - FROM_STRING_LAMBDA_EXPRESSION, \ TO_STRING_LAMBDA_EXPRESSION, LUA_TYPE) \ template <> \ std::string PropertyDelegate>::className() \ @@ -187,25 +176,6 @@ namespace openspace::properties { \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(const std::string& value, \ - bool& success) \ - { \ - return FROM_STRING_LAMBDA_EXPRESSION(value, success); \ - } \ - \ - template <> \ - template <> \ - TYPE PropertyDelegate>::fromString(const std::string& value, \ - bool& success) \ - { \ - return PropertyDelegate>::fromString( \ - value, \ - success \ - ); \ - } \ - \ - template <> \ - template <> \ bool PropertyDelegate>::toString(std::string& outValue, \ const TYPE& inValue) \ { \ @@ -336,18 +306,6 @@ bool NumericalProperty::getStringValue(std::string& value) const { return success; } -template -bool NumericalProperty::setStringValue(std::string value) { - bool success = false; - T thisValue = PropertyDelegate>::template fromString( - value, success - ); - if (success) { - TemplateProperty::set(std::any(std::move(thisValue))); - } - return success; -} - template T NumericalProperty::minValue() const { return _minimumValue; @@ -442,19 +400,6 @@ void NumericalProperty::setLuaInterpolationTarget(lua_State* state) { } } -template -void NumericalProperty::setStringInterpolationTarget(std::string value) { - bool success = false; - T thisValue = PropertyDelegate>::template fromString( - value, - success - ); - if (success) { - _interpolationStart = TemplateProperty::_value; - _interpolationEnd = std::move(thisValue); - } -} - template void NumericalProperty::interpolateValue(float t, ghoul::EasingFunc easingFunction) diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index eda38ae4c6..b0257ef484 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -44,8 +44,7 @@ class PropertyOwner; * used as a URI. This class is an abstract base class and each subclass (most notable * TemplateProperty) needs to implement the methods Property::className, Property::get, * Property::set, Property::type(), Property::getLuaValue, Property::setLuaValue, - * Property::getStringValue, Property::setStringValue and Property::typeLua to make full - * use of the infrastructure. + * Property::getStringValue, and Property::typeLua to make full use of the infrastructure. * The most common types can be implemented by creating a specialized instantiation of * TemplateProperty, which provides default implementations for these methods. * @@ -217,8 +216,7 @@ public: /** * This method encodes the encapsulated \p value of this Property as a * std::string. The specific details of this serialization is up to the - * property developer. The implementation has to be synchronized with the - * Property::setStringValue method. The default implementation is a no-op. + * property developer. The default implementation is a no-op. * * \param value The value to which the Property will be encoded * \return \p true if the encoding succeeded, \p false otherwise @@ -235,18 +233,6 @@ public: */ std::string getStringValue() const; - /** - * This method sets the value encapsulated by this Property by deserializing the - * passed std::string. The specific details of the deserialization are up - * to the Property developer. The implementation has to be synchronized with the - * Property::getLuaValue method. The default implementation is a no-op. - * - * \param value The value from which the Property will be decoded - * \return \c true if the decoding and setting of the value succeeded, \c false - * otherwise - */ - virtual bool setStringValue(std::string value); - /** * This method registers a \p callback function that will be called every time if * either Property:set or Property::setLuaValue was called with a value that is @@ -385,9 +371,9 @@ public: /** * This method determines if this Property should be read-only in external * applications. This setting is only a hint and does not need to be followed by GUI - * applications and does not have any effect on the Property::set, - * Property::setLuaValue, or Property::setStringValue methods. The value is stored in - * the metaData Dictionary with the key: \c isReadOnly. The default value is \c false. + * applications and does not have any effect on the Property::set or + * Property::setLuaValue methods. The value is stored in the metaData Dictionary + * with the key: \c isReadOnly. The default value is \c false. * * \param state \c true if the Property should be read only, \c false otherwise */ @@ -456,7 +442,6 @@ public: /// Interpolation methods virtual void setInterpolationTarget(std::any value); virtual void setLuaInterpolationTarget(lua_State* state); - virtual void setStringInterpolationTarget(std::string value); virtual void interpolateValue(float t, ghoul::EasingFunc easingFunction = nullptr); diff --git a/include/openspace/properties/propertydelegate.h b/include/openspace/properties/propertydelegate.h index f107a00878..1a871d7b96 100644 --- a/include/openspace/properties/propertydelegate.h +++ b/include/openspace/properties/propertydelegate.h @@ -150,9 +150,6 @@ public: */ static int typeLua(); - template - static U fromString(const std::string& value, bool& success); - template static bool toString(std::string& outValue, const U& inValue); }; diff --git a/include/openspace/properties/propertydelegate.inl b/include/openspace/properties/propertydelegate.inl index 6486381916..be419421cf 100644 --- a/include/openspace/properties/propertydelegate.inl +++ b/include/openspace/properties/propertydelegate.inl @@ -91,11 +91,4 @@ bool PropertyDelegate::toString(std::string&, const U&) { return false; } -template -template -U PropertyDelegate::fromString(const std::string&, bool&) { - static_assert(sizeof(T) == 0, - "Unimplemented PropertyDelegate::fromString specialization"); -} - } // namespace openspace::properties diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h index 30749ca9b3..9006ecc630 100644 --- a/include/openspace/properties/selectionproperty.h +++ b/include/openspace/properties/selectionproperty.h @@ -27,62 +27,120 @@ #include +#include #include namespace openspace::properties { -class SelectionProperty : public TemplateProperty> { -public: - struct Option { - int value; - std::string description; - }; +class SelectionProperty : public TemplateProperty> { +public: SelectionProperty(Property::PropertyInfo info); - void addOption(Option option); - void removeOptions(); - const std::vector