Example #1
0
void MythUIType::SetVisible(bool visible)
{
    if (visible == m_Visible)
        return;

    m_Visible = visible;
    SetRedraw();

    if (m_Visible)
        emit Showing();
    else
        emit Hiding();
}
Example #2
0
File: main.cpp Project: Pinkii-/IDI
void teclado(unsigned char c, int x, int y) {
    (void)x;(void)y;
    switch (c) {
    case 27:
        glutExit();
        break;
    case 'h':
        help; //Nesisito aiuda amiho servesa bier
        std::cout << "You can see the state of the camera type on the up left corner." << std::endl;
        std::cout << "Press H to display the help(lolol)" << std::endl;
        std::cout << "Press R to reset the camera" << std::endl;
        std::cout << "Press P to switch between perspective and ortho camera" << std::endl;
        std::cout << "Press C to switch between first person camera and third person camera" << std::endl;
        std::cout << "Press WASD to move the Patricio" << std::endl;
        std::cout << "Press Z or X to increment/decrement the speed of the Patricio" << std::endl;
        std::cout << "Press V to make the walls visible/invisible" << std::endl;
        std::cout << "Press B to make the sfere of the scene visible/invisible" << std::endl;
        std::cout << "Press M to switch the model of the main character" << std::endl;
        std::cout << "Press O to change the polygon mode" << std::endl;
        std::cout << "Press Space to unleash the hidden and destructive power of the Killer Patricio" << std::endl;
        std::cout << std::endl;
        break;
    case 'w':
        patricio1.posFinal = patricio1.posFinal + Vector3f(sin(direccionPatricio*M_PI/180)*speed,0,cos(direccionPatricio*M_PI/180)*speed);
        updateCamera(); // Por si el patricio se ha salido de la esfera i ase iorar al ninio jisus
        glutPostRedisplay();
        break;
    case 's':
        patricio1.posFinal = patricio1.posFinal - Vector3f(sin(direccionPatricio*M_PI/180)*speed,0,cos(direccionPatricio*M_PI/180)*speed);
        updateCamera(); // Por si el patricio se ha salido de la esfera i ase iorar al ninio jisus
        glutPostRedisplay();
        break;
    case 'a':
        direccionPatricio += 2.5;
        if (fps) updateCamera();
        else glutPostRedisplay();
        break;
    case 'd':
        direccionPatricio -= 2.5;
        if (fps) updateCamera();
        else glutPostRedisplay();
        break;
    case 'z':
        speed += 0.03;
        break;
    case 'x':
        speed -= 0.03; if (speed < 0) speed = 0;
        break;
    case 'r':
        reset();
        glutPostRedisplay();
        break;
    case 'c':
        fps = not fps;
        if (fps) changeCamera(Fps);
        else changeCamera(ortho ? Ortho : Perspective);
        updateCamera();
        break;
    case 'p':
        if (cameraState != Fps) changeCamera(CameraType((cameraState+1)%(qttCameraType-1)));
        updateCameraType();
        break;
    case 'o':
        changeShowing(Showing((showing+1)%qttShowing));
        break;
    case 'm':
        patricio1.changeModel(Models((patricio1.name+1)%qttModels));
        glutPostRedisplay();
        break;
    case 'v':
        wallVisible = not wallVisible;
        glutPostRedisplay();
        break;
    case 'b':
        sferaVisible = not sferaVisible;
        glutPostRedisplay();
        break;
    case ' ':
        balas.push_back(Bala(patricio1.posFinal,direccionPatricio));
        break;
    default:
        break;
    }
}