diff --git a/modules/space/rendering/renderablesatellites.cpp b/modules/space/rendering/renderablesatellites.cpp index b910b86698..cde34ec054 100644 --- a/modules/space/rendering/renderablesatellites.cpp +++ b/modules/space/rendering/renderablesatellites.cpp @@ -593,7 +593,12 @@ void RenderableSatellites::updateBuffers() { double timeOffset = orbit.period * static_cast(i)/ static_cast(_nSegments); - glm::dvec3 position = _keplerTranslator.debrisPos(timeOffset + orbit.epoch); + glm::dvec3 position = _keplerTranslator.position({ + {}, + Time(timeOffset + orbit.epoch), + Time(0.0), + false + }); double positionX = position.x; double positionY = position.y; diff --git a/modules/space/rendering/renderablesatellites.h b/modules/space/rendering/renderablesatellites.h index 39b640f085..d3143d564e 100644 --- a/modules/space/rendering/renderablesatellites.h +++ b/modules/space/rendering/renderablesatellites.h @@ -1,26 +1,26 @@ -// /**************************************************************************************** -// * * -// * OpenSpace * -// * * -// * Copyright (c) 2014-2018 * -// * * -// * 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. * -// ****************************************************************************************/ +/**************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2018 * + * * + * 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_MODULE_BASE___RenderableSatellites___H__ #define __OPENSPACE_MODULE_BASE___RenderableSatellites___H__ diff --git a/modules/space/tasks/generatedebrisvolumetask.cpp b/modules/space/tasks/generatedebrisvolumetask.cpp index 51fa44b89e..b7f1ba4880 100644 --- a/modules/space/tasks/generatedebrisvolumetask.cpp +++ b/modules/space/tasks/generatedebrisvolumetask.cpp @@ -412,8 +412,12 @@ std::vector getPositionBuffer(std::vector tleData, orbit.period, orbit.epoch ); - // double timeInSeconds = Time::convertTime(timeStamp); - glm::dvec3 position = keplerTranslator.debrisPos(timeInSeconds); + glm::dvec3 position = keplerTranslator.position({ + {}, + Time(timeInSeconds), + Time(0.0), + false + }); // LINFO(fmt::format("cart: {} ", position)); glm::dvec3 sphPos; if( gridType == "Spherical"){ diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index 076b71b027..1e1dddd7b9 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -290,27 +290,7 @@ glm::dvec3 KeplerTranslation::position(const UpdateData& data) const { _orbitPlaneDirty = false; } - const double t = data.time.j2000Seconds() - _epoch; - const double meanMotion = glm::two_pi() / _period; - const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch.value()) + t * meanMotion; - const double e = eccentricAnomaly(meanAnomaly); - - // Use the eccentric anomaly to compute the actual location - const glm::dvec3 p = { - _semiMajorAxis * 1000.0 * (cos(e) - _eccentricity), - _semiMajorAxis * 1000.0 * sin(e) * sqrt(1.0 - _eccentricity * _eccentricity), - 0.0 - }; - return _orbitPlaneRotation * p; -} - -glm::dvec3 KeplerTranslation::debrisPos(const double& time) const { - if (_orbitPlaneDirty) { - computeOrbitPlane(); - _orbitPlaneDirty = false; - } - - const double t = time -_epoch; + const double t = data.time.j2000Seconds() -_epoch; const double meanMotion = glm::two_pi() / _period; const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch.value()) + t * meanMotion; const double e = eccentricAnomaly(meanAnomaly); diff --git a/modules/space/translation/keplertranslation.h b/modules/space/translation/keplertranslation.h index c8671089e2..20eabc3cea 100644 --- a/modules/space/translation/keplertranslation.h +++ b/modules/space/translation/keplertranslation.h @@ -70,10 +70,6 @@ public: */ glm::dvec3 position(const UpdateData& data) const override; - // Is only used in renderableDebris / satellites. - glm::dvec3 debrisPos(const double& time) const; - - /** * Method returning the openspace::Documentation that describes the ghoul::Dictinoary * that can be passed to the constructor. diff --git a/openspace.cfg b/openspace.cfg index 2b22bc003b..d34aae67c9 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -6,14 +6,13 @@ -- occurs in a single window, a fisheye projection, or a dome cluster system -- A regular 1280x720 window --- SGCTConfig = sgct.config.single{} +SGCTConfig = sgct.config.single{} -- A regular 1920x1080 window -- SGCTConfig = sgct.config.single{1920, 1080} -- A windowed 1920x1080 fullscreen - -SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}} +-- SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}} -- One window for the GUI and one window for Rendering. Good for presenting on a projector. -- SGCTConfig = "${CONFIG}/single_gui.xml"