-libdir = ${exec_prefix}/lib
+# libdir = ${exec_prefix}/lib
+# lib_LTLIBRARIES = libWeather.la
+# libWeather_la_SOURCES = weather.c weather.h
-lib_LTLIBRARIES = libWeather.la
+noinst_LIBRARIES = libWeather.a
-libWeather_la_SOURCES = weather.c weather.h
+libWeather_a_SOURCES = weather.c weather.h
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
**************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+# include <windows.h>
+#endif
+
+#include <GL/glut.h>
+#include <XGL/xgl.h>
+
+#include <math.h>
#include <stdio.h>
-#include <Weather/weather.h>
#include <Aircraft/aircraft.h>
+#include <Debug/fg_debug.h>
#include <Math/fg_random.h>
+#include <Weather/weather.h>
/* This is a record containing current weather info */
/* Configure some wind */
/* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
- w->visibility = 45000.0; /* in meters */
+ fgWeatherSetVisibility(45000.0); /* in meters */
}
}
+/* Get the current visibility */
+float fgWeatherGetVisibility( void ) {
+ struct fgWEATHER *w;
+ w = ¤t_weather;
+
+ return ( w->visibility );
+}
+
+
+/* Set the visibility and update fog parameters */
+void fgWeatherSetVisibility( float visibility ) {
+ struct fgWEATHER *w;
+ w = ¤t_weather;
+
+ w->visibility = visibility; /* in meters */
+ // w->fog_density = -log(0.01 / w->visibility; /* for GL_FOG_EXP */
+ w->fog_density = sqrt( -log(0.01) ) / w->visibility; /* for GL_FOG_EXP2 */
+ xglFogf (GL_FOG_DENSITY, w->fog_density);
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "Fog density = %.4f\n", w->fog_density);
+}
+
+
/* $Log$
-/* Revision 1.15 1998/04/25 22:06:34 curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* Revision 1.16 1998/06/12 01:00:59 curt
+/* Build only static libraries.
+/* Declare memmove/memset for Sloaris.
+/* Added support for exponetial fog, which solves for the proper density to
+/* achieve the desired visibility range.
/*
+ * Revision 1.15 1998/04/25 22:06:34 curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
* Revision 1.14 1998/02/09 15:07:54 curt
* Minor tweaks.
*
/* holds the current weather values */
struct fgWEATHER {
float visibility;
+ float fog_density;
};
extern struct fgWEATHER current_weather;
void fgWeatherUpdate( void );
+/* Get the current visibility */
+float fgWeatherGetVisibility( void );
+
+
+/* Set the visibility and update fog parameters */
+void fgWeatherSetVisibility( float visibility );
+
+
#ifdef __cplusplus
}
#endif
/* $Log$
-/* Revision 1.9 1998/04/21 17:02:46 curt
-/* Prepairing for C++ integration.
+/* Revision 1.10 1998/06/12 01:01:00 curt
+/* Build only static libraries.
+/* Declare memmove/memset for Sloaris.
+/* Added support for exponetial fog, which solves for the proper density to
+/* achieve the desired visibility range.
/*
+ * Revision 1.9 1998/04/21 17:02:46 curt
+ * Prepairing for C++ integration.
+ *
* Revision 1.8 1998/01/22 02:59:44 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*