mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 14:29:42 -05:00
Merge branch 'feature/rosetta' into develop
This commit is contained in:
@@ -7,7 +7,8 @@ function preInitialization()
|
||||
]]--
|
||||
|
||||
openspace.time.setTime("2014 AUG 21 18:00:00")
|
||||
dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua'))
|
||||
-- openspace.time.setTime("2015 SEP 10 19:39:00")
|
||||
dofile(openspace.absPath('${SCRIPTS}/bind_keys_rosetta.lua'))
|
||||
end
|
||||
|
||||
function postInitialization()
|
||||
|
||||
@@ -23,7 +23,7 @@ return {
|
||||
Destination = "GALACTIC"
|
||||
},
|
||||
Projection = {
|
||||
Sequence = "rosettaimages",
|
||||
Sequence = "rosettaimages2",
|
||||
SequenceType = "image-sequence",
|
||||
Observer = "ROSETTA",
|
||||
Target = "CHURYUMOV-GERASIMENKO",
|
||||
@@ -78,28 +78,40 @@ return {
|
||||
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp",
|
||||
-- SPK
|
||||
--long term orbits loaded first
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/LORL_DL_009_02____P__00268.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/RORL_DL_009_02____P__00268.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/CORL_DL_009_02____P__00268.BSP',
|
||||
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORL_DL_006_01____H__00156.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORL_DL_006_01____H__00156.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORL_DL_006_01____H__00156.BSP',
|
||||
|
||||
--Jan 2014 - May 2015 (version match with 00162 ck files)
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/CORB_DV_211_01_______00288.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/RORB_DV_211_01_______00288.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/LORB_DV_211_01_______00288.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORB_DV_097_01_______00162.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORB_DV_097_01_______00162.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORB_DV_097_01_______00162.BSP",
|
||||
|
||||
--SCLK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SCLK/ROS_160425_STEP.TSC",
|
||||
|
||||
-- FK
|
||||
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_CHURYUMOV_V01.TF",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/FK/ROS_CHURYUMOV_V01.TF",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/FK/ROS_V26.TF",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
|
||||
-- CK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/RATT_DV_211_01_01____00288.BC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/CATT_DV_211_01_______00288.BC",
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/CK/RATT_DV_097_01_01____00162.BC',
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/CK/CATT_DV_097_01_______00162.BC",
|
||||
|
||||
-- PCK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/PCK/ROS_CGS_RSOC_V03.TPC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/PCK/ROS_CGS_RSOC_V03.TPC",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/PCK/ROS_CGS_RSOC_V03.TPC",
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,31 +30,33 @@ return {
|
||||
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp",
|
||||
-- SPK
|
||||
--long term orbits loaded first
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORL_DL_006_01____H__00156.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORL_DL_006_01____H__00156.BSP',
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORL_DL_006_01____H__00156.BSP',
|
||||
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORL_DL_006_01____H__00156.BSP',
|
||||
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORL_DL_006_01____H__00156.BSP',
|
||||
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORL_DL_006_01____H__00156.BSP',
|
||||
|
||||
--Jan 2014 - May 2015 (version match with 00162 ck files)
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORB_DV_097_01_______00162.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORB_DV_097_01_______00162.BSP",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORB_DV_097_01_______00162.BSP",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORB_DV_097_01_______00162.BSP",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORB_DV_097_01_______00162.BSP",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORB_DV_097_01_______00162.BSP",
|
||||
|
||||
--IK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/IK/ROS_NAVCAM_V01.TI",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/IK/ROS_NAVCAM_V00-20130102.TI",
|
||||
|
||||
--SCLK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
|
||||
|
||||
-- FK
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_CHURYUMOV_V01.TF",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_CHURYUMOV_V01.TF",
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
|
||||
|
||||
-- CK
|
||||
'${OPENSPACE_DATA}/spice/RosettaKernels/CK/RATT_DV_097_01_01____00162.BC',
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/CK/CATT_DV_097_01_______00162.BC",
|
||||
-- '${OPENSPACE_DATA}/spice/RosettaKernels/CK/RATT_DV_097_01_01____00162.BC',
|
||||
-- "${OPENSPACE_DATA}/spice/RosettaKernels/CK/CATT_DV_097_01_______00162.BC",
|
||||
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/CK/ROS_SA_2014_V0044.BC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels/CK/ROS_SA_2015_V0009.BC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2014_V0047.BC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2015_V0042.BC",
|
||||
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2016_V0019.BC",
|
||||
}
|
||||
},
|
||||
GuiName = "/Solar/Rosetta"
|
||||
@@ -90,18 +92,16 @@ return {
|
||||
Body = "ROSETTA",
|
||||
Frame = "GALACTIC",
|
||||
Observer = "CHURYUMOV-GERASIMENKO",
|
||||
-- 3 Dummy values for compilation:
|
||||
TropicalOrbitPeriod = 20000.0,
|
||||
EarthOrbitRatio = 2,
|
||||
DayLength = 25,
|
||||
-- End of Dummy values
|
||||
RGB = { 0.9, 0.2, 0.9 },
|
||||
Textures = {
|
||||
Type = "simple",
|
||||
Color = "textures/glare.png"
|
||||
},
|
||||
StartTime = "2014 AUG 01 12:00:00",
|
||||
EndTime = "2015 MAY 26 12:00:00"
|
||||
EndTime = "2016 MAY 26 12:00:00"
|
||||
},
|
||||
GuiName = "RosettaCometTrail"
|
||||
},
|
||||
|
||||
+1
-1
Submodule ext/ghoul updated: 3ef4b9e9e4...5c9f358af8
@@ -231,6 +231,11 @@ void RenderableTrail::update(const UpdateData& data) {
|
||||
|
||||
psc pscPos = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
|
||||
|
||||
static int NVALUES = 0;
|
||||
if (nValues > NVALUES) {
|
||||
LINFO(nValues);
|
||||
NVALUES = nValues;
|
||||
}
|
||||
|
||||
pscPos[3] += 3; // KM to M
|
||||
_vertexArray[0] = { pscPos[0], pscPos[1], pscPos[2], pscPos[3] };
|
||||
@@ -240,9 +245,10 @@ void RenderableTrail::update(const UpdateData& data) {
|
||||
// close to 1
|
||||
|
||||
// But you never know
|
||||
nValues = std::min(nValues, int(_vertexArray.size() - 1));
|
||||
//nValues = std::min(nValues, int(_vertexArray.size() - 1));
|
||||
//LINFO(nValues);
|
||||
std::vector<TrailVBOLayout> tmp = _vertexArray;
|
||||
std::vector<TrailVBOLayout> tmp(nValues);
|
||||
//std::vector<TrailVBOLayout> tmp = _vertexArray;
|
||||
|
||||
for (int i = nValues; i > 0; --i) {
|
||||
double et = _oldTime + i * _increment;
|
||||
@@ -254,11 +260,13 @@ void RenderableTrail::update(const UpdateData& data) {
|
||||
SpiceManager::ref().targetPosition(_target, _observer, _frame, {}, et, lightTime);
|
||||
pscPos = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
|
||||
pscPos[3] += 3;
|
||||
_vertexArray[i] = { pscPos[0], pscPos[1], pscPos[2], pscPos[3] };
|
||||
tmp[nValues - i] = { pscPos[0], pscPos[1], pscPos[2], pscPos[3] };
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < tmp.size() - (nValues + 1); ++i)
|
||||
_vertexArray[nValues + 1 + i] = tmp[i + 1];
|
||||
size_t size = _vertexArray.size();
|
||||
_vertexArray.insert(_vertexArray.begin() + 1, tmp.begin(), tmp.end());
|
||||
_vertexArray.resize(size);
|
||||
|
||||
_oldTime += nValues * _increment;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@ bool RenderableModelProjection::initialize() {
|
||||
"${MODULE_NEWHORIZONS}/shaders/modelShader_vs.glsl",
|
||||
"${MODULE_NEWHORIZONS}/shaders/modelShader_fs.glsl");
|
||||
|
||||
|
||||
if (!_programObject)
|
||||
return false;
|
||||
}
|
||||
@@ -207,6 +208,7 @@ bool RenderableModelProjection::initialize() {
|
||||
_fboProgramObject = ghoul::opengl::ProgramObject::Build("ProjectionPass",
|
||||
"${MODULE_NEWHORIZONS}/shaders/projectionPass_vs.glsl",
|
||||
"${MODULE_NEWHORIZONS}/shaders/projectionPass_fs.glsl");
|
||||
_fboProgramObject->setIgnoreUniformLocationError(ghoul::opengl::ProgramObject::IgnoreError::Yes);
|
||||
if (!_fboProgramObject)
|
||||
return false;
|
||||
}
|
||||
@@ -408,7 +410,8 @@ void RenderableModelProjection::update(const UpdateData& data) {
|
||||
}
|
||||
|
||||
void RenderableModelProjection::imageProjectGPU() {
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
// keep handle to the current bound FBO
|
||||
GLint defaultFBO;
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
|
||||
@@ -446,12 +449,13 @@ void RenderableModelProjection::imageProjectGPU() {
|
||||
glBindVertexArray(0);
|
||||
|
||||
_fboProgramObject->deactivate();
|
||||
glDisable(GL_BLEND);
|
||||
//glDisable(GL_BLEND);
|
||||
//bind back to default
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
|
||||
glViewport(m_viewport[0], m_viewport[1],
|
||||
m_viewport[2], m_viewport[3]);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
void RenderableModelProjection::attitudeParameters(double time) {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--[[ OpenSpace keybinding script ]]--
|
||||
-- This script sets the default keybindings and is executed at startup
|
||||
|
||||
openspace.clearKeys()
|
||||
openspace.bindKey("F1", "openspace.gui.toggle()")
|
||||
openspace.bindKey("F2", "openspace.setPerformanceMeasurement(true)")
|
||||
openspace.bindKey("F3", "openspace.setPerformanceMeasurement(false)")
|
||||
openspace.bindKey("F5", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun'); openspace.printInfo('Changing Viewpoint to Sun-in-center');");
|
||||
openspace.bindKey("F6", "openspace.setPropertyValue('Interaction.coordinateSystem', '67P'); openspace.printInfo('Changing Viewpoint to 67P-in-center');");
|
||||
|
||||
openspace.bindKey("PRINT_SCREEN", "openspace.takeScreenshot()")
|
||||
|
||||
openspace.bindKey("SPACE", "openspace.time.togglePause()")
|
||||
|
||||
-- Bookmarks for the New Horizons encounter
|
||||
openspace.bindKey("1", "openspace.time.setDeltaTime(1)")
|
||||
openspace.bindKey("2", "openspace.time.setDeltaTime(5)")
|
||||
openspace.bindKey("3", "openspace.time.setDeltaTime(10)")
|
||||
openspace.bindKey("4", "openspace.time.setDeltaTime(20)")
|
||||
openspace.bindKey("5", "openspace.time.setDeltaTime(40)")
|
||||
openspace.bindKey("6", "openspace.time.setDeltaTime(90)")
|
||||
openspace.bindKey("7", "openspace.time.setDeltaTime(360)")
|
||||
openspace.bindKey("8", "openspace.time.setDeltaTime(720)")
|
||||
openspace.bindKey("9", "openspace.time.setDeltaTime(2880)")
|
||||
openspace.bindKey("0", "openspace.time.setDeltaTime(14400)")
|
||||
openspace.bindKey("SHIFT+1", "openspace.time.setDeltaTime(28800)")
|
||||
openspace.bindKey("SHIFT+2", "openspace.time.setDeltaTime(57600)")
|
||||
openspace.bindKey("SHIFT+3", "openspace.time.setDeltaTime(115200)")
|
||||
openspace.bindKey("SHIFT+4", "openspace.time.setDeltaTime(230400)")
|
||||
openspace.bindKey("SHIFT+5", "openspace.time.setDeltaTime(460800)")
|
||||
|
||||
openspace.bindKey("i", "local b = openspace.getPropertyValue('ImagePlaneRosetta.renderable.enabled'); openspace.setPropertyValue('ImagePlaneRosetta.renderable.enabled', not b)")
|
||||
|
||||
openspace.bindKey("F8", "openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);")
|
||||
|
||||
openspace.bindKey("a", "openspace.setPropertyValue('Interaction.origin', '67P')")
|
||||
openspace.bindKey("s", "openspace.setPropertyValue('Interaction.origin', 'Rosetta')")
|
||||
|
||||
openspace.bindKey("q", "local b = openspace.getPropertyValue('SunMarker.renderable.enabled'); openspace.setPropertyValue('SunMarker.renderable.enabled', not b)")
|
||||
openspace.bindKey("e", "local b = openspace.getPropertyValue('EarthMarker.renderable.enabled'); openspace.setPropertyValue('EarthMarker.renderable.enabled', not b)")
|
||||
|
||||
openspace.bindKey("c", "openspace.parallel.setAddress('130.236.142.51');openspace.parallel.setPassword('newhorizons-20150714');openspace.parallel.connect();")
|
||||
|
||||
openspace.bindKey("COMMA", "openspace.setRenderer('Framebuffer');")
|
||||
openspace.bindKey("PERIOD", "openspace.setRenderer('ABuffer');")
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/thread.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
@@ -274,13 +275,14 @@ void DownloadManager::downloadRequestFilesAsync(const std::string& identifier,
|
||||
if (_useMultithreadedDownload) {
|
||||
std::thread t = std::thread(downloadFunction);
|
||||
|
||||
#ifdef WIN32
|
||||
std::thread::native_handle_type h = t.native_handle();
|
||||
SetPriorityClass(h, IDLE_PRIORITY_CLASS);
|
||||
SetThreadPriority(h, THREAD_PRIORITY_LOWEST);
|
||||
#else
|
||||
// TODO: Implement thread priority ---abock
|
||||
#endif
|
||||
ghoul::thread::setPriority(t, ghoul::thread::ThreadPriority::Lowest);
|
||||
//#ifdef WIN32
|
||||
// std::thread::native_handle_type h = t.native_handle();
|
||||
// SetPriorityClass(h, IDLE_PRIORITY_CLASS);
|
||||
// SetThreadPriority(h, THREAD_PRIORITY_LOWEST);
|
||||
//#else
|
||||
// // TODO: Implement thread priority ---abock
|
||||
//#endif
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
@@ -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,33 +1164,38 @@ void RenderEngine::renderInformation() {
|
||||
);
|
||||
|
||||
#ifdef OPENSPACE_MODULE_NEWHORIZONS_ENABLED
|
||||
bool hasNewHorizons = scene()->sceneGraphNode("NewHorizons");
|
||||
|
||||
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