本文整理汇总了C++中FluidSystem::GetToggle方法的典型用法代码示例。如果您正苦于以下问题:C++ FluidSystem::GetToggle方法的具体用法?C++ FluidSystem::GetToggle怎么用?C++ FluidSystem::GetToggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluidSystem
的用法示例。
在下文中一共展示了FluidSystem::GetToggle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw2D
void draw2D ()
{
mint::Time start, stop;
#ifdef USE_SHADOWS
disableShadows ();
#endif
glDisable ( GL_LIGHTING );
glDisable ( GL_DEPTH_TEST );
glMatrixMode ( GL_PROJECTION );
glLoadIdentity ();
glScalef ( 2.0/window_width, -2.0/window_height, 1 ); // Setup view (0,0) to (800,600)
glTranslatef ( -window_width/2.0, -window_height/2, 0.0);
glMatrixMode ( GL_MODELVIEW );
glLoadIdentity ();
glPushMatrix ();
glGetFloatv ( GL_MODELVIEW_MATRIX, view_matrix );
glPopMatrix ();
char disp[200];
glColor4f ( 1.0, 1.0, 1.0, 1.0 );
strcpy ( disp, "Press H for help." ); drawText ( 10, 20, disp );
if ( bHelp ) {
if ( psys.GetToggle ( USE_CUDA ) ) {
sprintf ( disp, "Kernel: USING CUDA (GPU)" ); drawText ( 20, 40, disp );
} else {
sprintf ( disp, "Kernel: USING CPU" ); drawText ( 20, 40, disp );
}
sprintf ( disp, "KEYBOARD" ); drawText ( 20, 60, disp );
sprintf ( disp, "[ ] Next/Prev Demo" ); drawText ( 20, 70, disp );
sprintf ( disp, "N M Adjust Max Particles" ); drawText ( 20, 80, disp );
sprintf ( disp, "space Pause" ); drawText ( 20, 90, disp );
sprintf ( disp, "S Shading mode" ); drawText ( 20, 100, disp );
sprintf ( disp, "G Toggle CUDA vs CPU" ); drawText ( 20, 110, disp );
sprintf ( disp, "< > Change emitter rate" ); drawText ( 20, 120, disp );
sprintf ( disp, "C Move camera /w mouse" ); drawText ( 20, 130, disp );
sprintf ( disp, "I Move emitter /w mouse" ); drawText ( 20, 140, disp );
sprintf ( disp, "O Change emitter angle" ); drawText ( 20, 150, disp );
sprintf ( disp, "L Move light /w mouse" ); drawText ( 20, 160, disp );
sprintf ( disp, "X Draw velocity/pressure/color" ); drawText ( 20, 170, disp );
Vector3DF vol = psys.GetVec(SPH_VOLMAX);
vol -= psys.GetVec(SPH_VOLMIN);
sprintf ( disp, "Volume Size: %3.5f %3.2f %3.2f", vol.x, vol.y, vol.z ); drawText ( 20, 190, disp );
sprintf ( disp, "Time Step (dt): %3.5f", psys.GetDT () ); drawText ( 20, 200, disp );
sprintf ( disp, "Num Particles: %d", psys.NumPoints() ); drawText ( 20, 210, disp );
sprintf ( disp, "Simulation Scale: %3.5f", psys.GetParam(SPH_SIMSIZE) ); drawText ( 20, 220, disp );
sprintf ( disp, "Simulation Size (m): %3.5f", psys.GetParam(SPH_SIMSCALE) ); drawText ( 20, 230, disp );
sprintf ( disp, "Smooth Radius (m): %3.3f", psys.GetParam(SPH_SMOOTHRADIUS) ); drawText ( 20, 240, disp );
sprintf ( disp, "Particle Radius (m): %3.3f", psys.GetParam(SPH_PRADIUS) ); drawText ( 20, 250, disp );
sprintf ( disp, "Particle Mass (kg): %0.8f", psys.GetParam(SPH_PMASS) ); drawText ( 20, 260, disp );
sprintf ( disp, "Rest Density (kg/m^3): %3.3f", psys.GetParam(SPH_RESTDENSITY) ); drawText ( 20, 270, disp );
sprintf ( disp, "Viscosity: %3.3f", psys.GetParam(SPH_VISC) ); drawText ( 20, 280, disp );
sprintf ( disp, "Internal Stiffness: %3.3f", psys.GetParam(SPH_INTSTIFF) ); drawText ( 20, 290, disp );
sprintf ( disp, "Boundary Stiffness: %6.0f", psys.GetParam(SPH_EXTSTIFF) ); drawText ( 20, 300, disp );
sprintf ( disp, "Boundary Dampening: %4.3f", psys.GetParam(SPH_EXTDAMP) ); drawText ( 20, 310, disp );
sprintf ( disp, "Speed Limiting: %4.3f", psys.GetParam(SPH_LIMIT) ); drawText ( 20, 320, disp );
vol = psys.GetVec ( PLANE_GRAV_DIR );
sprintf ( disp, "Gravity: %3.2f %3.2f %3.2f", vol.x, vol.y, vol.z ); drawText ( 20, 330, disp );
}
}