From 81171348791b325db2393f072fcf8bd93277d20d Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 9 Nov 2009 10:24:46 +0100 Subject: [PATCH] don't define constant objects in header files --- src/Main/viewmgr.cxx | 6 +++--- src/Main/viewmgr.hxx | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index 6d48451c3..3a5777afd 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -808,7 +808,7 @@ const char* format_rotor(const SGQuatd _quat){ // the conventional aviation basis set, // i.e. x=forward, y=starboard, z=bottom const char* FGViewMgr::getCurrentViewFrame() const{ - return format_rotor(current_view_orientation * conj(fsb2sta) + return format_rotor(current_view_orientation * conj(fsb2sta()) * conj(current_view_or_offset) ); } @@ -832,7 +832,7 @@ const char* FGViewMgr::getCurrentViewOrOffset() const{ // the components of this quat are displayed using the // conventional ECEF basis set. This is *not* the way // the view orientation is stored in the views[] array, -// but is easier for most people to understand. +// but is easier for non-graphics hackers to understand. // If we did not remove this factor of fsb2sta here and // in getCurrentViewFrame, that would be equivalent to // the following peculiar reference orientation: @@ -851,7 +851,7 @@ const char* FGViewMgr::getCurrentViewOrOffset() const{ // -- aircraft Zprime axis (aft) pointed north // meaning the OpenGL axes are aligned with the ECEF axes. const char* FGViewMgr::getCurrentViewOrientation() const{ - return format_rotor(current_view_orientation * conj(fsb2sta)); + return format_rotor(current_view_orientation * conj(fsb2sta())); } void diff --git a/src/Main/viewmgr.hxx b/src/Main/viewmgr.hxx index 30f81bec9..443cc33bb 100644 --- a/src/Main/viewmgr.hxx +++ b/src/Main/viewmgr.hxx @@ -144,6 +144,9 @@ private: // which is widely used in FGFS // and rotates it into the OpenGL camera system // i.e. Xprime=starboard, Yprime=top, Zprime=aft. -const SGQuatd fsb2sta(-0.5, -0.5, 0.5, 0.5); +inline const SGQuatd fsb2sta() +{ + return SGQuatd(-0.5, -0.5, 0.5, 0.5); +} #endif // _VIEWMGR_HXX -- 2.39.5