1
0
Fork 0

Merge commit '6c1934fcdf7dc91897e9d4dc8b8b6810b1de6a51' into next

This commit is contained in:
Torsten Dreyer 2015-05-19 11:52:49 +02:00
commit 46c4b134c6

View file

@ -310,11 +310,15 @@ FGViewer::setGoalPitchOffset_deg (double goal_pitch_offset_deg)
{
_dirty = true;
_goal_pitch_offset_deg = goal_pitch_offset_deg;
if ( _goal_pitch_offset_deg < -90 ) {
_goal_pitch_offset_deg = -90.0;
/* The angle is set to 1/1000th of a degree from the poles to avoid the
* singularity where the azimuthal angle becomes undefined, inducing optical
* artefacts. The arbitrary angle offset is visually unnoticeable while
* avoiding any possible floating point truncation artefacts. */
if ( _goal_pitch_offset_deg < -89.999 ) {
_goal_pitch_offset_deg = -89.999;
}
if ( _goal_pitch_offset_deg > 90.0 ) {
_goal_pitch_offset_deg = 90.0;
if ( _goal_pitch_offset_deg > 89.999 ) {
_goal_pitch_offset_deg = 89.999;
}
}