diff --git a/data/assets/examples/slidedeck.asset b/data/assets/examples/slidedeck.asset index 14073d5251..74068d52ee 100644 --- a/data/assets/examples/slidedeck.asset +++ b/data/assets/examples/slidedeck.asset @@ -28,15 +28,16 @@ asset.onInitialize(function () end helper.setCurrentSlide(deck, 1) - openspace.bindKey("RIGHT", "nextSlide()", "Next slide", "Next slide", "/Slides") - openspace.bindKey("LEFT", "previousSlide()", "Previous slide", "Previous slide", "/Slides") - openspace.bindKey("UP", "toggleSlides()", "Toggle slides", "Toggle slides", "/Slides") + openspace.bindKey("KP_6", "nextSlide()", "Next slide", "Next slide", "/Slides") + openspace.bindKey("KP_4", "previousSlide()", "Previous slide", "Previous slide", "/Slides") + openspace.bindKey("KP_0", "toggleSlides()", "Toggle slides", "Toggle slides", "/Slides") end) asset.onDeinitialize(function() - openspace.clearKey("RIGHT") - openspace.clearKey("LEFT") + openspace.clearKey("KP_6") + openspace.clearKey("KP_4") + openspace.clearKey("KP_0") helper.removeDeck(deck) end) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset index 6550289152..be77c85a0b 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset @@ -17,6 +17,11 @@ local CharonTrailBarycentric = { Period = 6.38723, Resolution = 1000 }, + Tag = { + "moonTrail_solarSystem", + "moonTrail_dwarf", + "moonTrail_pluto", + "moonTrail_minor" }, GUI = { Name = "Charon Barycentric Trail", Path = "/Solar System/Dwarf Planets/Pluto" diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset index 8a7c503b23..37c7f0d6cf 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset @@ -21,6 +21,7 @@ local Hydra = { SegmentsPerPatch = 64, Layers = {} }, + Tag = { "moon_solarSystem", "moon_dwarf", "moon_pluto" }, GUI = { Path = "/Solar System/Dwarf Planets/Pluto" } @@ -40,6 +41,11 @@ local HydraTrail = { Period = 38.20177, Resolution = 1000 }, + Tag = { + "moonTrail_solarSystem", + "moonTrail_dwarf", + "moonTrail_pluto", + "moonTrail_minor" }, GUI = { Name = "Hydra Trail", Path = "/Solar System/Dwarf Planets/Pluto" 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 3f2a73b90e..cda22633dd 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset @@ -21,6 +21,7 @@ local Kerberos = { SegmentsPerPatch = 64, Layers = {} }, + Tag = { "moon_solarSystem", "moon_dwarf", "moon_pluto" }, GUI = { Path = "/Solar System/Dwarf Planets/Pluto" } @@ -40,6 +41,11 @@ local KerberosTrail = { Period = 32.16756, Resolution = 1000 }, + Tag = { + "moonTrail_solarSystem", + "moonTrail_dwarf", + "moonTrail_pluto", + "moonTrail_minor" }, GUI = { Name = "Hydra Trail", Path = "/Solar System/Dwarf Planets/Pluto" 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 6daccf91a5..bea389470d 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset @@ -21,6 +21,7 @@ local Nix = { SegmentsPerPatch = 64, Layers = {} }, + Tag = { "moon_solarSystem", "moon_dwarf", "moon_pluto" }, GUI = { Path = "/Solar System/Dwarf Planets/Pluto" } @@ -40,6 +41,11 @@ local NixTrail = { Period = 24.85463, Resolution = 1000 }, + Tag = { + "moonTrail_solarSystem", + "moonTrail_dwarf", + "moonTrail_pluto", + "moonTrail_minor" }, GUI = { Name = "Nix Trail", Path = "/Solar System/Dwarf Planets/Pluto" 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 81021e53fb..25c369e4e7 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset @@ -21,6 +21,7 @@ local Styx = { SegmentsPerPatch = 64, Layers = {} }, + Tag = { "moon_solarSystem", "moon_dwarf", "moon_pluto" }, GUI = { Path = "/Solar System/Dwarf Planets/Pluto" } @@ -40,6 +41,11 @@ local StyxTrail = { Period = 20.16155, Resolution = 1000 }, + Tag = { + "moonTrail_solarSystem", + "moonTrail_dwarf", + "moonTrail_pluto", + "moonTrail_minor" }, GUI = { Name = "Styx Trail", Path = "/Solar System/Dwarf Planets/Pluto" diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset index 6ae14d9b14..9fd47cf804 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset @@ -17,6 +17,7 @@ local PlutoTrailBarycentric = { Period = 6.38723, Resolution = 1000 }, + Tag = { "planetTrail_solarSystem", "planetTrail_dwarf" }, GUI = { Name = "Pluto Barycentric Trail", Path = "/Solar System/Dwarf Planets/Pluto" diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset index eb2a843420..635c56d9f0 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset @@ -279,7 +279,6 @@ local initializeAndAddNodes = function() } } - table.insert(nodes, issTrail) return { iss, parentNode, issTrail } end @@ -289,8 +288,16 @@ asset.onInitialize(function () openspace.addSceneGraphNode(node) end openspace.setPropertyValueSingle("Scene.ISSparentNode.Rotation.yAxis-InvertObject", true) + end) +asset.onDeinitialize(function () + for i=1, #nodes do + openspace.removeSceneGraphNode(nodes[#nodes + 1 - i].Identifier) + end +end) + + asset.meta = { Name = "ISS", diff --git a/data/assets/util/default_keybindings.asset b/data/assets/util/default_keybindings.asset index d668759861..57d90ddaa2 100644 --- a/data/assets/util/default_keybindings.asset +++ b/data/assets/util/default_keybindings.asset @@ -144,30 +144,12 @@ openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]], } } -local DeltaTimeKeys - asset.onInitialize(function() sceneHelper.bindKeys(Keybindings) - - DeltaTimeKeys = sceneHelper.setDeltaTimeKeys({ - -- 1 2 3 4 5 6 7 8 9 0 - -------------------------------------------------------------------------------------------------------------------------- - -- 1s 2s 5s 10s 30s 1m 2m 5m 10m 30m - 1, 2, 5, 10, 30, 60, 120, 300, 600, 1800, - - -- 1h 2h 3h 6h 12h 1d 2d 4d 1w 2w - 3600, 7200, 10800, 21600, 43200, 86400, 172800, 345600, 604800, 1209600, - - -- 1mo 2mo 3mo 6mo 1yr 2y 5y 10y 20y 50y - 2592000, 5184000, 7776000, 15552000, 31536000, 63072000, 157680000, 315360000, 630720000, 1576800000 - }) - -- OBS: One month (1mo) is approximated by 30 days. end) asset.onDeinitialize(function () sceneHelper.unbindKeys(Keybindings) - sceneHelper.unbindKeys(DeltaTimeKeys) end) asset.export("DefaultKeybindings", Keybindings) -asset.export("DefaultDeltaTimeKeys", DeltaTimeKeys) diff --git a/data/assets/util/scene_helper.asset b/data/assets/util/scene_helper.asset index 9e7a87cc3c..47540c3779 100644 --- a/data/assets/util/scene_helper.asset +++ b/data/assets/util/scene_helper.asset @@ -31,42 +31,6 @@ local unbindKeys = function(keys) end asset.export("unbindKeys", unbindKeys) -local deltaTimeKeys = {} - -local setDeltaTimeKeys = function(t) - local Keys = { - '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', - 'Shift+1', 'Shift+2', 'Shift+3', 'Shift+4', 'Shift+5', 'Shift+6', 'Shift+7', 'Shift+8', 'Shift+9', 'Shift+0', - 'Ctrl+1', 'Ctrl+2', 'Ctrl+3', 'Ctrl+4', 'Ctrl+5', 'Ctrl+6', 'Ctrl+7', 'Ctrl+8', 'Ctrl+9', 'Ctrl+0', - 'Alt+1', 'Alt+2', 'Alt+3', 'Alt+4', 'Alt+5', 'Alt+6', 'Alt+7', 'Alt+8', 'Alt+9', 'Alt+0' - } - - if #t > #Keys then - openspace.printError("Error settings delta time keys: Too many delta times (" .. #t .. ")") - return - end - - unbindKeys(deltaTimeKeys) - - result = {} - for i, v in ipairs(t) do - openspace.bindKeyLocal( - Keys[i], - 'openspace.time.interpolateDeltaTime(' .. v .. ")", - 'Setting the simulation speed to ' .. v .. ' seconds per realtime second', - 'Set sim speed ' .. v, - '/Simulation Speed' - ) - table.insert(result, Keys[i]) - end - - deltaTimeKeys = result - - return result -end -asset.export("setDeltaTimeKeys", setDeltaTimeKeys) - - --shortcut function local function has_value (tab, val) for index, value in ipairs(tab) do diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 63d785dcbc..42932e3636 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -3,7 +3,7 @@ asset.require('./static_server') local guiCustomization = asset.require('customization/gui') -- Select which commit hashes to use for the frontend and backend -local frontendHash = "d85b4022813caafb0fdde18bea2c2f51768816fa" +local frontendHash = "6b5ac33a77fff6f46088c1fffdaf04d59ec5bb5f" local dataProvider = "data.openspaceproject.com/files/webgui" local frontend = asset.syncedResource({ diff --git a/data/tasks/exoplanets/csvtobin.task b/data/tasks/exoplanets/datapreparation.task similarity index 62% rename from data/tasks/exoplanets/csvtobin.task rename to data/tasks/exoplanets/datapreparation.task index 1ae7a44c6b..2d975423bf 100644 --- a/data/tasks/exoplanets/csvtobin.task +++ b/data/tasks/exoplanets/datapreparation.task @@ -1,9 +1,9 @@ -local dataFolder = "${BASE}/modules/exoplanets" +local dataFolder = "D:/dev/exoplanets data config" return { { - Type = "ExoplanetsCsvToBinTask", - - InputCSV = dataFolder .. "/exoplanets.csv", + Type = "ExoplanetsDataPreparationTask", + + InputDataFile = dataFolder .. "/exoplanets_data_composite.csv", InputSPECK = "${SYNC}/http/digitaluniverse_exoplanets_speck/1/expl.speck", TeffToBvFile = "${SYNC}/http/exoplanets_data/1/teff_bv.txt", OutputBIN = dataFolder .. "/exoplanets_data.bin", diff --git a/ext/ghoul b/ext/ghoul index a1e2f46953..8f7d89335b 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a1e2f46953a8fb77320c959453a25a8d898dc846 +Subproject commit 8f7d89335b70b0ac2007d4dd12bafa640903a8fd diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index aca56d84e6..054f490b6a 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -62,10 +62,14 @@ public: std::string documentation = "", std::string name = "", std::string guiPath = ""); void removeKeyBinding(const std::string& key); + void removeKeyBinding(const KeyWithModifier& key); std::vector> keyBinding( const std::string& key) const; + std::vector> keyBinding( + const KeyWithModifier& key) const; + static scripting::LuaLibrary luaLibrary(); void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); diff --git a/include/openspace/util/coordinateconversion.h b/include/openspace/util/coordinateconversion.h new file mode 100644 index 0000000000..7dcce4ad6e --- /dev/null +++ b/include/openspace/util/coordinateconversion.h @@ -0,0 +1,44 @@ +/***************************************************************************************** + * * + * 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___COORDINATECONVERSION___H__ +#define __OPENSPACE_CORE___COORDINATECONVERSION___H__ + +#include + +namespace openspace { + +/** + * Converts from ICRS coordinates to galactic cartesian coordinates. + * \param ra Right ascension, given in decimal degrees + * \param dec Declination, given in decimal degrees + * \param distance The distance, or radius, to the position given in any unit. + * \return A position in galactic cartesian coordinates, given in the same unit as the + * distance parameter. + */ +glm::dvec3 icrsToGalacticCartesian(float ra, float dec, double distance); + +} // namespace openspace + +#endif // __OPENSPACE_CORE___COORDINATECONVERSION___H__ diff --git a/include/openspace/util/timemanager.h b/include/openspace/util/timemanager.h index 45f2524d74..2297e29a18 100644 --- a/include/openspace/util/timemanager.h +++ b/include/openspace/util/timemanager.h @@ -25,6 +25,9 @@ #ifndef __OPENSPACE_CORE___TIMEMANAGER___H__ #define __OPENSPACE_CORE___TIMEMANAGER___H__ +#include +#include +#include #include #include #include @@ -33,14 +36,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - namespace openspace { struct TimeKeyframeData { @@ -130,6 +125,9 @@ private: TimeKeyframeData interpolate(const Keyframe& past, const Keyframe& future, double time); + void addDeltaTimesKeybindings(); + void clearDeltaTimesKeybindings(); + Timeline _timeline; SyncData