]> git.mxchange.org Git - flightgear.git/commitdiff
don't define constant objects in header files
authorTim Moore <timoore@redhat.com>
Mon, 9 Nov 2009 09:24:46 +0000 (10:24 +0100)
committerTim Moore <timoore@redhat.com>
Mon, 9 Nov 2009 09:24:46 +0000 (10:24 +0100)
src/Main/viewmgr.cxx
src/Main/viewmgr.hxx

index 6d48451c319dcbb776149f391b6b133cd90e1277..3a5777afd0fb114b45363b8d8fbf3a3d9b988623 100644 (file)
@@ -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
index 30f81bec9d864f677419d8f12d467856a5e9e843..443cc33bbe64662779a759e5c9a91cc049b9309c 100644 (file)
@@ -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