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.
This commit is contained in:
parent
2f40b08c03
commit
847f5b90d3
3 changed files with 68 additions and 9 deletions
|
@ -1,7 +1,9 @@
|
||||||
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
|
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
|
||||||
|
|
|
@ -24,11 +24,24 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#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 <stdio.h>
|
||||||
|
|
||||||
#include <Weather/weather.h>
|
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
|
#include <Debug/fg_debug.h>
|
||||||
#include <Math/fg_random.h>
|
#include <Math/fg_random.h>
|
||||||
|
#include <Weather/weather.h>
|
||||||
|
|
||||||
|
|
||||||
/* This is a record containing current weather info */
|
/* This is a record containing current weather info */
|
||||||
|
@ -46,7 +59,7 @@ void fgWeatherInit( void ) {
|
||||||
/* Configure some wind */
|
/* Configure some wind */
|
||||||
/* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
|
/* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
|
||||||
|
|
||||||
w->visibility = 45000.0; /* in meters */
|
fgWeatherSetVisibility(45000.0); /* in meters */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,10 +83,39 @@ void fgWeatherUpdate( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 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$
|
/* $Log$
|
||||||
/* Revision 1.15 1998/04/25 22:06:34 curt
|
/* Revision 1.16 1998/06/12 01:00:59 curt
|
||||||
/* Edited cvs log messages in source files ... bad bad bad!
|
/* 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
|
* Revision 1.14 1998/02/09 15:07:54 curt
|
||||||
* Minor tweaks.
|
* Minor tweaks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,6 +36,7 @@ extern "C" {
|
||||||
/* holds the current weather values */
|
/* holds the current weather values */
|
||||||
struct fgWEATHER {
|
struct fgWEATHER {
|
||||||
float visibility;
|
float visibility;
|
||||||
|
float fog_density;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct fgWEATHER current_weather;
|
extern struct fgWEATHER current_weather;
|
||||||
|
@ -49,6 +50,14 @@ void fgWeatherInit( void );
|
||||||
void fgWeatherUpdate( void );
|
void fgWeatherUpdate( void );
|
||||||
|
|
||||||
|
|
||||||
|
/* Get the current visibility */
|
||||||
|
float fgWeatherGetVisibility( void );
|
||||||
|
|
||||||
|
|
||||||
|
/* Set the visibility and update fog parameters */
|
||||||
|
void fgWeatherSetVisibility( float visibility );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,9 +67,15 @@ void fgWeatherUpdate( void );
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.9 1998/04/21 17:02:46 curt
|
/* Revision 1.10 1998/06/12 01:01:00 curt
|
||||||
/* Prepairing for C++ integration.
|
/* 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
|
* Revision 1.8 1998/01/22 02:59:44 curt
|
||||||
* Changed #ifdef FILE_H to #ifdef _FILE_H
|
* Changed #ifdef FILE_H to #ifdef _FILE_H
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue