diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_shared.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_shared.asset index b5adee1e54..c8b316db95 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_shared.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_shared.asset @@ -114,7 +114,6 @@ local addSatelliteGroupObjects = function(group, tleFolder, shouldAddDuplicates) Body = title, Observer = transforms.EarthInertial.Identifier, File = file, - LineNumber = lineNum }, -- Size = 3e4, diff --git a/modules/space/rendering/renderablesatellites.cpp b/modules/space/rendering/renderablesatellites.cpp index 43384d491e..4eb7ab5df2 100644 --- a/modules/space/rendering/renderablesatellites.cpp +++ b/modules/space/rendering/renderablesatellites.cpp @@ -244,11 +244,8 @@ RenderableSatellites::RenderableSatellites(const ghoul::Dictionary& dictionary) */ const std::string& file = dictionary.value(KeyFile); - int lineNum = 1; - if (dictionary.hasKeyAndValue(KeyLineNum)) { - lineNum = static_cast(dictionary.value(KeyLineNum)); - readTLEFile(file, lineNum); - } + readTLEFile(file); + } // The list of leap years only goes until 2056 as we need to touch this file then // again anyway ;) @@ -442,7 +439,7 @@ double epochFromSubstring(const std::string& epochString) { return epoch; } -void RenderableSatellites::readTLEFile(const std::string& filename, int lineNum){ +void RenderableSatellites::readTLEFile(const std::string& filename){ ghoul_assert(FileSys.fileExists(filename), "The filename must exist"); std::ifstream file; @@ -554,20 +551,6 @@ void RenderableSatellites::readTLEFile(const std::string& filename, int lineNum) double period = seconds(hours(24)).count() / keplerElements.meanMotion; - //TODO: fix obv - size_t i = 0; - - _orbits[i++] = KeplerTranslation::KeplerOrbit{ - keplerElements.eccentricity, - keplerElements.semiMajorAxis, - keplerElements.inclination, - keplerElements.ascendingNode, - keplerElements.argumentOfPeriapsis, - keplerElements.meanAnomaly, - period, - keplerElements.epoch - }; - /* KeplerTranslation setKeplerElements( keplerElements.eccentricity, @@ -694,8 +677,9 @@ void RenderableSatellites::updateBuffers() { size_t orbitIndex = 0; size_t elementIndex = 0; - for (const auto& orbit : _orbits) { - KeplerTranslation keplerTranslation(orbit); + for (const auto& orbit : _orbits) { // _orbits blir TLEData + // KeplerTranslation setKeplerElements(TLEData); + KeplerTranslation keplerTranslation(orbit); // Existerar inte längre const double period = orbit.period(); for (size_t i = 0; i <= _nSegments; ++i) { size_t index = orbitIndex * nVerticesPerOrbit + i; @@ -704,6 +688,8 @@ void RenderableSatellites::updateBuffers() { static_cast(i) / static_cast(_nSegments); glm::vec3 position = keplerTranslation.position(Time(orbit.epoch + timeOffset)); + //keplerTranslation.position(orbit.epoch + timeOffset); + _vertexBufferData[index].x = position.x; _vertexBufferData[index].y = position.y; diff --git a/modules/space/rendering/renderablesatellites.h b/modules/space/rendering/renderablesatellites.h index cedae2e431..6aee43d8d6 100644 --- a/modules/space/rendering/renderablesatellites.h +++ b/modules/space/rendering/renderablesatellites.h @@ -120,7 +120,7 @@ namespace openspace { * the valid range supported by Kepler::setKeplerElements * \pre The \p filename must exist */ - void readTLEFile(const std::string& filename, int lineNum); + void readTLEFile(const std::string& filename); }; #endif // __OPENSPACE_MODULE_BASE___RenderableSatellites___H__