Beispiel #1
0
void cTerrainGen2D::OverlayBumps(double min_delta_h, double max_delta_h, int beg_idx, int end_idx,
									cRand& rand, std::vector<float>& out_data)
{
	double curr_slope = 0;
	double curr_delta_h = 0;
	assert(beg_idx < out_data.size());
	assert(end_idx <= out_data.size());

	for (int i = beg_idx; i < end_idx - 1; ++i)
	{
		double delta = rand.RandSign() * rand.RandDouble(min_delta_h, max_delta_h);
		out_data[i] += static_cast<float>(delta);
	}
}