예제 #1
0
double cTerrainGen2D::BuildMixed(double width, const tParams& params, cRand& rand, std::vector<float>& out_data)
{
	double total_w = 0;
	const int num_types = 3;
	const double dummy_w = gVertSpacing;

	while (total_w < width)
	{
		double curr_w = 0;
		int rand_type = rand.RandInt(0, num_types);

		if (rand_type == 0)
		{
			curr_w = BuildGaps(dummy_w, params, rand, out_data);
		}
		else if (rand_type == 1)
		{
			curr_w = BuildSteps(dummy_w, params, rand, out_data);
		}
		else if (rand_type == 2)
		{
			curr_w = BuildWalls(dummy_w, params, rand, out_data);
		}

		total_w += curr_w;
	}

	return total_w;
}
예제 #2
0
ODEBaseScene::ODEBaseScene(ODEDomain *domain):BaseScene(domain)
{    
    m_domain=domain;
    printf("ODEBaseScene constructor\n");            
    
    BuildWalls();
}
예제 #3
0
double cTerrainGen2D::BuildSlopesWalls(double width, const tParams& params, cRand& rand, std::vector<float>& out_data)
{
	const double delta_range = std::abs(params[eParamsSlopeDeltaRange]);
	const double delta_min = params[eParamsSlopeDeltaMin];
	const double delta_max = params[eParamsSlopeDeltaMax];

	int beg_idx = static_cast<int>(out_data.size());
	double total_w = BuildWalls(width, params, rand, out_data);
	int end_idx = static_cast<int>(out_data.size());

	OverlaySlopes(delta_range, delta_min, delta_max, 0, beg_idx, end_idx, rand, out_data);

	return total_w;
}