This commit is contained in:
Agnes Heppich
2018-12-12 17:34:04 -05:00
parent a011ad5fca
commit 6580745b05
2 changed files with 11 additions and 10 deletions

View File

@@ -68,8 +68,8 @@ RadecTranslation::RadecTranslation(const ghoul::Dictionary& dictionary)
{
std::unique_ptr<ghoul::Dictionary> dictionaryPtr = std::make_unique<ghoul::Dictionary>(dictionary);
dataStart = Time::convertTime(dictionaryPtr->value<std::string>(keyDataStart));
dataEnd = double(Time::convertTime(dictionaryPtr->value<std::string>(keyDataEnd)));
_dataStart = Time::convertTime(dictionaryPtr->value<std::string>(keyDataStart));
_dataEnd = double(Time::convertTime(dictionaryPtr->value<std::string>(keyDataEnd)));
extractData(dictionaryPtr);
documentation::testSpecificationAndThrow(
@@ -119,7 +119,7 @@ glm::dvec3 RadecTranslation::radecToCartesianCoordinates(glm::vec3 pos) const {
glm::dvec3 RadecTranslation::position(const UpdateData& data) const{
double time = data.time.j2000Seconds();
if (time > dataStart && time < dataEnd) {
if (time > _dataStart && time < _dataEnd) {
const bool haveDataForTime = (time >= radecManager.timeDoubles.front()) &&
(time < radecManager.timeDoubles.back());

View File

@@ -51,15 +51,16 @@ public:
static documentation::Documentation Documentation();
private:
/* Converts the Ra Dec range coordinates into cartesian coordinates*/
glm::dvec3 convertRaDecRangeToCartesian(double ra, double dec, double range) const;
/*Transforms the cartesian coordinates with a rotation and a translation*/
glm::dvec3 radecToCartesianCoordinates(glm::vec3 pos) const;
RadecManager radecManager;
///Converts the Ra Dec range coordinates into cartesian coordinates
glm::dvec3 convertRaDecRangeToCartesian(double ra, double dec, double range) const;
///Transforms the cartesian coordinates with a rotation and a translation
glm::dvec3 radecToCartesianCoordinates(glm::vec3 pos) const;
///Translated position
mutable glm::vec3 _position;
double dataStart;
double dataEnd;
///Determines between what dates there is data available. Set in the asset file.
double _dataStart, _dataEnd;
glm::dmat4 _rotEquatorialSphere = { -0.05487554, 0.4941095, -0.8676661, 0.0,
-0.8734371 , -0.4448296, -0.1980764, 0.0,
-0.483835 , 0.7469823, 0.4559838, 0.0,