]> git.mxchange.org Git - flightgear.git/blobdiff - Main/views.c
Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
[flightgear.git] / Main / views.c
index 9c1d02af4a45f0e7687efd6209bd97491cc9ec4a..d263862d118c03e48606c9ba54c9a28e96a5cbe9 100644 (file)
  **************************************************************************/
 
 
-#include "views.h"
+#include <Main/views.h>
 
-#include "../Include/constants.h"
-
-#include "../Flight/flight.h"
-#include "../Math/mat3.h"
-#include "../Math/polar.h"
-#include "../Math/vector.h"
-#include "../Scenery/scenery.h"
-#include "../Time/fg_time.h"
+#include <Include/fg_constants.h>
 
+#include <Flight/flight.h>
+#include <Math/mat3.h>
+#include <Math/polar.h>
+#include <Math/vector.h>
+#include <Scenery/scenery.h>
+#include <Time/fg_time.h>
+#include <Main/fg_debug.h>
 
 /* This is a record containing current view parameters */
 struct fgVIEW current_view;
@@ -42,7 +42,7 @@ struct fgVIEW current_view;
 
 /* Initialize a view structure */
 void fgViewInit(struct fgVIEW *v) {
-    printf("Initializing View parameters\n");
+    fgPrintf( FG_VIEW, FG_INFO, "Initializing View parameters\n");
 
     v->view_offset = 0.0;
     v->goal_view_offset = 0.0;
@@ -50,7 +50,7 @@ void fgViewInit(struct fgVIEW *v) {
 
 
 /* Update the view parameters */
-void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
+void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     MAT3vec vec, forward, v0, minus_z;
     MAT3mat R, TMP, UP, LOCAL, VIEW;
     double ntmp;
@@ -63,13 +63,15 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     v->cur_zero_elev.z -= scenery.center.z;
 
     /* calculate view position in current FG view coordinate system */
-    v->view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric, 
+    v->abs_view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric, 
                             FG_Radius_to_vehicle * FEET_TO_METER + 1.0);
-    v->view_pos.x -= scenery.center.x;
-    v->view_pos.y -= scenery.center.y;
-    v->view_pos.z -= scenery.center.z;
+    v->view_pos.x = v->abs_view_pos.x - scenery.center.x;
+    v->view_pos.y = v->abs_view_pos.y - scenery.center.y;
+    v->view_pos.z = v->abs_view_pos.z - scenery.center.z;
 
-    printf("View pos = %.4f, %.4f, %.4f\n", 
+    fgPrintf( FG_VIEW, FG_DEBUG, "Absolute view pos = %.4f, %.4f, %.4f\n", 
+          v->abs_view_pos.x, v->abs_view_pos.y, v->abs_view_pos.z);
+    fgPrintf( FG_VIEW, FG_DEBUG, "Relative view pos = %.4f, %.4f, %.4f\n", 
           v->view_pos.x, v->view_pos.y, v->view_pos.z);
 
     /* make a vector to the current view position */
@@ -182,10 +184,25 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
 
 
 /* $Log$
-/* Revision 1.9  1998/01/13 00:23:09  curt
-/* Initial changes to support loading and management of scenery tiles.  Note,
-/* there's still a fair amount of work left to be done.
+/* Revision 1.13  1998/02/07 15:29:45  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.12  1998/01/29 00:50:28  curt
+ * Added a view record field for absolute x, y, z position.
+ *
+ * Revision 1.11  1998/01/27 00:47:58  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
+ * Revision 1.10  1998/01/19 19:27:09  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.9  1998/01/13 00:23:09  curt
+ * Initial changes to support loading and management of scenery tiles.  Note,
+ * there's still a fair amount of work left to be done.
+ *
  * Revision 1.8  1997/12/30 22:22:33  curt
  * Further integration of event manager.
  *