]> git.mxchange.org Git - simgear.git/commitdiff
Add SGGeod read and write to gzFile
authorPeter Sadrozinski <psadrozinski@gmail.com>
Fri, 19 Oct 2012 02:46:35 +0000 (22:46 -0400)
committerChristian Schmitt <chris@ilovelinux.de>
Mon, 22 Oct 2012 13:34:16 +0000 (15:34 +0200)
simgear/io/lowlevel.hxx

index bab26ab5220245b964cff7318b3c7bd019bff776..2367d0d4a5ad4bcd60885c4720055fd52bc6982e 100644 (file)
@@ -110,6 +110,17 @@ inline void sgWriteMat4 ( gzFile fd, const SGMatrixf& var ) {
     sgWriteFloat ( fd, 16, (float *)var.data() ) ;
 }
 
+inline void sgReadGeod  ( gzFile fd, SGGeod& var ) {
+    double data[3];
+    sgReadDouble ( fd, 3, data );
+    var = SGGeod::fromDegM( data[0], data[1], data[2] );
+}
+inline void sgWriteGeod ( gzFile fd, const SGGeod& var ) {
+    sgWriteDouble( fd, var.getLongitudeDeg() );
+    sgWriteDouble( fd, var.getLatitudeDeg() );
+    sgWriteDouble( fd, var.getElevationM() );
+}
+
 void sgClearReadError();
 void sgClearWriteError();
 int sgReadError();