Skip to content

Commit

Permalink
Catching nullptr in body.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferBuehler committed Jan 6, 2018
1 parent 0bf911e commit 9d5b42b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,13 +1507,17 @@ DynamicBody::saveToXml(QTextStream &xml) {
void
DynamicBody::setCoG(const position &newCoG)
{
CoG = newCoG;
CoG = newCoG;
resetDynamics();
//use this to display axes at the CoG
//axesTranToCOG->translation.setValue(CoG.x(), CoG.y(), CoG.z());

//use this to display axes at body origin
axesTranToCOG->translation.setValue(0, 0, 0);
if (graspitCore && axesTranToCOG)
{
//use this to display axes at the CoG
//axesTranToCOG->translation.setValue(CoG.x(), CoG.y(), CoG.z());

//use this to display axes at body origin
axesTranToCOG->translation.setValue(0, 0, 0);
}
}

/*! The max radius can be thought of as the largest distance from the center
Expand All @@ -1523,7 +1527,10 @@ void
DynamicBody::setMaxRadius(double maxRad)
{
maxRadius = maxRad;
axesScale->scaleFactor = SbVec3f(maxRadius / AXES_SCALE, maxRadius / AXES_SCALE, maxRadius / AXES_SCALE);
if (graspitCore && axesScale)
{
axesScale->scaleFactor = SbVec3f(maxRadius / AXES_SCALE, maxRadius / AXES_SCALE, maxRadius / AXES_SCALE);
}
}

void
Expand Down

0 comments on commit 9d5b42b

Please sign in to comment.