]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/SGMatrix.hxx
Modified Files:
[simgear.git] / simgear / math / SGMatrix.hxx
index 6c4b368dd64488c79b438b017453a6639d6ca51e..ed146038dc59b71dab43eb505e3467ad449ea710 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2006  Mathias Froehlich - Mathias.Froehlich@web.de
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+
 #ifndef SGMatrix_H
 #define SGMatrix_H
 
@@ -5,9 +22,6 @@
 template<typename T>
 struct TransNegRef;
 
-template<typename T>
-class SGMatrix;
-
 /// 3D Matrix Class
 template<typename T>
 class SGMatrix {
@@ -554,18 +568,14 @@ operator<<(std::basic_ostream<char_type, traits_type>& s, const SGMatrix<T>& m)
   return s;
 }
 
-/// Two classes doing actually the same on different types
-typedef SGMatrix<float> SGMatrixf;
-typedef SGMatrix<double> SGMatrixd;
-
 inline
 SGMatrixf
 toMatrixf(const SGMatrixd& m)
 {
   return SGMatrixf((float)m(0,0), (float)m(0,1), (float)m(0,2), (float)m(0,3),
                    (float)m(1,0), (float)m(1,1), (float)m(1,2), (float)m(1,3),
-                   (float)m(3,0), (float)m(2,1), (float)m(2,2), (float)m(2,3),
-                   (float)m(4,0), (float)m(4,1), (float)m(4,2), (float)m(4,3));
+                   (float)m(2,0), (float)m(2,1), (float)m(2,2), (float)m(2,3),
+                   (float)m(3,0), (float)m(3,1), (float)m(3,2), (float)m(3,3));
 }
 
 inline
@@ -574,8 +584,8 @@ toMatrixd(const SGMatrixf& m)
 {
   return SGMatrixd(m(0,0), m(0,1), m(0,2), m(0,3),
                    m(1,0), m(1,1), m(1,2), m(1,3),
-                   m(3,0), m(2,1), m(2,2), m(2,3),
-                   m(4,0), m(4,1), m(4,2), m(4,3));
+                   m(2,0), m(2,1), m(2,2), m(2,3),
+                   m(3,0), m(3,1), m(3,2), m(3,3));
 }
 
 #endif