- w_point weather_generator::get_weather( const tripoint &location, const calendar &t,
- unsigned seed ) const
- {
- const double x( location.x /
- 2000.0 ); // Integer x position / widening factor of the Perlin function.
- const double y( location.y /
- 2000.0 ); // Integer y position / widening factor of the Perlin function.
- const double z( double( t.get_turn() + to_turns<int>( calendar::season_length() ) ) /
- 2000.0 ); // Integer turn / widening factor of the Perlin function.
-
- const double dayFraction = time_past_midnight( t ) / 1_days;
-
- //limit the random seed during noise calculation, a large value flattens the noise generator to zero
- //Windows has a rand limit of 32768, other operating systems can have higher limits
- const unsigned modSEED = seed % 32768;
-
- // Noise factors
- double T( raw_noise_4d( x, y, z, modSEED ) * 4.0 );
- double H( raw_noise_4d( x, y, z / 5, modSEED + 101 ) );
- double H2( raw_noise_4d( x, y, z, modSEED + 151 ) / 4 );
This file has been truncated. show original