mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Better handle interpolation when setting interpolation time to 0
Prevent NaNs from appearing when selecting a linear flight distance of 0 (closes #1329)
This commit is contained in:
@@ -1271,7 +1271,12 @@ glm::dvec3 OrbitalNavigator::moveCameraAlongVector(const glm::dvec3& camPos,
|
||||
velocity = 1.0 - destination / distFromCameraToFocus;
|
||||
}
|
||||
else { // When flying away from anchor
|
||||
velocity = distFromCameraToFocus / destination - 1.0;
|
||||
if (destination == 0.0) {
|
||||
velocity = -1.0;
|
||||
}
|
||||
else {
|
||||
velocity = distFromCameraToFocus / destination - 1.0;
|
||||
}
|
||||
}
|
||||
velocity *= _velocitySensitivity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user