diff options
Diffstat (limited to 'src/GameDraw.cpp')
-rw-r--r-- | src/GameDraw.cpp | 71 |
1 files changed, 25 insertions, 46 deletions
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp index c5f6ec5..e783559 100644 --- a/src/GameDraw.cpp +++ b/src/GameDraw.cpp @@ -595,60 +595,39 @@ void Game::DrawGLScene(void) if(person[0].currentanimation!=idleanim)alSourcef(gSourceID[visionsound], AL_PITCH, 2); } - //Camera - - float bluramount=.1*blurness; - - blur=1-blur; - - //Set rotation/position - - if(thirdperson)glTranslatef(camera.targetoffset.x,camera.targetoffset.y,camera.targetoffset.z); - - if(thirdperson!=2&&(person[0].skeleton.free!=1||thirdperson!=0)){ - - glRotatef(camera.visrotation2+-bluramount/2+(float)blur*bluramount,1,0,0); - - glRotatef(camera.visrotation+-bluramount/2+(float)blur*bluramount,0,1,0); - - } - - if(thirdperson==0&&person[0].skeleton.free==1){ - glRotatef(person[0].skeleton.joints[head].rotate3,0,1,0); - glRotatef(180-(person[0].skeleton.joints[head].rotate2+90),0,0,1); - glRotatef(person[0].skeleton.joints[head].rotate1+90,0,1,0); - } - - if(thirdperson==2){ - - glRotatef(oldrot2+-bluramount/2+(float)blur*bluramount,1,0,0); - - glRotatef(oldrot+-bluramount/2+(float)blur*bluramount,0,1,0); - + // Set rotation/position + if (thirdperson) + glTranslatef(camera.targetoffset.x, + camera.targetoffset.y, camera.targetoffset.z); + if (thirdperson == 2) { + glRotatef(oldrot2, 1, 0, 0); + glRotatef(oldrot, 0, 1, 0); + } else if (thirdperson == 0 && person[0].skeleton.free) { + glRotatef(person[0].skeleton.joints[head].rotate3, + 0, 1, 0); + glRotatef(90 - person[0].skeleton.joints[head].rotate2, + 0, 0, 1); + glRotatef(person[0].skeleton.joints[head].rotate1 + 90, + 0, 1, 0); + } else { + glRotatef(camera.visrotation2, 1, 0, 0); + glRotatef(camera.visrotation, 0, 1, 0); } - //Shake camera if grenade explosion - - if(camerashake>0){ - - if(!(person[0].aiming<1||person[0].whichgun==grenade||thirdperson)){ - - camerashake=0; - - } - - glTranslatef((float)(Random()%100)/100*camerashake,(float)(Random()%100)/100*camerashake,(float)(Random()%100)/100*camerashake); - + // Shake camera if grenade explosion + if (camerashake > 0) { + if (person[0].aiming && person[0].whichgun != grenade + && thirdperson == 0) + camerashake = 0; + glTranslatef(Random() % 100 / 100.0f * camerashake, + Random() % 100 / 100.0f * camerashake, + Random() % 100 / 100.0f * camerashake); } - camera.Apply(); glPushMatrix(); - glClipPlane(GL_CLIP_PLANE0, eqn); - glDisable(GL_CLIP_PLANE0); - glPopMatrix(); frustum.GetFrustum(); |