]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaked texture parameter calculations to keep the number smaller. This
authorcurt <curt>
Tue, 28 Apr 1998 01:21:42 +0000 (01:21 +0000)
committercurt <curt>
Tue, 28 Apr 1998 01:21:42 +0000 (01:21 +0000)
avoids the "swimming" problem.
Type-ified fgTIME and fgVIEW.

Scenery/obj.c
Scenery/tilecache.cxx

index 3a52b6cb4377d9f81e916c09a39ec2f4a300180d..d9283a228d58565cef6ba3d0022e50bc73b84b47 100644 (file)
@@ -74,7 +74,9 @@ void calc_normal(double p1[3], double p2[3], double p3[3], double normal[3])
 
 float calc_lon(double x, double y, double z) {
     float tmp;
-    tmp = (RAD_TO_DEG*atan2(y, x)) * FG_TEX_CONSTANT;
+    tmp = fmod(
+              (RAD_TO_DEG*atan2(y, x)) * FG_TEX_CONSTANT, 
+              10.0);
 
     // printf("lon = %.2f\n", (float)tmp);
     return (float)tmp;
@@ -84,7 +86,10 @@ float calc_lon(double x, double y, double z) {
 float calc_lat(double x, double y, double z) {
     float tmp;
 
-    tmp = (90.0 - RAD_TO_DEG*atan2( sqrt(x*x + y*y), z )) * FG_TEX_CONSTANT;
+    tmp = fmod(
+              (90.0 - RAD_TO_DEG * 
+               atan2( sqrt(x*x + y*y), z )) * FG_TEX_CONSTANT,
+              10.0);
 
     // printf("lat = %.2f\n", (float)tmp);
     return (float)tmp;
@@ -472,9 +477,14 @@ GLint fgObjLoad(char *path, struct fgCartesianPoint *ref, double *radius) {
 
 
 /* $Log$
-/* Revision 1.33  1998/04/27 15:58:15  curt
-/* Screwing around with texture coordinate generation ... still needs work.
+/* Revision 1.34  1998/04/28 01:21:42  curt
+/* Tweaked texture parameter calculations to keep the number smaller.  This
+/* avoids the "swimming" problem.
+/* Type-ified fgTIME and fgVIEW.
 /*
+ * Revision 1.33  1998/04/27 15:58:15  curt
+ * Screwing around with texture coordinate generation ... still needs work.
+ *
  * Revision 1.32  1998/04/27 03:30:13  curt
  * Minor transformation adjustments to try to keep scenery tiles closer to
  * (0, 0, 0)  GLfloats run out of precision at the distances we need to model
index 45e4d0437ea30393626b9793083a14973e47279f..d621bd4f38f9fdfad3b0e869d42701d8d3a3c060 100644 (file)
@@ -144,7 +144,7 @@ void fgTileCacheEntryInfo( int index, GLint *display_list,
 
 /* Return index of next available slot in tile cache */
 int fgTileCacheNextAvail( void ) {
-    struct fgVIEW *v;
+    fgVIEW *v;
     int i;
     float dx, dy, dz, max, med, min, tmp;
     float dist, max_dist;
@@ -200,9 +200,14 @@ int fgTileCacheNextAvail( void ) {
 
 
 /* $Log$
-/* Revision 1.3  1998/04/25 22:06:32  curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* Revision 1.4  1998/04/28 01:21:43  curt
+/* Tweaked texture parameter calculations to keep the number smaller.  This
+/* avoids the "swimming" problem.
+/* Type-ified fgTIME and fgVIEW.
 /*
+ * Revision 1.3  1998/04/25 22:06:32  curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
  * Revision 1.2  1998/04/24 00:51:08  curt
  * Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
  * Tweaked the scenery file extentions to be "file.obj" (uncompressed)