mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 19:29:04 -05:00
Minor refactor
This commit is contained in:
@@ -141,7 +141,7 @@ void AutoNavigationHandler::updateCamera(double deltaTime) {
|
||||
double displacement = deltaTime * cps.speedAtTime(_currentTime - cps.startTime());
|
||||
_distanceAlongCurrentSegment += displacement;
|
||||
|
||||
double relativeDisplacement = _distanceAlongCurrentSegment / cps.length();
|
||||
double relativeDisplacement = _distanceAlongCurrentSegment / cps.pathLength();
|
||||
relativeDisplacement = std::max(0.0, std::min(relativeDisplacement, 1.0));
|
||||
|
||||
// When halfway along a curve, set anchor node in orbitalNavigator, to render
|
||||
|
||||
@@ -75,7 +75,7 @@ const double PathSegment::startTime() const { return _startTime; }
|
||||
|
||||
const double PathSegment::endTime() const { return _startTime + _duration; }
|
||||
|
||||
const double PathSegment::length() const { return _curve->length(); }
|
||||
const double PathSegment::pathLength() const { return _curve->length(); }
|
||||
|
||||
// TODO: remove function for debugging
|
||||
const std::vector<glm::dvec3> PathSegment::getControlPoints() const {
|
||||
@@ -91,7 +91,7 @@ const std::vector<glm::dvec3> PathSegment::getControlPoints() const {
|
||||
double PathSegment::speedAtTime(double time) {
|
||||
ghoul_assert(time >= 0 && time <= _duration, "Time out of range [0, duration]");
|
||||
double t = time / _duration;
|
||||
return (length() * _speedFunction.value(t)) / _speedFunction.integratedSum;
|
||||
return (pathLength() * _speedFunction.value(t)) / _speedFunction.integratedSum;
|
||||
}
|
||||
|
||||
glm::dvec3 PathSegment::getPositionAt(double u) const {
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
const double duration() const;
|
||||
const double startTime() const;
|
||||
const double endTime() const;
|
||||
const double length() const;
|
||||
const double pathLength() const;
|
||||
|
||||
const std::vector<glm::dvec3> getControlPoints() const; // TODO: remove this debugging function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user