Merge branch 'master' into feature/grid-labels

This commit is contained in:
Malin E
2022-09-14 10:42:56 +02:00
5 changed files with 68 additions and 67 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ int main(int argc, char** argv) {
// Register the base path as the directory where the configuration file lives
std::filesystem::path base = configFile.parent_path();
constexpr std::string_view BasePathToken = "${BASE}";
FileSys.registerPathToken(BasePathToken, base);
FileSys.registerPathToken(BasePathToken.data(), base);
// Using same configuration for size as in apps/OpenSpace/main.cpp
glm::ivec2 size = glm::ivec2(1920, 1080);
+62 -61
View File
@@ -2,76 +2,77 @@ local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
local sunAsset = asset.require('scene/solarsystem/sun/sun')
local modelFolder = asset.syncedResource({
Name = "Eiffel Tower Model",
Type = "HttpSynchronization",
Identifier = "eiffel_tower_model",
Version = 1
Name = "Eiffel Tower Model",
Type = "HttpSynchronization",
Identifier = "eiffel_tower_model",
Version = 1
})
local eiffelTower = {
Identifier = "eiffelTower",
Parent = earthAsset.Earth.Identifier,
--Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
Altitude = 0.0,
UseHeightmap = true
},
Rotation = {
Type = "GlobeRotation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
UseHeightmap = false
},
Scale = {
Type = "StaticScale",
Scale = 4.38
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = modelFolder .. "eiffeltower.osmodel",
ModelScale = "Centimeter",
RotationVector = { 0.0, 45.0, 0.0 },
LightSources = { sunAsset.LightSource }
},
GUI = {
Name = "Eiffel Tower",
Path = "/Scale Objects"
}
Identifier = "eiffelTower",
Parent = earthAsset.Earth.Identifier,
--Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
Altitude = 0.0,
UseHeightmap = true
},
Rotation = {
Type = "GlobeRotation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
UseHeightmap = false
},
Scale = {
Type = "StaticScale",
Scale = 4.38
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = modelFolder .. "eiffeltower.osmodel",
ModelScale = "Centimeter",
RotationVector = { 0.0, 45.0, 0.0 },
LightSources = { sunAsset.LightSource }
},
GUI = {
Name = "Eiffel Tower",
Path = "/Scale Objects"
}
}
local updatePositionAction = {
Identifier = "os.drop_eiffel_tower",
Name = "Drop Eiffel Tower under camera",
Command = [[local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera();
local camera = openspace.navigation.getNavigationState();
openspace.setParent('eiffelTower', camera.Anchor)
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon);
]],
Documentation = "Updates the Eiffel Tower position based on the globe location of the camera",
GuiPath = "/Scale Objects",
IsLocal = false
Identifier = "os.drop_eiffel_tower",
Name = "Drop Eiffel Tower under camera",
Command = [[
local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera();
local camera = openspace.navigation.getNavigationState();
openspace.setParent('eiffelTower', camera.Anchor)
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon);
]],
Documentation = "Updates the Eiffel Tower position based on the globe location of the camera",
GuiPath = "/Scale Objects",
IsLocal = false
}
asset.onInitialize(function()
openspace.addSceneGraphNode(eiffelTower)
openspace.action.registerAction(updatePositionAction)
openspace.addSceneGraphNode(eiffelTower)
openspace.action.registerAction(updatePositionAction)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(updatePositionAction)
openspace.removeSceneGraphNode(eiffelTower)
openspace.action.removeAction(updatePositionAction)
openspace.removeSceneGraphNode(eiffelTower)
end)
asset.export(eiffelTower)
+3 -3
View File
@@ -48,7 +48,7 @@ local SunLabel = {
local LightSource = {
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = transforms.SolarSystemBarycenter.Identifier,
Node = Sun.Identifier,
Intensity = 1.0
}
@@ -56,12 +56,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(Sun)
openspace.addSceneGraphNode(SunLabel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(SunLabel)
openspace.removeSceneGraphNode(Sun)
end)
asset.export(Sun)
asset.export(SunLabel)
asset.export("LightSource", LightSource)
+1 -1
View File
@@ -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 = "aeffda7eef46f4eaddfebcb41389672d2c473b35"
local frontendHash = "9f0298993d738f487c93c559084593945b5e093e"
local dataProvider = "data.openspaceproject.com/files/webgui"
local frontend = asset.syncedResource({
+1 -1
View File
@@ -499,7 +499,7 @@ std::vector<Parameters> readOmmFile(std::filesystem::path file) {
std::optional<Parameters> current = std::nullopt;
std::string line;
while (std::getline(f, line)) {
if (line.empty()) {
if (line.empty() || line == "\r") {
continue;
}