本文整理汇总了C++中FluidSystem::Toggle方法的典型用法代码示例。如果您正苦于以下问题:C++ FluidSystem::Toggle方法的具体用法?C++ FluidSystem::Toggle怎么用?C++ FluidSystem::Toggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluidSystem
的用法示例。
在下文中一共展示了FluidSystem::Toggle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboard_func
void keyboard_func ( unsigned char key, int x, int y )
{
switch( key ) {
case 'M': case 'm': {
psys_nmax *= 2;
if ( psys_nmax > 65535 ) psys_nmax = 65535;
psys.SPH_CreateExample ( psys_demo, psys_nmax );
} break;
case 'N': case 'n': {
psys_nmax /= 2;
if ( psys_nmax < 64 ) psys_nmax = 64;
psys.SPH_CreateExample ( psys_demo, psys_nmax );
} break;
case '0':
UpdateEmit ();
psys_freq++;
psys.SetVec ( EMIT_RATE, Vector3DF(psys_freq, psys_rate, 0) );
break;
case '9':
UpdateEmit ();
psys_freq--; if ( psys_freq < 0 ) psys_freq = 0;
psys.SetVec ( EMIT_RATE, Vector3DF(psys_freq, psys_rate, 0) );
break;
case '.': case '>':
UpdateEmit ();
if ( ++psys_rate > 100 ) psys_rate = 100;
psys.SetVec ( EMIT_RATE, Vector3DF(psys_freq, psys_rate, 0) );
break;
case ',': case '<':
UpdateEmit ();
if ( --psys_rate < 0 ) psys_rate = 0;
psys.SetVec ( EMIT_RATE, Vector3DF(psys_freq, psys_rate, 0) );
break;
case 'g': case 'G': psys.Toggle ( USE_CUDA ); break;
case 'f': case 'F': mode = MODE_DOF; break;
case 'z': case 'Z': mode = MODE_CAM_TO; break;
case 'c': case 'C': mode = MODE_CAM; break;
case 'h': case 'H': bHelp = !bHelp; break;
case 'i': case 'I':
UpdateEmit ();
mode = MODE_OBJPOS;
break;
case 'o': case 'O':
UpdateEmit ();
mode = MODE_OBJ;
break;
case 'x': case 'X':
if ( ++iClrMode > 2) iClrMode = 0;
psys.SetParam ( CLR_MODE, iClrMode );
break;
case 'l': case 'L': mode = MODE_LIGHTPOS; break;
case 'd': case 'D': {
int d = psys.GetParam ( PNT_DRAWMODE ) + 1;
if ( d > 2 ) d = 0;
psys.SetParam ( PNT_DRAWMODE, d );
} break;
case 's': case 'S': if ( ++iShade > 2 ) iShade = 0; break;
case 27: exit( 0 ); break;
case '`':
bRec = !bRec; break;
case ' ':
//psys.Run (); ptris.Rebuild (); break;
bPause = !bPause; break;
case '\'': case ';': psys.SPH_CreateExample ( psys_demo, psys_nmax ); break;
case 'r': case 'R': psys.SPH_CreateExample ( psys_demo, psys_nmax ); break;
case '[':
psys_demo--;
if (psys_demo < 0 ) psys_demo = 10;
psys.SPH_CreateExample ( psys_demo, psys_nmax );
UpdateEmit ();
break;
case ']':
psys_demo++;
if (psys_demo > 10 ) psys_demo = 0;
psys.SPH_CreateExample ( psys_demo, psys_nmax );
UpdateEmit ();
break;
default:
break;
}
}