示例#1
0
void House::CreatePyramid(double stepDeep)
{
	std::vector<Vertex*>::iterator itv;
	std::vector<Vertex*> tempVect;
	for (itv = vertices->begin(); itv != vertices->end(); ++itv)
	{
		tempVect.push_back(new Vertex(*(*itv)));
	}
	
	// first step
	CreateStep(tempVect, 0.f, 3.f);
	
	// others steps
	int i;
	for (i = 1; i < stepDeep; i++)
	{
		CreateStep(tempVect, 1.f+i*2.f, 1.f+(i+1)*2.f);
	}
	
	// last step
	if (vertices->size() == 4)
	{
		CreateRoof(tempVect, rand_int(0,3), 1.f+i*2.f, 1.f+(i+2)*2.f);
	}
	else
	{
		CreateRoof(tempVect, 1, 1.f+i*2.f, 1.f+(i+2)*2.f);
	}
	
	for (itv = tempVect.begin(); itv != tempVect.end(); ++itv)
	{
		delete *itv;
	}
	tempVect.clear();
}
示例#2
0
void AccDialog::CreateDialog()
{
    CreateDirection();
    CreateAccSpeed();
    CreateStep();
    CreateMapto();
    CreateMouseAct();
    CreateOnlyOne();
    CreateButtonBox();
}
示例#3
0
transform_group Building::CreatePyramid(int steps, Material* mat, int shape) {
    transform_group parent = share<Transform>();
    
    for (int i = 0; i<steps; i++){
        // chck if there is enough space for another step
        if (current_x_dim < pyramid_step_height/2 && current_z_dim < pyramid_step_height/2)
            break;
        transform_group step = CreateStep(mat, shape);
        parent->addChild(step);
    }
    
    // building variables set within each step
    prev_block_height   = steps*pyramid_step_height;
    prev_shape          = shape;
    prev_type           = PYRAMID;
    return parent;
}