From: Tim Moore Date: Mon, 9 Nov 2009 09:24:46 +0000 (+0100) Subject: don't define constant objects in header files X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=81171348791b325db2393f072fcf8bd93277d20d;p=flightgear.git don't define constant objects in header files --- 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