mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 19:50:03 -06:00
Tiny refactor/cleanup
This commit is contained in:
@@ -62,21 +62,15 @@ Path::Path(Waypoint start, Waypoint end, CurveType type,
|
||||
}
|
||||
}
|
||||
|
||||
void Path::setStartPoint(Waypoint cs) {
|
||||
_start = std::move(cs);
|
||||
initializePath();
|
||||
// TODO later: maybe recompute duration as well...
|
||||
}
|
||||
Waypoint Path::startPoint() const { return _start; }
|
||||
|
||||
const Waypoint Path::startPoint() const { return _start; }
|
||||
Waypoint Path::endPoint() const { return _end; }
|
||||
|
||||
const Waypoint Path::endPoint() const { return _end; }
|
||||
double Path::duration() const { return _duration; }
|
||||
|
||||
const double Path::duration() const { return _duration; }
|
||||
double Path::pathLength() const { return _curve->length(); }
|
||||
|
||||
const double Path::pathLength() const { return _curve->length(); }
|
||||
|
||||
const std::vector<glm::dvec3> Path::controlPoints() const {
|
||||
std::vector<glm::dvec3> Path::controlPoints() const {
|
||||
return _curve->points();
|
||||
}
|
||||
|
||||
@@ -154,13 +148,9 @@ void Path::initializePath() {
|
||||
break;
|
||||
default:
|
||||
LERROR("Could not create curve. Type does not exist!");
|
||||
throw ghoul::MissingCaseException();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_curve || !_rotationInterpolator) {
|
||||
LERROR("Curve type has not been properly initialized.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace openspace::autonavigation
|
||||
|
||||
@@ -41,23 +41,21 @@ public:
|
||||
|
||||
// TODO: add a constructor that takes an instruction and curve type?
|
||||
|
||||
void setStartPoint(Waypoint wp);
|
||||
Waypoint startPoint() const;
|
||||
Waypoint endPoint() const;
|
||||
double duration() const;
|
||||
double pathLength() const;
|
||||
|
||||
const Waypoint startPoint() const;
|
||||
const Waypoint endPoint() const;
|
||||
const double duration() const;
|
||||
const double pathLength() const;
|
||||
|
||||
const std::vector<glm::dvec3> controlPoints() const;
|
||||
std::vector<glm::dvec3> controlPoints() const;
|
||||
|
||||
CameraPose traversePath(double dt);
|
||||
std::string currentAnchor() const;
|
||||
bool hasReachedEnd() const;
|
||||
|
||||
double speedAtTime(double time) const;
|
||||
CameraPose interpolatedPose(double distance) const;
|
||||
|
||||
private:
|
||||
double speedAtTime(double time) const;
|
||||
void initializePath();
|
||||
|
||||
Waypoint _start;
|
||||
|
||||
Reference in New Issue
Block a user