1
0
Fork 0

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:
curt 1998-06-12 01:00:59 +00:00
parent 2f40b08c03
commit 847f5b90d3
3 changed files with 68 additions and 9 deletions

View file

@ -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

View file

@ -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 <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 */
@ -46,7 +59,7 @@ void fgWeatherInit( void ) {
/* Configure some wind */
/* 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 = &current_weather;
return ( w->visibility );
}
/* Set the visibility and update fog parameters */
void fgWeatherSetVisibility( float visibility ) {
struct fgWEATHER *w;
w = &current_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.
*

View file

@ -36,6 +36,7 @@ extern "C" {
/* holds the current weather values */
struct fgWEATHER {
float visibility;
float fog_density;
};
extern struct fgWEATHER current_weather;
@ -49,6 +50,14 @@ void fgWeatherInit( void );
void fgWeatherUpdate( void );
/* Get the current visibility */
float fgWeatherGetVisibility( void );
/* Set the visibility and update fog parameters */
void fgWeatherSetVisibility( float visibility );
#ifdef __cplusplus
}
#endif
@ -58,9 +67,15 @@ void fgWeatherUpdate( void );
/* $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
*