|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : Rain.cpp 00004 * Part of : OpenGLEx / Rain 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 // INCLUDE FILES 00017 00018 #include "rain.h" 00019 #include <aknnotewrappers.h> 00020 #include <e32math.h> 00021 00022 // CONSTANTS 00023 00024 /* Define vertice coordinates for rain */ 00025 static const GLbyte rainVertices[2 * 3] = 00026 { 00027 0,3,0, 00028 0,0,0, 00029 }; 00030 00031 /* Define vertice coordinates for the ground plane */ 00032 static const GLbyte planeVertices[4 * 3] = 00033 { 00034 +1,0,-1, 00035 +1,0,+1, 00036 -1,0,+1, 00037 -1,0,-1 00038 }; 00039 00040 /* Define texture coordinates for ground plane */ 00041 static const GLbyte planeTextureCoords[4 * 2] = 00042 { 00043 0, 10, 00044 0, 0, 00045 10, 0, 00046 10, 10 00047 }; 00048 00049 00050 /* Define indices for drawing the triangles of the ground plane */ 00051 static const GLubyte planeTriangles[2 * 3] = 00052 { 00053 0,2,1, 00054 0,3,2 00055 }; 00056 00057 00058 /* Define vertice coordinates for tree */ 00059 static const GLbyte treeVertices[4 * 3] = 00060 { 00061 +1, 0,0, 00062 +1,+1,0, 00063 -1,+1,0, 00064 -1, 0,0 00065 }; 00066 00067 /* Define texture coordinates for tree */ 00068 static const GLbyte treeTextureCoords[4 * 2] = 00069 { 00070 0, 1, 00071 0, 0, 00072 1, 0, 00073 1, 1 00074 }; 00075 00076 /* Define indices for drawing the tree */ 00077 static const GLubyte treeTriangles[2 * 3] = 00078 { 00079 0,1,2, 00080 0,2,3 00081 }; 00082 00083 00084 /* Define indices for drawing the clouds */ 00085 static const GLubyte cloudTriangles [] = 00086 { 00087 0,1,2, 00088 0,2,3 00089 }; 00090 00091 // LOCAL CONSTANTS AND MACROS 00092 00093 #define TREE_STEP_X 30.0f 00094 #define TREE_STEP_Z 100.0f 00095 00096 00097 // ============================= MEMBER FUNCTIONS =============================== 00098 00099 // ----------------------------------------------------------------------------- 00100 // CRain::NewL 00101 // Symbian 2-phase constructor. Can leave. 00102 // ----------------------------------------------------------------------------- 00103 // 00104 CRain* CRain::NewL( TUint aWidth, TUint aHeight ) 00105 { 00106 /* Symbian 2-phase constructor. Calls both the default 00107 C++ constructor and Symbian ConstructL methods */ 00108 CRain* self = new (ELeave) CRain( aWidth, aHeight ); 00109 CleanupStack::PushL( self ); 00110 self->ConstructL(); 00111 CleanupStack::Pop(); 00112 00113 return self; 00114 } 00115 00116 00117 // Destructor. 00118 00119 CRain::~CRain() 00120 { 00121 } 00122 00123 // ----------------------------------------------------------------------------- 00124 // CRain::AppInit 00125 // Application initialization code. 00126 // ----------------------------------------------------------------------------- 00127 // 00128 void CRain::AppInitL( void ) 00129 { 00130 /* Set the screen background color. */ 00131 glClearColor( 0.f, 0.f, 0.f, 1.f ); 00132 00133 /* Enable back face culling. */ 00134 glEnable( GL_CULL_FACE ); 00135 glEnable( GL_TEXTURE_2D ); 00136 glEnable( GL_DEPTH_TEST ); 00137 00138 //Enable alpha test for color keying. 00139 glEnable( GL_ALPHA_TEST ); 00140 glAlphaFunc( GL_GREATER, 0.0f ); 00141 00142 /*Disable lighting */ 00143 glDisable( GL_LIGHTING ); 00144 00145 /* Initialize viewport and projection. */ 00146 glViewport( 0, 0, iScreenWidth, iScreenHeight ); 00147 glMatrixMode( GL_PROJECTION ); 00148 GLfloat aspectRatio = (GLfloat)(iScreenWidth) / (GLfloat)(iScreenHeight); 00149 glFrustumf( FRUSTUM_LEFT * aspectRatio, FRUSTUM_RIGHT * aspectRatio, 00150 FRUSTUM_BOTTOM, FRUSTUM_TOP, 00151 FRUSTUM_NEAR, FRUSTUM_FAR ); 00152 00153 00154 // Calculate cloud vertices based on the aspect ratio 00155 iCloudVertices[ 0 ] = FRUSTUM_RIGHT * aspectRatio; 00156 iCloudVertices[ 1 ] = 0.f; 00157 iCloudVertices[ 2 ] = -FRUSTUM_NEAR; 00158 00159 iCloudVertices[ 3 ] = FRUSTUM_RIGHT * aspectRatio; 00160 iCloudVertices[ 4 ] = FRUSTUM_TOP; 00161 iCloudVertices[ 5 ] = -FRUSTUM_NEAR; 00162 00163 iCloudVertices[ 6 ] = FRUSTUM_LEFT * aspectRatio; 00164 iCloudVertices[ 7 ] = FRUSTUM_TOP; 00165 iCloudVertices[ 8 ] = -FRUSTUM_NEAR; 00166 00167 iCloudVertices[ 9 ] = FRUSTUM_LEFT * aspectRatio; 00168 iCloudVertices[ 10 ] = 0.f; 00169 iCloudVertices[ 11 ] = -FRUSTUM_NEAR; 00170 00171 00172 glMatrixMode( GL_MODELVIEW ); 00173 00174 /* Enable vertex arrays. */ 00175 glEnableClientState( GL_VERTEX_ARRAY ); 00176 /* Enable texture arrays. */ 00177 glEnableClientState( GL_TEXTURE_COORD_ARRAY ); 00178 00179 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); 00180 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); 00181 00182 iCloudTextureCoords[0] = 0; iCloudTextureCoords[1] = 1; 00183 iCloudTextureCoords[2] = 0; iCloudTextureCoords[3] = 0; 00184 iCloudTextureCoords[4] = 1; iCloudTextureCoords[5] = 0; 00185 iCloudTextureCoords[6] = 1; iCloudTextureCoords[7] = 1; 00186 00187 iRainfall = CRainfall::NewL(1000, TVector(0, 80, -(FRUSTUM_FAR+FRUSTUM_NEAR)/2), 120, (FRUSTUM_FAR-FRUSTUM_NEAR), 0); 00188 00189 iCamera.LookAt(TVector(0, 30.0f, 0), TVector(0, 0, -(FRUSTUM_FAR+FRUSTUM_NEAR)/2), TVector(0, 1, 0)); 00190 00191 // Construct a texture manager that uses the application's private 00192 // directory as the source location for all textures. 00193 iTextureManager = CTextureManager::NewL( iScreenWidth, iScreenWidth, 00194 FRUSTUM_TOP, FRUSTUM_BOTTOM, FRUSTUM_RIGHT, FRUSTUM_LEFT, FRUSTUM_NEAR, 00195 this ); 00196 00197 // Defining a color key interval for the tree texture. 00198 TUint8 MinColor[] = { 50, 0, 50}; 00199 TUint8 MaxColor[] = { 200, 0, 200}; 00200 00201 // Pushing the textures into the loading queue. 00202 _LIT(KTreeName, "tree.gif"); 00203 _LIT(KGrassName, "grass.jpg"); 00204 _LIT(KCloudName, "cloud.jpg"); 00205 00206 iTextureManager->RequestToLoad(KTreeName , &iTreeTexture, MinColor, MaxColor ); 00207 iTextureManager->RequestToLoad(KGrassName, &iGrassTexture ); 00208 iTextureManager->RequestToLoad(KCloudName, &iCloudTexture ); 00209 00210 //Start to load the textures. 00211 iTextureManager->DoLoadL(); 00212 } 00213 00214 // ----------------------------------------------------------------------------- 00215 // CRain::AppExit 00216 // Application cleanup code. 00217 // ----------------------------------------------------------------------------- 00218 // 00219 void CRain::AppExit( void ) 00220 { 00221 delete iRainfall; 00222 delete iTextureManager; 00223 } 00224 00225 // ----------------------------------------------------------------------------- 00226 // CRain::DrawPlane 00227 // Draws the ground plane. 00228 // ----------------------------------------------------------------------------- 00229 // 00230 void CRain::DrawPlane() 00231 { 00232 glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE ); 00233 00234 glBindTexture( GL_TEXTURE_2D, iGrassTexture.iID ); 00235 00236 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_NEAREST); 00237 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_NEAREST); 00238 00239 glLoadIdentity(); 00240 T3DModel::MakeWorldViewMatrix(iCamera, TVector(0.0f, 0.0f, 0.0f)); 00241 glScalef( 1000, 0, 1000 ); 00242 00243 glVertexPointer( 3, GL_BYTE, 0, planeVertices ); 00244 glTexCoordPointer( 2, GL_BYTE, 0, planeTextureCoords ); 00245 glDrawElements( GL_TRIANGLES, 2 * 3, GL_UNSIGNED_BYTE, planeTriangles ); 00246 00247 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); 00248 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); 00249 00250 glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); 00251 } 00252 00253 // ----------------------------------------------------------------------------- 00254 // CRain::DrawCloud 00255 // Draws the clouds. 00256 // ----------------------------------------------------------------------------- 00257 // 00258 void CRain::DrawCloud() 00259 { 00260 iTextureOffset += (GLfloat)(0.01 * iElapsedTime); 00261 00262 iCloudTextureCoords[0] = iCloudTextureCoords[2]= iTextureOffset; 00263 iCloudTextureCoords[4] = iCloudTextureCoords[6]= iTextureOffset+0.4f; 00264 00265 glLoadIdentity(); 00266 glBindTexture( GL_TEXTURE_2D, iCloudTexture.iID ); 00267 00268 glVertexPointer( 3, GL_FLOAT, 0, iCloudVertices ); 00269 glTexCoordPointer( 2, GL_FLOAT, 0, iCloudTextureCoords ); 00270 glDrawElements( GL_TRIANGLES, 2 * 3, GL_UNSIGNED_BYTE, cloudTriangles ); 00271 } 00272 00273 // ----------------------------------------------------------------------------- 00274 // CRain::DrawTree 00275 // Draws a tree. 00276 // ----------------------------------------------------------------------------- 00277 // 00278 void CRain::DrawTree(GLfloat aX, GLfloat aZ) 00279 { 00280 glLoadIdentity(); 00281 00282 //Turns the tree so that it always faces the camera. 00283 T3DModel::MakeBillboardWorldViewMatrix(iCamera, TVector(aX, 0.0f, aZ)); 00284 glScalef( 10, 30, 10 ); 00285 00286 glBindTexture( GL_TEXTURE_2D, iTreeTexture.iID ); 00287 00288 glVertexPointer( 3, GL_BYTE, 0, treeVertices ); 00289 glTexCoordPointer( 2, GL_BYTE, 0, treeTextureCoords ); 00290 glDrawElements( GL_TRIANGLES, 2 * 3, GL_UNSIGNED_BYTE, treeTriangles ); 00291 00292 } 00293 00294 00295 // ----------------------------------------------------------------------------- 00296 // CRain::AppCycle 00297 // Draws and animates the objects. 00298 // ----------------------------------------------------------------------------- 00299 // 00300 void CRain::AppCycle( TInt /*aFrame*/ ) 00301 { 00302 glClear( GL_DEPTH_BUFFER_BIT ); 00303 00304 iT0 = iT1; 00305 do 00306 { 00307 iT1 = GetTimeTick(); 00308 //Compute the Elapsed time (in sec.) between the current and the previous frame. 00309 iElapsedTime = I64LOW( iT1.MicroSecondsFrom( iT0 ).Int64() * ( 1 / 1000000.0f ) ); 00310 } while ( iElapsedTime == 0 ); 00311 iFPSCount = 1 / (iElapsedTime); //Compute the frame rate. 00312 00313 /* Draws the clouds, and the ground plane */ 00314 glDisable( GL_DEPTH_TEST ); 00315 DrawCloud(); 00316 DrawPlane(); 00317 00318 //Draw the trees. 00319 DrawTree( -TREE_STEP_X, -1*TREE_STEP_Z); 00320 DrawTree( +TREE_STEP_X, -1*TREE_STEP_Z); 00321 DrawTree( -TREE_STEP_X, -2*TREE_STEP_Z); 00322 DrawTree( +TREE_STEP_X, -2*TREE_STEP_Z); 00323 00324 glEnable( GL_DEPTH_TEST ); 00325 00326 /*Update and render the particle engine */ 00327 iRainfall->UpdateEngine(iElapsedTime); 00328 iRainfall->RenderEngine(iCamera); 00329 } 00330 00331 // ---------------------------------------------------------------------- 00332 // CRain::CRain 00333 // C++ default constructor can NOT contain any code, that 00334 // might leave. 00335 // ---------------------------------------------------------------------- 00336 // 00337 CRain::CRain( TUint aWidth, TUint aHeight ) 00338 : CFiniteStateMachine() 00339 { 00340 iScreenWidth = aWidth; 00341 iScreenHeight = aHeight; 00342 00343 } 00344 00345 // ---------------------------------------------------------------------- 00346 // CRain::ConstructL 00347 // Symbian 2nd phase constructor can leave. 00348 // ---------------------------------------------------------------------- 00349 // 00350 void CRain::ConstructL( void ) 00351 { 00352 } 00353 00354 // --------------------------------------------------------- 00355 // CRain::OnEnterState( TInt aState ) 00356 // Called by TFiniteStateMachine when the f.s.m enters a new state 00357 // --------------------------------------------------------- 00358 void CRain::OnEnterStateL( TInt aState ) 00359 { 00360 switch ( aState ) 00361 { 00362 case ERunning: 00363 iT1 = GetTimeTick(); 00364 break; 00365 default: 00366 break; 00367 } 00368 } 00369 00370 // ------------------------------------------------------------------------------------------------------- 00371 // CRain::OnStartLoadingTextures() 00372 // Called for a MTextureLoadingListener by the texture manager when texture loading operation starts 00373 // ------------------------------------------------------------------------------------------------------- 00374 00375 void CRain::OnStartLoadingTexturesL() 00376 { 00377 SetStateL( ELoadingTextures ); 00378 } 00379 00380 // ------------------------------------------------------------------------------------------------------------ 00381 // CRain::OnEndLoadingTextures() 00382 // Called for a MTextureLoadingListener by the texture manager when texture loading operation is completed 00383 // ------------------------------------------------------------------------------------------------------------ 00384 00385 void CRain::OnEndLoadingTexturesL() 00386 { 00387 if ( GetState() == ELoadingTextures ) 00388 { 00389 SetStateL( ERunning ); 00390 } 00391 } 00392 00393 // ---------------------------------------------------------------------- 00394 // CRain::GetTimeTick 00395 // Get the current time 00396 // Returns: The current time. 00397 // ---------------------------------------------------------------------- 00398 // 00399 TTime CRain::GetTimeTick() 00400 { 00401 TTime time; 00402 time.UniversalTime(); 00403 00404 return time; 00405 } 00406 00407 // ---------------------------------------------------------------------- 00408 // CRain::GetRainfall 00409 // Get the particle effect 00410 // ---------------------------------------------------------------------- 00411 // 00412 CRainfall* CRain::GetRainfall() 00413 { 00414 return iRainfall; 00415 } 00416 00417 // ---------------------------------------------------------------------- 00418 // CRain::GetElapsedTime 00419 // Get the elapsed time. 00420 // ---------------------------------------------------------------------- 00421 // 00422 GLfloat CRain::GetElapsedTime() 00423 { 00424 return iElapsedTime; 00425 } 00426 00427 // ---------------------------------------------------------------------- 00428 // CRain::GetFPSCount 00429 // Get current frames per second. 00430 // ---------------------------------------------------------------------- 00431 // 00432 GLfloat CRain::GetFPSCount() 00433 { 00434 return iFPSCount; 00435 } 00436 00437 // ----------------------------------------------------------------------------- 00438 // CRain::SetScreenSize 00439 // Reacts to the dynamic screen size change during execution of this program. 00440 // ----------------------------------------------------------------------------- 00441 // 00442 void CRain::SetScreenSize( TUint aWidth, TUint aHeight ) 00443 { 00444 iScreenWidth = aWidth; 00445 iScreenHeight = aHeight; 00446 00447 // Notify the texture manager of screen size change 00448 iTextureManager->SetScreenSize( aWidth, aHeight ); 00449 00450 // Reinitialize viewport and projection. 00451 glViewport( 0, 0, iScreenWidth, iScreenHeight ); 00452 00453 // Recalculate the view frustrum 00454 glMatrixMode( GL_PROJECTION ); 00455 glLoadIdentity(); 00456 GLfloat aspectRatio = (GLfloat)(iScreenWidth) / (GLfloat)(iScreenHeight); 00457 glFrustumf( FRUSTUM_LEFT * aspectRatio, FRUSTUM_RIGHT * aspectRatio, 00458 FRUSTUM_BOTTOM, FRUSTUM_TOP, 00459 FRUSTUM_NEAR, FRUSTUM_FAR ); 00460 glMatrixMode( GL_MODELVIEW ); 00461 00462 // Recalculate cloud vertices based on the aspect ratio 00463 iCloudVertices[ 0 ] = FRUSTUM_RIGHT * aspectRatio; 00464 iCloudVertices[ 1 ] = 0.f; 00465 iCloudVertices[ 2 ] = -FRUSTUM_NEAR; 00466 00467 iCloudVertices[ 3 ] = FRUSTUM_RIGHT * aspectRatio; 00468 iCloudVertices[ 4 ] = FRUSTUM_TOP; 00469 iCloudVertices[ 5 ] = -FRUSTUM_NEAR; 00470 00471 iCloudVertices[ 6 ] = FRUSTUM_LEFT * aspectRatio; 00472 iCloudVertices[ 7 ] = FRUSTUM_TOP; 00473 iCloudVertices[ 8 ] = -FRUSTUM_NEAR; 00474 00475 iCloudVertices[ 9 ] = FRUSTUM_LEFT * aspectRatio; 00476 iCloudVertices[ 10 ] = 0.f; 00477 iCloudVertices[ 11 ] = -FRUSTUM_NEAR; 00478 } 00479 00480 // ---------------------------------------------------------------------- 00481 // CRainfall::CRainfall 00482 // C++ default constructor can NOT contain any code, that can leave 00483 // ---------------------------------------------------------------------- 00484 // 00485 CRainfall::CRainfall() 00486 { 00487 } 00488 00489 // ---------------------------------------------------------------------- 00490 // CRainfall::NewL 00491 // 2nd Two-phased constructor. 00492 // Creates and initializes a CRainfall object: 00493 // raindrops are released from within 00494 // the rectangle (aPosition.iX-aWidth/2, aPosition.iY, aPosition.iX-aWidth/2) 00495 // (aPosition.iX+aWidth/2, aPosition.iY, aPosition.iX+aWidth/2). 00496 // Once their height is < iGroundLevel, they are reset.// Returns: The current time. 00497 // ---------------------------------------------------------------------- 00498 // 00499 CRainfall* CRainfall::NewL(GLint aParticlesCount, TVector aPosition, 00500 GLfloat aWidth, GLfloat aDepth, GLfloat aGroundLevel) 00501 { 00502 /* Symbian 2-phase constructor. Calls both the default 00503 C++ constructor and Symbian ConstructL methods */ 00504 CRainfall* self = new (ELeave) CRainfall; 00505 CleanupStack::PushL( self ); 00506 self->ConstructL( aParticlesCount, aPosition, aWidth, aDepth, aGroundLevel); 00507 CleanupStack::Pop(); 00508 00509 return self; 00510 } 00511 00512 // ---------------------------------------------------------------------- 00513 // CRainfall::ConstructL 00514 // 2nd phase constructor 00515 // Initializes a CRainfall object: 00516 // raindrops are released from within 00517 // the rectangle (aPosition.iX-aWidth/2, aPosition.iY, aPosition.iX-aWidth/2) 00518 // (aPosition.iX+aWidth/2, aPosition.iY, aPosition.iX+aWidth/2). 00519 // Once their height is < iGroundLevel, they are reset. 00520 // ---------------------------------------------------------------------- 00521 // 00522 void CRainfall::ConstructL(GLint aParticlesCount, TVector aPosition, 00523 GLfloat aWidth, GLfloat aDepth, GLfloat aGroundLevel) 00524 { 00525 CParticleEngine::ConstructL(aParticlesCount, aPosition); 00526 00527 iWidth = aWidth; 00528 iDepth = aDepth; 00529 iGroundLevel = aGroundLevel; 00530 00531 TTime now; 00532 now.HomeTime(); 00533 iSeed = now.Int64(); 00534 00535 ResetEngine(); 00536 } 00537 00538 // Destructor. 00539 CRainfall::~CRainfall() 00540 { 00541 } 00542 00543 // ---------------------------------------------------------------------- 00544 // CRainfall::ResetParticle 00545 // Implementation of CParticleEngine::ResetParticle(GLint) 00546 // ---------------------------------------------------------------------- 00547 // 00548 void CRainfall::ResetParticle(GLint aIndex) 00549 { 00550 00551 TParticle & Particle = iParticles[aIndex]; 00552 00553 Particle.iPosition = TVector( iWidth * (Random() - 0.5f), 0, iDepth * (Random() - 0.5f)) + iPosition; 00554 Particle.iVelocity = TVector( 0, (GLfloat)(-(Random()*20.0f+20.0f)), 0); 00555 } 00556 00557 // ---------------------------------------------------------------------- 00558 // CRainfall::UpdateEngine 00559 // Implementation of CParticleEngine::UpdateEngine(GLfloat aElapsedTime) 00560 // ---------------------------------------------------------------------- 00561 // 00562 void CRainfall::UpdateEngine(GLfloat aElapsedTime) 00563 { 00564 for ( GLint i = 0; i < iParticlesCount; i++ ) 00565 { 00566 iParticles[i].iPosition += (iParticles[i].iVelocity * aElapsedTime); 00567 if ( iParticles[i].iPosition.iY < iGroundLevel ) 00568 { 00569 ResetParticle(i); 00570 } 00571 } 00572 } 00573 00574 00575 // ---------------------------------------------------------------------- 00576 // CRainfall::UpdateEngine 00577 // Implementation of CParticleEngine::RenderEngine(TCamera &) 00578 // ---------------------------------------------------------------------- 00579 // 00580 void CRainfall::RenderEngine(TCamera & aCamera) 00581 { 00582 glDisable( GL_TEXTURE_2D ); 00583 glEnable(GL_BLEND); 00584 00585 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 00586 glColor4f( 1.0f, 1.0f, 1.0f, 0.5f ); 00587 00588 TVector CameraPos = aCamera.GetPosition(); 00589 00590 glVertexPointer( 3, GL_BYTE, 0, rainVertices ); 00591 for ( GLint i = 0; i < iParticlesCount; i++ ) 00592 { 00593 glLoadIdentity(); 00594 glTranslatef(iParticles[i].iPosition.iX-CameraPos.iX, 00595 iParticles[i].iPosition.iY-CameraPos.iY, 00596 iParticles[i].iPosition.iZ-CameraPos.iZ); 00597 00598 glDrawArrays( GL_LINES, 0, 2 ); 00599 } 00600 00601 glEnable( GL_TEXTURE_2D ); 00602 glDisable(GL_BLEND); 00603 } 00604 00605 // ---------------------------------------------------------------------- 00606 // CRainfall::Random 00607 // Implementation of CParticleEngine::Random 00608 // Create a random float number. 00609 // ---------------------------------------------------------------------- 00610 // 00611 GLfloat CRainfall::Random() 00612 { 00613 return ((GLfloat)(Math::FRand(iSeed))); 00614 } 00615
|
© Nokia 2006 |