Fix of RenderableTrail

This commit is contained in:
Alexander Bock
2015-02-14 10:52:17 +01:00
parent 8df0e5dc3f
commit c57285c34f
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -497,7 +497,7 @@ void OpenSpaceEngine::preSynchronization() {
_interactionHandler.update(dt);
_interactionHandler.lockControls();
//Time::ref().advanceTime(dt);
Time::ref().advanceTime(dt);
}
}
+5 -3
View File
@@ -166,7 +166,9 @@ void RenderableTrail::update(const UpdateData& data) {
int nValues = floor(deltaTime / _increment);
// Update the floating current time
SpiceManager::ref().getTargetState(_target, _observer, _frame, "NONE", data.time, pscPos, pscVel, lightTime);
// Is 'CN+S' correct? It has to be chosen to be the same as in SpiceEphemeris, but
// unsure if it is correct ---abock
SpiceManager::ref().getTargetState(_target, _observer, _frame, "CN+S", data.time, pscPos, pscVel, lightTime);
pscPos[3] += 3; // KM to M
_vertexArray[0] = { pscPos[0], pscPos[1], pscPos[2], pscPos[3] };
@@ -181,7 +183,7 @@ void RenderableTrail::update(const UpdateData& data) {
for (int i = nValues; i > 0; --i) {
double et = _oldTime + i * _increment;
SpiceManager::ref().getTargetState(_target, _observer, _frame, "NONE", et, pscPos, pscVel, lightTime);
SpiceManager::ref().getTargetState(_target, _observer, _frame, "CN+S", et, pscPos, pscVel, lightTime);
pscPos[3] += 3;
_vertexArray[i] = { pscPos[0], pscPos[1], pscPos[2], pscPos[3] };
}
@@ -217,7 +219,7 @@ void RenderableTrail::fullYearSweep(double time) {
psc pscPos, pscVel;
_vertexArray.resize(segments+2);
for (int i = 0; i < segments+2; i++){
SpiceManager::ref().getTargetState(_target, _observer, _frame, "NONE", time, pscPos, pscVel, lightTime);
SpiceManager::ref().getTargetState(_target, _observer, _frame, "CN+S", time, pscPos, pscVel, lightTime);
pscPos[3] += 3;
_vertexArray[i] = {pscPos[0], pscPos[1], pscPos[2], pscPos[3]};