mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
Show some information when NewHorizons is not present
This commit is contained in:
@@ -188,7 +188,7 @@ bool RenderEngine::initialize() {
|
||||
// init camera and set temporary position and scaling
|
||||
_mainCamera = new Camera();
|
||||
_mainCamera->setScaling(glm::vec2(1.0, -8.0));
|
||||
_mainCamera->setPosition(psc(0.f, 0.f, 1.499823f, 11.f));
|
||||
_mainCamera->setPosition(psc(0.5f, 0.f, 1.499823f, 11.f));
|
||||
|
||||
OsEng.interactionHandler().setCamera(_mainCamera);
|
||||
if (_renderer) {
|
||||
@@ -1164,35 +1164,38 @@ void RenderEngine::renderInformation() {
|
||||
);
|
||||
|
||||
#ifdef OPENSPACE_MODULE_NEWHORIZONS_ENABLED
|
||||
|
||||
bool hasNewHorizons = scene()->sceneGraphNode("NewHorizons");
|
||||
if (openspace::ImageSequencer::ref().isReady() && hasNewHorizons) {
|
||||
|
||||
if (openspace::ImageSequencer::ref().isReady()) {
|
||||
penPosition.y -= 25.f;
|
||||
|
||||
glm::vec4 targetColor(0.00, 0.75, 1.00, 1);
|
||||
|
||||
try {
|
||||
double lt;
|
||||
glm::dvec3 p =
|
||||
SpiceManager::ref().targetPosition("PLUTO", "NEW HORIZONS", "GALACTIC", {}, currentTime, lt);
|
||||
psc nhPos = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
|
||||
float a, b, c;
|
||||
glm::dvec3 radii;
|
||||
SpiceManager::ref().getValue("PLUTO", "RADII", radii);
|
||||
a = radii.x;
|
||||
b = radii.y;
|
||||
c = radii.z;
|
||||
float radius = (a + b) / 2.f;
|
||||
float distToSurf = glm::length(nhPos.vec3()) - radius;
|
||||
if (hasNewHorizons) {
|
||||
try {
|
||||
double lt;
|
||||
glm::dvec3 p =
|
||||
SpiceManager::ref().targetPosition("PLUTO", "NEW HORIZONS", "GALACTIC", {}, currentTime, lt);
|
||||
psc nhPos = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
|
||||
float a, b, c;
|
||||
glm::dvec3 radii;
|
||||
SpiceManager::ref().getValue("PLUTO", "RADII", radii);
|
||||
a = radii.x;
|
||||
b = radii.y;
|
||||
c = radii.z;
|
||||
float radius = (a + b) / 2.f;
|
||||
float distToSurf = glm::length(nhPos.vec3()) - radius;
|
||||
|
||||
RenderFont(*_fontInfo,
|
||||
penPosition,
|
||||
"Distance to Pluto: % .1f (KM)",
|
||||
distToSurf
|
||||
RenderFont(*_fontInfo,
|
||||
penPosition,
|
||||
"Distance to Pluto: % .1f (KM)",
|
||||
distToSurf
|
||||
);
|
||||
penPosition.y -= _fontInfo->height();
|
||||
penPosition.y -= _fontInfo->height();
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
double remaining = openspace::ImageSequencer::ref().getNextCaptureTime() - currentTime;
|
||||
float t = static_cast<float>(1.0 - remaining / openspace::ImageSequencer::ref().getIntervalLength());
|
||||
|
||||
Reference in New Issue
Block a user