Remove risk of access violation and add a comment

This commit is contained in:
Emma Broman
2020-01-15 11:47:08 -05:00
parent 6213d8713d
commit d4c1bb5199
2 changed files with 2 additions and 2 deletions

View File

@@ -191,8 +191,7 @@ void AutoNavigationHandler::continuePath() {
bool AutoNavigationHandler::handleInstruction(const Instruction& instruction, int index)
{
CameraState& currentLast = _pathSegments.back().end;
CameraState startState = _pathSegments.empty() ? currentCameraState() : currentLast;
CameraState startState = _pathSegments.empty() ? currentCameraState() : _pathSegments.back().end;
CameraState endState;
double duration, startTime;

View File

@@ -81,6 +81,7 @@ private:
glm::dvec3 computeTargetPositionAtNode(const SceneGraphNode* node,
glm::dvec3 prevPos, double height);
// This list essentially represents the camera path
std::vector<PathSegment> _pathSegments;
double _currentTime;