Ejemplo n.º 1
0
    virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const
    {
        states.transform *= getTransform();

        if (_bVisible){ DrawHook(target, states); }
        for(Widget* child : GetChildren())
        {
            child->draw(target, states);
        }
    }
Ejemplo n.º 2
0
void DrawCrane()
{
	int platformPosition = ((50 - move_control)*(minMovePlarform - maxMovePlatform) / 80 + (minMovePlarform + maxMovePlatform) / 2);
	//draw base
	glPushMatrix();
	glTranslated(4, 1, 0);
	glColor3d(0.5, 0.5, 0.5);
	DrawCraneCube();
	glPopMatrix();

	// TODO

	//hookInitialStartX = platformPosition;
	hookInitialStartZ = platformPosition;

	// Draw Crane Hook Platform
	glPushMatrix();
	// 80 is the range of the controll
	glTranslated(4, 11, platformPosition);
	DrawHook();
	DrawCraneHookPlatform();
	glPopMatrix();



	// Vertical Ladder
	DrawCraneLadder();

	// Horizontal Ladder
	glPushMatrix();
	glTranslated(0, 12, -4);
	glRotated(90, 1, 0, 0);
	DrawCraneLadder();
	glPopMatrix();

}