#define FG_APT_BASE_TEX_CONSTANT 2000.0
-#ifdef OLD_TEX_COORDS
-// Calculate texture coordinates for a given point.
-static fgPoint3d
-calc_tex_coords(const fgPoint3d& p) {
- fgPoint3d tex;
-
- cout << "Texture coordinates = " <<
- FG_APT_BASE_TEX_CONSTANT * p.lon << " " <<
- FG_APT_BASE_TEX_CONSTANT * p.lat << "\n";
-
- tex.x = fmod(FG_APT_BASE_TEX_CONSTANT * p.lon, 10.0);
- tex.y = fmod(FG_APT_BASE_TEX_CONSTANT * p.lat, 10.0);
-
- if ( tex.x < 0.0 ) {
- tex.x += 10.0;
- }
-
- if ( tex.y < 0.0 ) {
- tex.y += 10.0;
- }
-
- cout << "Texture coordinates = " << tex.x << " " << tex.y << "\n";
-
- return tex;
-}
-#endif
-
-
// Calculate texture coordinates for a given point.
static Point3D calc_tex_coords(double *node, const Point3D& ref) {
Point3D cp;
Point3D pp;
- cp.setvals( node[0] + ref.x(), node[1] + ref.y(), node[2] + ref.z() );
+ cp = Point3D( node[0] + ref.x(), node[1] + ref.y(), node[2] + ref.z() );
pp = fgCartToPolar3d(cp);
// we have just finished reading and airport record.
// process the info
size = perimeter.size();
- average.setvals( avex / (double)size + tile->center.x(),
- avey / (double)size + tile->center.y(),
- avez / (double)size + tile->center.z() );
+ average = Point3D( avex / (double)size + tile->center.x(),
+ avey / (double)size + tile->center.y(),
+ avez / (double)size + tile->center.z() );
gen_base(average, perimeter, tile);
}
// $Log$
+// Revision 1.6 1998/10/18 01:17:16 curt
+// Point3D tweaks.
+//
// Revision 1.5 1998/10/16 23:27:14 curt
// C++-ifying.
//
// the center of the earth and our view position. Doesn't have to
// be the exact elevation (this is good because we don't know it
// yet :-)
- geod_pos.setvals( FG_Longitude, FG_Latitude, 0.0);
+ geod_pos = Point3D( FG_Longitude, FG_Latitude, 0.0);
abs_view_pos = fgGeodToCart(geod_pos);
// Calculate ground elevation at starting point
// $Log$
+// Revision 1.44 1998/10/18 01:17:17 curt
+// Point3D tweaks.
+//
// Revision 1.43 1998/10/17 01:34:22 curt
// C++ ifying ...
//
// scenery.center.y, scenery.center.z);
// calculate the cartesion coords of the current lat/lon/0 elev
- p.setvals(
- FG_Longitude,
- FG_Lat_geocentric,
- FG_Sea_level_radius * FEET_TO_METER );
+ p = Point3D( FG_Longitude,
+ FG_Lat_geocentric,
+ FG_Sea_level_radius * FEET_TO_METER );
cur_zero_elev = fgPolarToCart3d(p) - scenery.center;
// $Log$
+// Revision 1.24 1998/10/18 01:17:19 curt
+// Point3D tweaks.
+//
// Revision 1.23 1998/10/17 01:34:26 curt
// C++ ifying ...
//
// everything is too close together to tell the difference
// so the current intersection point should work as good
// as any
- result.setvals(x, y, z);
+ result = Point3D(x, y, z);
return(1);
}
side1 = FG_SIGN (t1 - t2);
} else {
// all dimensions are really small so lets call it close
// enough and return a successful match
- result.setvals(x, y, z);
+ result = Point3D(x, y, z);
return(1);
}
}
// printf( "intersection point = %.2f %.2f %.2f\n", x, y, z);
- result.setvals(x, y, z);
+ result = Point3D(x, y, z);
return(1);
}
}
// $Log$
+// Revision 1.6 1998/10/18 01:17:20 curt
+// Point3D tweaks.
+//
// Revision 1.5 1998/10/16 00:54:37 curt
// Converted to Point3D class.
//
}
-#define FG_TEX_CONSTANT 128.0
+#define FG_TEX_CONSTANT 8.0
// Calculate texture coordinates for a given point.
-Point3D calc_tex_coords(double *node, const Point3D& ref) {
+static Point3D calc_tex_coords(double *node, const Point3D& ref) {
Point3D cp;
Point3D pp;
- cp.setvals( node[0] + ref.x(),
- node[1] + ref.y(),
- node[2] + ref.z() );
+ cp = Point3D( node[0] + ref.x(),
+ node[1] + ref.y(),
+ node[2] + ref.z() );
pp = fgCartToPolar3d(cp);
- pp.setx( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.x(), 25.0) );
- pp.sety( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.y(), 25.0) );
+ cout << pp << endl;
+
+ pp.setx( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.x(), 1.0) );
+ pp.sety( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.y(), 1.0) );
if ( pp.x() < 0.0 ) {
- pp.setx( pp.x() + 25.0 );
+ pp.setx( pp.x() + 1.0 );
}
if ( pp.y() < 0.0 ) {
- pp.sety( pp.y() + 25.0 );
+ pp.sety( pp.y() + 1.0 );
}
return(pp);
// $Log$
+// Revision 1.6 1998/10/18 01:17:21 curt
+// Point3D tweaks.
+//
// Revision 1.5 1998/10/16 00:54:39 curt
// Converted to Point3D class.
//
scenery.next_center = t->center;
- earth_center.setvals(0.0, 0.0, 0.0);
+ earth_center = Point3D(0.0, 0.0, 0.0);
fgPrintf( FG_TERRAIN, FG_DEBUG,
"Pos = (%.2f, %.2f) Current bucket = %d %d %d %d Index = %ld\n",
// $Log$
+// Revision 1.41 1998/10/18 01:17:23 curt
+// Point3D tweaks.
+//
// Revision 1.40 1998/10/17 01:34:28 curt
// C++ ifying ...
//
fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &l->sun_gc_lat);
- p.setvals( l->sun_lon, l->sun_gc_lat, sl_radius );
+ p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius );
l->fg_sunpos = fgPolarToCart3d(p);
printf( " t->cur_time = %ld\n", t->cur_time);
// $Log$
+// Revision 1.15 1998/10/18 01:17:24 curt
+// Point3D tweaks.
+//
// Revision 1.14 1998/10/17 01:34:32 curt
// C++ ifying ...
//