mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-29 07:30:07 -06:00
Merge branch 'feature/mars-moons' into project/spaceship-installation
This commit is contained in:
@@ -8,8 +8,6 @@ asset.require('./jupiter/ganymede/default_layers')
|
||||
asset.require('./jupiter/io/default_layers')
|
||||
|
||||
asset.require('./mars/default_layers')
|
||||
asset.require('./mars/moons/layers/colorlayers/deimos_viking')
|
||||
asset.require('./mars/moons/layers/colorlayers/phobos_viking')
|
||||
|
||||
asset.require('./mercury/default_layers')
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
local transforms = asset.require('../transforms')
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('../transforms')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local kernels = asset.require('../mar097').Kernels
|
||||
|
||||
local model = asset.syncedResource({
|
||||
Name = "Deimos Model",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "deimos_model",
|
||||
Version = 1
|
||||
})
|
||||
|
||||
local Deimos = {
|
||||
Identifier = "Deimos",
|
||||
@@ -21,10 +28,21 @@ local Deimos = {
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableGlobe",
|
||||
Radii = { 15000, 12200, 11000 },
|
||||
SegmentsPerPatch = 90,
|
||||
Layers = {}
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/Deimos_1_1000.glb",
|
||||
ModelScale = 2000,
|
||||
AmbientIntensity = 0.02,
|
||||
SpecularIntensity = 0.0,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" },
|
||||
GUI = {
|
||||
@@ -62,7 +80,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { Deimos, DeimosTrail })
|
||||
asset.meta = {
|
||||
Name = "Deimos",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableGlobe and Trail for Deimos.]],
|
||||
Description = [[ RenderableModel and Trail for Deimos.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('../transforms')
|
||||
local kernels = asset.require('../mar097').Kernels
|
||||
|
||||
|
||||
local DeimosGlobe = {
|
||||
Identifier = "Deimos_Globe",
|
||||
Parent = transforms.MarsBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_DEIMOS",
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = kernels
|
||||
},
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "DEIMOS",
|
||||
Observer = "MARS BARYCENTER",
|
||||
Kernels = kernels
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableGlobe",
|
||||
Radii = { 15000, 12200, 11000 },
|
||||
SegmentsPerPatch = 90,
|
||||
Layers = {}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" },
|
||||
GUI = {
|
||||
Name = "Deimos_Globe",
|
||||
Path = "/Solar System/Planets/Mars",
|
||||
Description = [[One of two moons of Mars.]]
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { DeimosGlobe })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Deimos Globe",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableGlobe for Deimos.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"Deimos"}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
local globeIdentifier = asset.require("./../../deimos").Deimos.Identifier
|
||||
local globeIdentifier = asset.require("./../../deimos_globe").Deimos_Globe.Identifier
|
||||
|
||||
local layer = {
|
||||
Identifier = "Deimos_Global_Mosaic_USGS",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local globeIdentifier = asset.require("./../../phobos").Phobos.Identifier
|
||||
local globeIdentifier = asset.require("./../../phobos_globe").Phobos_Globe.Identifier
|
||||
|
||||
local layer = {
|
||||
Identifier = "Phobos_Global_Shaded_Relief_USGS",
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
local transforms = asset.require('../transforms')
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('../transforms')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local kernels = asset.require('../mar097').Kernels
|
||||
|
||||
local model = asset.syncedResource({
|
||||
Name = "Phobos Model",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "phobos_model",
|
||||
Version = 1
|
||||
})
|
||||
|
||||
local Phobos = {
|
||||
Identifier = "Phobos",
|
||||
@@ -21,10 +28,21 @@ local Phobos = {
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableGlobe",
|
||||
Radii = { 27000, 22000, 18000 },
|
||||
SegmentsPerPatch = 90,
|
||||
Layers = {}
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/Phobos_1_1000.glb",
|
||||
ModelScale = 2000,
|
||||
AmbientIntensity = 0.02,
|
||||
SpecularIntensity = 0.0,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" },
|
||||
GUI = {
|
||||
@@ -62,7 +80,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { Phobos, PhobosTrail })
|
||||
asset.meta = {
|
||||
Name = "Phobos",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableGlobe and Trail for Phobos.]],
|
||||
Description = [[ RenderableModel and Trail for Phobos.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('../transforms')
|
||||
local kernels = asset.require('../mar097').Kernels
|
||||
|
||||
|
||||
local PhobosGlobe = {
|
||||
Identifier = "Phobos_Globe",
|
||||
Parent = transforms.MarsBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_PHOBOS",
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = kernels
|
||||
},
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "PHOBOS",
|
||||
Observer = "MARS BARYCENTER",
|
||||
Kernels = kernels
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableGlobe",
|
||||
Radii = { 27000, 22000, 18000 },
|
||||
SegmentsPerPatch = 90,
|
||||
Layers = {}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" },
|
||||
GUI = {
|
||||
Name = "Phobos_Globe",
|
||||
Path = "/Solar System/Planets/Mars",
|
||||
Description = [[One of two moons of Mars.]]
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { PhobosGlobe })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Phobos Globe",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableGlobe for Phobos.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"Phobos"}
|
||||
}
|
||||
@@ -131,8 +131,7 @@ void NavigationHandler::setCamera(Camera* camera) {
|
||||
_orbitalNavigator.setCamera(camera);
|
||||
}
|
||||
|
||||
void NavigationHandler::setNavigationStateNextFrame(NavigationState state)
|
||||
{
|
||||
void NavigationHandler::setNavigationStateNextFrame(NavigationState state) {
|
||||
_pendingNavigationState = std::move(state);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,16 +95,17 @@ NavigationState::NavigationState(std::string anchor_, std::string aim_,
|
||||
CameraPose NavigationState::cameraPose() const {
|
||||
const SceneGraphNode* referenceFrameNode = sceneGraphNode(referenceFrame);
|
||||
const SceneGraphNode* anchorNode = sceneGraphNode(anchor);
|
||||
const SceneGraphNode* aimNode = sceneGraphNode(aim);
|
||||
|
||||
if (!anchorNode) {
|
||||
LERROR(fmt::format(
|
||||
"Could not find scene graph node '{}' used as anchor.", referenceFrame
|
||||
"Could not find scene graph node '{}' used as anchor.", anchor
|
||||
));
|
||||
return CameraPose();
|
||||
}
|
||||
if (!aim.empty() && !sceneGraphNode(aim)) {
|
||||
if (!aim.empty() && !aimNode) {
|
||||
LERROR(fmt::format(
|
||||
"Could not find scene graph node '{}' used as aim.", referenceFrame
|
||||
"Could not find scene graph node '{}' used as aim.", aim
|
||||
));
|
||||
return CameraPose();
|
||||
}
|
||||
@@ -116,6 +117,9 @@ CameraPose NavigationState::cameraPose() const {
|
||||
return CameraPose();
|
||||
}
|
||||
|
||||
// @TODO (2021-12-01, emmbr) The aim is not used at all below, so this code does
|
||||
// not work if the navigation state has a defined aim node. This should be fixed
|
||||
|
||||
CameraPose resultingPose;
|
||||
|
||||
const glm::dvec3 anchorWorldPosition = anchorNode->worldPosition();
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <glm/gtx/vector_angle.hpp>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
namespace {
|
||||
constexpr const double Epsilon = 1e-5;
|
||||
} // namespace
|
||||
@@ -87,7 +89,7 @@ int goTo(lua_State* L) {
|
||||
}
|
||||
|
||||
ghoul::Dictionary insDict;
|
||||
insDict.setValue("TargetType", std::string("Node"));
|
||||
insDict.setValue("TargetType", "Node"s);
|
||||
insDict.setValue("Target", nodeIdentifier);
|
||||
if (useUpFromTargetOrDuration.has_value()) {
|
||||
if (std::holds_alternative<bool>(*useUpFromTargetOrDuration)) {
|
||||
@@ -134,7 +136,7 @@ int goToHeight(lua_State* L) {
|
||||
}
|
||||
|
||||
ghoul::Dictionary insDict;
|
||||
insDict.setValue("TargetType", std::string("Node"));
|
||||
insDict.setValue("TargetType", "Node"s);
|
||||
insDict.setValue("Target", nodeIdentifier);
|
||||
insDict.setValue("Height", height);
|
||||
if (useUpFromTargetOrDuration.has_value()) {
|
||||
@@ -189,7 +191,7 @@ int goToNavigationState(lua_State* L) {
|
||||
}
|
||||
|
||||
ghoul::Dictionary instruction;
|
||||
instruction.setValue("TargetType", std::string("NavigationState"));
|
||||
instruction.setValue("TargetType", "NavigationState"s);
|
||||
instruction.setValue("NavigationState", navigationState);
|
||||
|
||||
if (duration.has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user