diff --git a/modules/autonavigation/autonavigationhandler.cpp b/modules/autonavigation/autonavigationhandler.cpp index 5b19dee732..1f57ea9073 100644 --- a/modules/autonavigation/autonavigationhandler.cpp +++ b/modules/autonavigation/autonavigationhandler.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/modules/autonavigation/pathcurves.cpp b/modules/autonavigation/pathcurves.cpp index 44e157a3b4..ceac66e908 100644 --- a/modules/autonavigation/pathcurves.cpp +++ b/modules/autonavigation/pathcurves.cpp @@ -74,7 +74,7 @@ std::vector PathCurve::getPoints() { return _points; } -Bezier3Curve::Bezier3Curve(CameraState& start, CameraState& end) { +Bezier3Curve::Bezier3Curve(const CameraState& start, const CameraState& end) { glm::dvec3 startNodePos = sceneGraphNode(start.referenceNode)->worldPosition(); glm::dvec3 endNodePos = sceneGraphNode(end.referenceNode)->worldPosition(); double startNodeRadius = sceneGraphNode(start.referenceNode)->boundingSphere(); @@ -202,7 +202,7 @@ void Bezier3Curve::initParameterIntervals() { _parameterIntervals.swap(newIntervals); } -LinearCurve::LinearCurve(CameraState& start, CameraState& end) { +LinearCurve::LinearCurve(const CameraState& start, const CameraState& end) { _points.push_back(start.position); _points.push_back(end.position); _length = glm::distance(end.position, start.position); diff --git a/modules/autonavigation/pathcurves.h b/modules/autonavigation/pathcurves.h index 9a56c2bb79..a986ceb9d0 100644 --- a/modules/autonavigation/pathcurves.h +++ b/modules/autonavigation/pathcurves.h @@ -31,7 +31,12 @@ namespace openspace::autonavigation { -// OBS! Path curves has curve parameter in range [0,1] +enum CurveType { + Bezier3, + Linear, + Pause // OBS! Temporary special case for handling pauses +}; + class PathCurve { public: virtual ~PathCurve() = 0; @@ -50,11 +55,12 @@ protected: // the total length of the curve (approximated) double _length; + }; class Bezier3Curve : public PathCurve { public: - Bezier3Curve(CameraState& start, CameraState& end); + Bezier3Curve(const CameraState& start, const CameraState& end); glm::dvec3 positionAt(double u); private: @@ -66,7 +72,7 @@ private: class LinearCurve : public PathCurve { public: - LinearCurve(CameraState& start, CameraState& end); + LinearCurve(const CameraState& start, const CameraState& end); glm::dvec3 positionAt(double u); }; diff --git a/modules/autonavigation/pathsegment.h b/modules/autonavigation/pathsegment.h index 9e7ad773fe..e06c2d2cb7 100644 --- a/modules/autonavigation/pathsegment.h +++ b/modules/autonavigation/pathsegment.h @@ -26,20 +26,12 @@ #define __OPENSPACE_MODULE___PATHSEGMENT___H__ #include +#include #include #include namespace openspace::autonavigation { -// TODO: place this enum somewhere else -enum CurveType { - Bezier3, - Linear, - Pause // OBS! Temporary special case for handling pauses -}; - -class PathCurve; - class PathSegment { public: PathSegment(CameraState start, CameraState end, double startTime, CurveType type);