Adapt to rebase

This commit is contained in:
Emma Broman
2020-04-27 14:49:25 +02:00
parent 32a1f2d600
commit 4367c81f33
2 changed files with 6 additions and 5 deletions
@@ -50,9 +50,6 @@ namespace {
namespace openspace::autonavigation {
AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint& end) {
// default rotation interpolation
_rotationInterpolator = RotationInterpolator{ start, end, this, Slerp };
_points.push_back(start.position());
// Add a point to first go straight out if starting close to planet
@@ -73,9 +70,8 @@ AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint&
//TODO: determine if its best to compare to end orientation or position
glm::dvec3 startToEnd = end.position() - start.position();
double cosStartAngle = glm::dot(normalize(-startViewDir), normalize(startToEnd));
if (cosStartAngle > 0.7) {
glm::dquat middleRotation = this->rotationAt(0.5); // undefined behaviour for other types than Slerp!
glm::dquat middleRotation = glm::slerp(start.rotation(), end.rotation(), 0.5); // OBS! Rotation method is not necessarily slerp
glm::dvec3 middleViewDir = glm::normalize(middleRotation * glm::dvec3(0.0, 0.0, -1.0));
double distance = 0.4 * glm::length(startToEnd);
+5
View File
@@ -126,6 +126,11 @@ void PathSegment::initCurve() {
{
case CurveType::AvoidCollision:
_curve = std::make_unique<AvoidCollisionCurve>(_start, _end);
_rotationInterpolator = std::make_unique<EasedSlerpInterpolator>(
_start.rotation(),
_end.rotation()
);
_speedFunction = std::make_unique<CubicDampenedSpeed>();
break;
case CurveType::Bezier3: