vrheights

changeset 10:3e6757655fe2

fixed climbing stairs
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 03 Oct 2014 21:27:58 +0300
parents df3a70664a7d
children 537db3079134
files src/game.cc
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/src/game.cc	Fri Oct 03 20:36:24 2014 +0300
     1.2 +++ b/src/game.cc	Fri Oct 03 21:27:58 2014 +0300
     1.3 @@ -138,9 +138,13 @@
     1.4  	if(floor_pos.y < cam_pos.y) {
     1.5  		cam_vvel += grav * dt;
     1.6  		cam_pos.y += cam_vvel * dt;
     1.7 -		if(cam_pos.y < floor_pos.y) {
     1.8 +		if(cam_pos.y <= floor_pos.y) {
     1.9  			cam_pos.y = floor_pos.y;
    1.10 +			cam_vvel = 0;
    1.11  		}
    1.12 +	} else {
    1.13 +		cam_pos.y = floor_pos.y;
    1.14 +		cam_vvel = 0;
    1.15  	}
    1.16  }
    1.17  
    1.18 @@ -313,7 +317,7 @@
    1.19  		scn.obj[i]->draw();
    1.20  	}
    1.21  
    1.22 -	glPushAttrib(GL_ENABLE_BIT);
    1.23 +	/*glPushAttrib(GL_ENABLE_BIT);
    1.24  	glDisable(GL_DEPTH_TEST);
    1.25  	glDisable(GL_LIGHTING);
    1.26  
    1.27 @@ -325,7 +329,7 @@
    1.28  	glColor3f(1, 1, 1);
    1.29  	glEnd();
    1.30  
    1.31 -	glPopAttrib();
    1.32 +	glPopAttrib();*/
    1.33  }
    1.34  
    1.35  static void material(float r, float g, float b, float roughness)