当前位置: 首页>>代码示例>>C++>>正文


C++ config::switchCamera方法代码示例

本文整理汇总了C++中config::switchCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ config::switchCamera方法的具体用法?C++ config::switchCamera怎么用?C++ config::switchCamera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config的用法示例。


在下文中一共展示了config::switchCamera方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: keyPressed

void keyPressed (unsigned char key, int x, int y)
{  
    x = y;
    y = x;

    keyStates[key] = true; // Set the state of the current key to pressed  


    // Handle keyboard input
    if(key == 27)//ESC
    {
        cleanUp();
        exit(0);
    }
    else if(key == 61)//=
    {
        //increase time rate
        simConfig.timeRate *= 2;
        if(simConfig.timeRate > 65792)
            simConfig.timeRate = 65792;
    }
    else if(key == 45)//-
    {
        //decrease time rate
        simConfig.timeRate /= 2.0;
        if(simConfig.timeRate < 1)
            simConfig.timeRate = 1;
    }
    else if(key == 'r')//reset the puck position (CHEATING)
    {
        simConfig.gameData.resetPuck();
    }
    else if(key == '1')//cameras
    {
        simConfig.switchCamera(2);
    }
    else if(key == '2')//cameras
    {
        simConfig.switchCamera(0);
    }
    else if(key == '3')//cameras
    {
        simConfig.switchCamera(1);
    }
    else if(key == '5')//themes
    {
        simConfig.gameData.switchTheme(1);
    }
    else if(key == '6')//themes
    {
        simConfig.gameData.switchTheme(2);
    }
    else if(key == '7')//themes
    {
        simConfig.gameData.switchTheme(3);
    }
    else if(key == '8')//themes
    {
        simConfig.gameData.switchTheme(4);
    }
    else if(key == 'c')
    {
        simConfig.lightPerVertex = !simConfig.lightPerVertex;
    }
    else if(key == 'h')
    {
        simConfig.showDetails = !simConfig.showDetails;
    }
    else if(key == 'y')//lights
    {
        simConfig.worldLights->toggle(0);
    }
    else if(key == 'u')//lights
    {
        simConfig.worldLights->toggle(1);
    }
    else if(key == 'i')//lights
    {
        simConfig.worldLights->toggle(2);
    }
    else if(key == 'o')//lights
    {
        simConfig.worldLights->toggle(3);
    }
    else if(key == 'p')//lights
    {
        simConfig.worldLights->toggle(4);
    }
    //ai toggle
    else if(key == '[')
    {
        simConfig.gameData.enableAI(1);
    }
    //ai toggle
    else if(key == ']')
    {
        simConfig.gameData.enableAI(2);
    }
    else if(key == ' ')//space
    {
//.........这里部分代码省略.........
开发者ID:afalconi,项目名称:Graphics,代码行数:101,代码来源:main.cpp

示例2: keyboard

void keyboard(unsigned char key, int x_pos, int y_pos)
{
    x_pos = y_pos;
    y_pos = x_pos;
    // Handle keyboard input
    if(key == 27)//ESC
    {
        cleanUp();
        exit(0);
    }
    else if(key == 61)//=
    {
        //increase time rate
        timeRate *= 2;
        if(timeRate > 65792)
            timeRate = 65792;
    }
    else if(key == 45)//-
    {
        //decrease time rate
        timeRate /= 2;
        if(timeRate < 1)
            timeRate = 1;
    }
    else if(key == 'h')
    {
        simConfig.showDetails = !simConfig.showDetails;
    }
    else if(key == '1')
    {
        simConfig.switchCamera(1);
    }
    else if(key == '2')
    {
        simConfig.switchCamera(2);
    }
    else if(key == '3')
    {
        simConfig.switchCamera(3);
    }
    else if(key == '4')
    {
        simConfig.switchCamera(4);
    }
    else if(key == '5')
    {
        simConfig.switchCamera(5);
    }
    else if(key == '6')
    {
        simConfig.switchCamera(6);
    }
    else if(key == '7')
    {
        simConfig.switchCamera(7);
    }
    else if(key == '8')
    {
        simConfig.switchCamera(8);
    }
    else if(key == '9')
    {
        simConfig.switchCamera(9);
    }
    else if(key == '0')
    {
        simConfig.switchCamera(0);
    }
    else if(key == ' ')//space
    {
        //toggle pause
        if(recentlyPaused)
           glutIdleFunc(update);
        else
        {
            recentlyPaused = true;
            glutIdleFunc(NULL);
        }
    }
}
开发者ID:afalconi,项目名称:Graphics,代码行数:80,代码来源:main.cpp


注:本文中的config::switchCamera方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。