diff --git a/include/openspace/navigation/path.h b/include/openspace/navigation/path.h index 015b77a966..d3060e5c09 100644 --- a/include/openspace/navigation/path.h +++ b/include/openspace/navigation/path.h @@ -42,7 +42,13 @@ public: enum CurveType { AvoidCollision, Linear, - ZoomOutOverview + ZoomOutOverview, + AvoidCollisionWithLookAt // @TODO (2021-08-13, emmbr) This type right now leads + // to rapid rotations, but is useful in specific + // scenarios, e.g. close to surfaces. Later we want to + // remove it, and create a curve type that looks nicely + // at the targets when moving, avoids collisions and + // doesn't introduce sudden large changes in rotation }; Path(Waypoint start, Waypoint end, CurveType type, diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 57e762077a..ffe3ddc8a2 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -93,6 +93,7 @@ Path::Path(Waypoint start, Waypoint end, CurveType type, { switch (_curveType) { case CurveType::AvoidCollision: + case CurveType::AvoidCollisionWithLookAt: _curve = std::make_unique(_start, _end); break; case CurveType::Linear: @@ -174,6 +175,7 @@ glm::dquat Path::interpolateRotation(double t) const { case CurveType::Linear: return easedSlerpRotation(t); case CurveType::ZoomOutOverview: + case CurveType::AvoidCollisionWithLookAt: return lookAtTargetsRotation(t); default: throw ghoul::MissingCaseException(); diff --git a/src/navigation/pathnavigator.cpp b/src/navigation/pathnavigator.cpp index 44be9d153b..faa1ef0793 100644 --- a/src/navigation/pathnavigator.cpp +++ b/src/navigation/pathnavigator.cpp @@ -105,7 +105,8 @@ PathNavigator::PathNavigator() _defaultCurveOption.addOptions({ { Path::CurveType::AvoidCollision, "AvoidCollision" }, { Path::CurveType::Linear, "Linear" }, - { Path::CurveType::ZoomOutOverview, "ZoomOutOverview"} + { Path::CurveType::ZoomOutOverview, "ZoomOutOverview"}, + { Path::CurveType::AvoidCollisionWithLookAt, "AvoidCollisionWithLookAt"} }); addProperty(_defaultCurveOption);