Fixed Visual Studio assert error

- Visual studio optimized away the assert expression causing the getvalue
  statement not to be called
This commit is contained in:
Jonas Strandstedt
2014-10-27 18:01:46 +01:00
parent 5daa77f7b2
commit 20137613a8
4 changed files with 39 additions and 15 deletions

View File

@@ -54,9 +54,12 @@ namespace openspace{
, _iBufferID(0)
, _mode(GL_LINE_STRIP){
assert(dictionary.getValue(keyBody , _target));
assert(dictionary.getValue(keyObserver , _observer));
assert(dictionary.getValue(keyFrame , _frame));
bool b1 = dictionary.getValue(keyBody, _target);
bool b2 = dictionary.getValue(keyObserver, _observer);
bool b3 = dictionary.getValue(keyFrame, _frame);
assert(b1 == true);
assert(b2 == true);
assert(b3 == true);
if (!dictionary.getValue(keyColor, _c)){
_c = glm::vec3(0.0);

View File

@@ -55,9 +55,12 @@ namespace openspace{
, _iBufferID(0)
, _mode(GL_LINE_STRIP){
assert(dictionary.getValue(keyBody, _target));
assert(dictionary.getValue(keyObserver, _observer));
assert(dictionary.getValue(keyFrame, _frame));
bool b1 = dictionary.getValue(keyBody, _target);
bool b2 = dictionary.getValue(keyObserver, _observer);
bool b3 = dictionary.getValue(keyFrame, _frame);
assert(b1 == true);
assert(b2 == true);
assert(b3 == true);
/*assert(dictionary.getValue(keyTropicalOrbitPeriod, _tropic));
assert(dictionary.getValue(keyEarthOrbitRatio, _ratio));
assert(dictionary.getValue(keyDayLength, _day));//not used now, will be though.

View File

@@ -59,12 +59,26 @@ namespace openspace{
, _iBufferID(0)
, _mode(GL_LINE_STRIP){
assert(dictionary.getValue(keyBody , _target));
assert(dictionary.getValue(keyObserver , _observer));
assert(dictionary.getValue(keyFrame , _frame));
assert(dictionary.getValue(keyTropicalOrbitPeriod, _tropic));
assert(dictionary.getValue(keyEarthOrbitRatio , _ratio));
assert(dictionary.getValue(keyDayLength , _day));//not used now, will be though.
bool b1 = dictionary.getValue(keyBody, _target);
bool b2 = dictionary.getValue(keyObserver, _observer);
bool b3 = dictionary.getValue(keyFrame, _frame);
bool b4 = dictionary.getValue(keyTropicalOrbitPeriod, _tropic);
bool b5 = dictionary.getValue(keyEarthOrbitRatio, _ratio);
bool b6 = dictionary.getValue(keyDayLength, _day);
assert(b1 == true);
assert(b2 == true);
assert(b3 == true);
assert(b4 == true);
assert(b5 == true);
assert(b6 == true);
//assert(dictionary.getValue(keyBody , _target));
//assert(dictionary.getValue(keyObserver, _observer));
//assert(dictionary.getValue(keyFrame , _frame));
//assert(dictionary.getValue(keyTropicalOrbitPeriod, _tropic));
//assert(dictionary.getValue(keyEarthOrbitRatio , _ratio));
//assert(dictionary.getValue(keyDayLength , _day));//not used now, will be though.
// values in modfiles set from here
// http://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html

View File

@@ -353,10 +353,14 @@ bool SpiceManager::getTargetState(const std::string& target,
spkezr_c(target.c_str(), ephemerisTime, referenceFrame.c_str(),
aberrationCorrection.c_str(), observer.c_str(), state, &lightTime);
position = PowerScaledCoordinate::CreatePowerScaledCoordinate(state[0], state[1], state[2]);
velocity = PowerScaledCoordinate::CreatePowerScaledCoordinate(state[3], state[4], state[5]);
bool hasError = checkForError("Error getting position for '" +
target + "' with observer '" + observer + "'");
return true;
if (!hasError) {
position = PowerScaledCoordinate::CreatePowerScaledCoordinate(state[0], state[1], state[2]);
velocity = PowerScaledCoordinate::CreatePowerScaledCoordinate(state[3], state[4], state[5]);
}
return !hasError;
}
bool SpiceManager::getStateTransformMatrix(const std::string& fromFrame,