1
0
Fork 0
flightgear/src/FDM/UIUCModel/uiuc_fog.cpp
curt 19e7e93787 /FDM/UIUCModel/uiuc_aircraft.h
Added variables necessary for new abilities.
/FDM/UIUCModel/uiuc_coefficients.cpp
/FDM/UIUCModel/uiuc_coefficients.h
/FDM/UIUCModel/uiuc_coef_lift.cpp
	Added CZfa.
/FDM/UIUCModel/uiuc_controlInput.cpp
	Added aileron and rudder inputs.
/FDM/UIUCModel/uiuc_engine.cpp
	Added throttle input.
/FDM/UIUCModel/uiuc_engine.h
/FDM/UIUCModel/uiuc_map_CL.cpp
/FDM/UIUCModel/uiuc_map_engine.cpp
/FDM/UIUCModel/uiuc_map_init.cpp
/FDM/UIUCModel/uiuc_menu.cpp
/FDM/UIUCModel/uiuc_wrapper.cpp
	Added a few new functions.
/FDM/UIUCModel/uiuc_wrapper.h
/FDM/UIUCModel/uiuc_map_controlSurface.cpp
/FDM/UIUCModel/uiuc_initializemaps.cpp
/FDM/UIUCModel/uiuc_initializemaps.h
/FDM/UIUCModel/uiuc_map_keyword.cpp
/FDM/UIUCModel/Makefile.am
/Main/Makefile.am

added files
/FDM/UIUCModel/uiuc_map_fog.cpp
	For the visibility ability.
/FDM/UIUCModel/uiuc_map_fog.h
/FDM/UIUCModel/uiuc_fog.cpp
/FDM/UIUCModel/uiuc_fog.h
2001-09-14 20:36:34 +00:00

114 lines
3 KiB
C++

/**********************************************************************
FILENAME: uiuc_fog.cpp
----------------------------------------------------------------------
DESCRIPTION: changes Fog variable to +/-1 or 0 using fog
parameters and Simtime
----------------------------------------------------------------------
STATUS: alpha version
----------------------------------------------------------------------
REFERENCES:
----------------------------------------------------------------------
HISTORY: 05/20/2001 initial release
----------------------------------------------------------------------
AUTHOR(S): Michael Savchenko <savchenk@uiuc.edu>
----------------------------------------------------------------------
VARIABLES:
----------------------------------------------------------------------
INPUTS: -Simtime
-Fog
-fog_field
-fog_next_time
-fog_current_segment
-fog_value
-fog_time
----------------------------------------------------------------------
OUTPUTS: -Fog
-fog_field
-fog_next_time
-fog_current_segment
----------------------------------------------------------------------
CALLED BY: uiuc_wrapper
----------------------------------------------------------------------
CALLS TO: none
----------------------------------------------------------------------
COPYRIGHT: (C) 2000 by Michael Selig
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA or view http://www.gnu.org/copyleft/gpl.html.
**********************************************************************/
#include "uiuc_fog.h"
void uiuc_fog()
{
if (Simtime >= fog_next_time)
{
if (fog_current_segment != 0)
{
if (fog_value[fog_current_segment] > fog_value[fog_current_segment-1])
Fog = 1;
else if (fog_value[fog_current_segment] < fog_value[fog_current_segment-1])
Fog = -1;
else
Fog = 0;
}
else
Fog = 0;
if (Simtime > fog_time[fog_current_segment]) {
if (fog_current_segment == fog_segments)
{
fog_field = false;
Fog = 0;
return;
}
else
fog_current_segment++; }
if (fog_value[fog_current_segment] == fog_value[fog_current_segment-1])
fog_next_time = fog_time[fog_current_segment];
else
fog_next_time += (fog_time[fog_current_segment]-fog_time[fog_current_segment-1]) / abs(fog_value[fog_current_segment]-fog_value[fog_current_segment-1]);
}
else
Fog = 0;
return;
}