From: Torsten Dreyer Date: Tue, 22 Dec 2015 10:41:56 +0000 (+0100) Subject: Remove unused code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b66cf3484b086289e2cd28ddb39f03be5372103;p=flightgear.git Remove unused code --- diff --git a/src/Environment/CMakeLists.txt b/src/Environment/CMakeLists.txt index ccff9f7e0..26ce261df 100644 --- a/src/Environment/CMakeLists.txt +++ b/src/Environment/CMakeLists.txt @@ -8,7 +8,6 @@ set(SOURCES ephemeris.cxx fgclouds.cxx fgmetar.cxx - fgwind.cxx metarairportfilter.cxx metarproperties.cxx precipitation_mgr.cxx @@ -28,7 +27,6 @@ set(HEADERS ephemeris.hxx fgclouds.hxx fgmetar.hxx - fgwind.hxx metarairportfilter.hxx metarproperties.hxx precipitation_mgr.hxx diff --git a/src/Environment/fgwind.cxx b/src/Environment/fgwind.cxx deleted file mode 100644 index 687a7ae41..000000000 --- a/src/Environment/fgwind.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// fgwind.cxx -- routines to create variable winds -// -// Written by Torsten Dreyer -// -// Copyright (C) 2009 Torsten Dreyer - Torsten _at_ t3r*de -// -// 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; either version 2 of the -// License, or (at your option) any later version. -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ -#include "fgwind.hxx" -#include -#include - -FGWindModulator::FGWindModulator() : - direction_offset_norm(0.0), - magnitude_factor_norm(1.0) -{ -} - -FGWindModulator::~FGWindModulator() -{ -} - -FGBasicWindModulator::FGBasicWindModulator() : - elapsed(0.0), - direction_period(17), - speed_period(1) -{ -} - -FGBasicWindModulator::~FGBasicWindModulator() -{ -} - -void FGBasicWindModulator::update( double dt) -{ - elapsed += dt; - double t = elapsed/direction_period; - - direction_offset_norm = (sin(t)*sin(2*t)+sin(t/3)) / 1.75; - - t = elapsed/speed_period; - magnitude_factor_norm = sin(t)* sin(5*direction_offset_norm*direction_offset_norm);; - magnitude_factor_norm = magnitude_factor_norm < 0 ? 0 : magnitude_factor_norm; -} diff --git a/src/Environment/fgwind.hxx b/src/Environment/fgwind.hxx deleted file mode 100644 index aa8235709..000000000 --- a/src/Environment/fgwind.hxx +++ /dev/null @@ -1,62 +0,0 @@ -// fgwind.hxx -- routines to create variable winds -// -// Written by Torsten Dreyer -// -// Copyright (C) 2009 Torsten Dreyer - Torsten _at_ t3r*de -// -// 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; either version 2 of the -// License, or (at your option) any later version. -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ -#ifndef _FGWIND_HXX -#define _FGWIND_HXX - -#include - -//////////////////////////////////////////////////////////////////////// -// A Wind Modulator interface, generates gusts and wind direction changes -//////////////////////////////////////////////////////////////////////// -class FGWindModulator : public SGReferenced { -public: - FGWindModulator(); - virtual ~FGWindModulator(); - virtual void update( double dt ) = 0; - double get_direction_offset_norm() const { return direction_offset_norm; } - double get_magnitude_factor_norm() const { return magnitude_factor_norm; } -protected: - double direction_offset_norm; - double magnitude_factor_norm; -}; - - -//////////////////////////////////////////////////////////////////////// -// A Basic Wind Modulator, implementation of FGWindModulator -// direction and magnitude variations are based on simple sin functions -//////////////////////////////////////////////////////////////////////// -class FGBasicWindModulator : public FGWindModulator { -public: - FGBasicWindModulator(); - virtual ~FGBasicWindModulator(); - virtual void update( double dt ); - void set_direction_period( double _direction_period ) { direction_period = _direction_period; } - double get_direction_period() const { return direction_period; } - void set_speed_period( double _speed_period ) { speed_period = _speed_period; } - double get_speed_period() const{ return speed_period; } -private: - double elapsed; - double direction_period; - double speed_period; -}; - -#endif