|
From: Dave R. <tr...@us...> - 2004-09-30 20:35:44
|
Update of /cvsroot/bzflag/bzflag/src/bzflag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17169 Modified Files: playing.cxx Log Message: change near clipping plane from 1.1 to 0.5, and use const variables instead of numbers Index: playing.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzflag/playing.cxx,v retrieving revision 1.664 retrieving revision 1.665 diff -w -u -r1.664 -r1.665 --- playing.cxx 30 Sep 2004 11:08:44 -0000 1.664 +++ playing.cxx 30 Sep 2004 20:35:34 -0000 1.665 @@ -166,6 +166,10 @@ extern void doAutoPilot(float &rotation, float &speed); extern void teachAutoPilot( FlagType *, int ); +// Far and Near Frustum clipping planes +const float NearPlane = 0.5f; +const float FarPlaneScale = 1.5f; // gets multiplied by BZDB_WORLDSIZE + enum BlowedUpReason { GotKilledMsg, GotShot, @@ -3810,8 +3814,10 @@ targetPoint[1] = eyePoint[1] + 0.0f; targetPoint[2] = eyePoint[2] + 0.0f; sceneRenderer->getViewFrustum().setProjection(60.0f * M_PI / 180.0f, - 1.1f, 1.5f * worldSize, mainWindow->getWidth(), - mainWindow->getHeight(), mainWindow->getViewHeight()); + NearPlane, FarPlaneScale * worldSize, + mainWindow->getWidth(), + mainWindow->getHeight(), + mainWindow->getViewHeight()); sceneRenderer->getViewFrustum().setView(eyePoint, targetPoint); // reset some flags @@ -4199,7 +4205,7 @@ } float worldSize = BZDB.eval(StateDatabase::BZDB_WORLDSIZE); sceneRenderer->getViewFrustum().setProjection(fov, - 1.1f, 1.5f * worldSize, + NearPlane, FarPlaneScale * worldSize, mainWindow->getWidth(), mainWindow->getHeight(), mainWindow->getViewHeight()); @@ -4490,7 +4496,9 @@ const int w = mainWindow->getWidth(); const int h = mainWindow->getHeight(); const int vh = mainWindow->getViewHeight(); - sceneRenderer->getViewFrustum().setProjection(fov, 1.1f, 1.5f * worldSize, w, h, vh); + sceneRenderer->getViewFrustum().setProjection(fov, NearPlane, + FarPlaneScale * worldSize, + w, h, vh); sceneRenderer->render(); // set entire window @@ -5159,7 +5167,7 @@ static const GLfloat targetPoint[3] = { 0.0f, 10.0f, muzzleHeight }; float worldSize = BZDB.eval(StateDatabase::BZDB_WORLDSIZE); sceneRenderer->getViewFrustum().setProjection(45.0f * M_PI / 180.0f, - 1.1f, 1.5f * worldSize, + NearPlane, FarPlaneScale * worldSize, mainWindow->getWidth(), mainWindow->getHeight(), mainWindow->getViewHeight()); |