This commit is contained in:
Jonathan Fransson
2019-04-01 16:06:18 -06:00
parent 06a853870a
commit 2e499bd8eb
3 changed files with 9 additions and 24 deletions

View File

@@ -114,7 +114,6 @@ local addSatelliteGroupObjects = function(group, tleFolder, shouldAddDuplicates)
Body = title,
Observer = transforms.EarthInertial.Identifier,
File = file,
LineNumber = lineNum
},
-- Size = 3e4,

View File

@@ -244,11 +244,8 @@ RenderableSatellites::RenderableSatellites(const ghoul::Dictionary& dictionary)
*/
const std::string& file = dictionary.value<std::string>(KeyFile);
int lineNum = 1;
if (dictionary.hasKeyAndValue<double>(KeyLineNum)) {
lineNum = static_cast<int>(dictionary.value<double>(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<float>(i) / static_cast<float>(_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;

View File

@@ -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__