mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-21 18:38:20 -05:00
Adapt to rebase
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user