Ticket #1680: small.patch
File small.patch, 3.1 KB (added by , 12 years ago) |
---|
-
source/graphics/GameView.cpp
515 515 const ssize_t patchesPerSide = pTerrain->GetPatchesPerSide(); 516 516 517 517 // find out which patches will be drawn 518 CPatch * patch = NULL; 519 CPatch *nPatch = NULL; 520 float waterHeight; 521 CBoundingBoxAligned bounds; 522 518 523 for (ssize_t j=0; j<patchesPerSide; j++) { 519 524 for (ssize_t i=0; i<patchesPerSide; i++) { 520 CPatch*patch=pTerrain->GetPatch(i,j); // can't fail525 patch=pTerrain->GetPatch(i,j); // can't fail 521 526 522 527 // If the patch is underwater, calculate a bounding box that also contains the water plane 523 CBoundingBoxAligned bounds = patch->GetWorldBounds(); 524 float waterHeight = g_Renderer.GetWaterManager()->m_WaterHeight + 0.001f; 528 bounds = patch->GetWorldBounds(); 529 waterHeight = g_Renderer.GetWaterManager()->m_WaterHeight + 0.001f; 530 525 531 if(bounds[1].Y < waterHeight) { 526 532 bounds[1].Y = waterHeight; 527 533 } … … 533 539 patch->setDrawState(true); 534 540 535 541 // set the renderstate for the neighbors 536 CPatch *nPatch;537 542 538 543 nPatch = pTerrain->GetPatch(i-1,j-1); 539 544 if(nPatch) nPatch->setDrawState(true); … … 567 572 { 568 573 for (ssize_t i=0; i<patchesPerSide; i++) 569 574 { 570 CPatch*patch=pTerrain->GetPatch(i,j); // can't fail575 patch=pTerrain->GetPatch(i,j); // can't fail 571 576 if(patch->getDrawState() == true) 572 577 { 573 578 c->Submit(patch); -
source/graphics/Frustum.cpp
95 95 } 96 96 bool CFrustum::IsSphereVisible (const CVector3D ¢er, float radius) const 97 97 { 98 float Dist; 99 98 100 for (size_t i=0; i<m_NumPlanes; i++) 99 101 { 100 floatDist = m_aPlanes[i].DistanceToPlane (center);102 Dist = m_aPlanes[i].DistanceToPlane (center); 101 103 102 104 //is it behind the plane 103 105 if (Dist < 0) -
source/graphics/Camera.cpp
415 415 416 416 // intermediate planes 417 417 CVector3D intermediatePoints[4]; 418 for(int i = 0; i < intermediates; ++i)419 {420 float t = (i+1.0)/(intermediates+1.0);421 418 422 for(int j = 0; j < 4; ++j) 423 intermediatePoints[j] = nearPoints[j]*t + farPoints[j]*(1.0-t); 419 float t; 420 421 for(int i = 0; i < intermediates; ++i) 422 { 423 t = (i+1.0)/(intermediates+1.0); 424 425 for(int j = 0; j < 4; ++j) 426 intermediatePoints[j] = nearPoints[j]*t + farPoints[j]*(1.0-t); 424 427 425 426 427 428 429 430 431 428 glBegin(GL_POLYGON); 429 glVertex3fv(&intermediatePoints[0].X); 430 glVertex3fv(&intermediatePoints[1].X); 431 glVertex3fv(&intermediatePoints[2].X); 432 glVertex3fv(&intermediatePoints[3].X); 433 glEnd(); 434 } 432 435 #endif 433 436 }