Fix viewer issue with Tower and Chase View.
When looking _at_ a model with an x,y offset of 0, then the view heading has no effect. So, force heading offset property to 0 to keep other property consumers from running incorrect calculations. => Trying to rotate the heading offset in Tower/Chase view no longer rotates the blue sky around the aircraft, though the viewer itself isn't rotating anything.
This commit is contained in:
parent
32b69f823a
commit
91d001ff4e
1 changed files with 16 additions and 1 deletions
|
@ -289,6 +289,13 @@ void
|
||||||
FGViewer::setHeadingOffset_deg (double heading_offset_deg)
|
FGViewer::setHeadingOffset_deg (double heading_offset_deg)
|
||||||
{
|
{
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
|
if (_at_model && (_offset_m.x() == 0.0)&&(_offset_m.y() == 0.0))
|
||||||
|
{
|
||||||
|
/* avoid optical effects (e.g. rotating sky) when looking at something
|
||||||
|
* with heading offsets x==y==0 (view heading cannot change). */
|
||||||
|
_heading_offset_deg = 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
_heading_offset_deg = heading_offset_deg;
|
_heading_offset_deg = heading_offset_deg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,6 +324,14 @@ void
|
||||||
FGViewer::setGoalHeadingOffset_deg (double goal_heading_offset_deg)
|
FGViewer::setGoalHeadingOffset_deg (double goal_heading_offset_deg)
|
||||||
{
|
{
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
|
if (_at_model && (_offset_m.x() == 0.0)&&(_offset_m.y() == 0.0))
|
||||||
|
{
|
||||||
|
/* avoid optical effects (e.g. rotating sky) when looking at something
|
||||||
|
* with heading offsets x==y==0 (view heading cannot change). */
|
||||||
|
_goal_heading_offset_deg = 0.0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_goal_heading_offset_deg = goal_heading_offset_deg;
|
_goal_heading_offset_deg = goal_heading_offset_deg;
|
||||||
while ( _goal_heading_offset_deg < 0.0 ) {
|
while ( _goal_heading_offset_deg < 0.0 ) {
|
||||||
_goal_heading_offset_deg += 360;
|
_goal_heading_offset_deg += 360;
|
||||||
|
|
Loading…
Add table
Reference in a new issue