mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 05:23:00 +00:00 
			
		
		
		
	3D:: mscale performs zpush when in 3D
This commit is contained in:
		| @@ -250,9 +250,11 @@ namespace geom3 { | |||||||
|     } |     } | ||||||
|    |    | ||||||
|   ld lev_to_factor(ld lev) {  |   ld lev_to_factor(ld lev) {  | ||||||
|  |     if(DIM == 3) return lev; | ||||||
|     return projection_to_factor(lev_to_projection(lev));  |     return projection_to_factor(lev_to_projection(lev));  | ||||||
|     } |     } | ||||||
|   ld factor_to_lev(ld fac) {  |   ld factor_to_lev(ld fac) {  | ||||||
|  |     if(DIM == 3) return fac; | ||||||
|     return depth - projection_to_abslev(factor_to_projection(fac));  |     return depth - projection_to_abslev(factor_to_projection(fac));  | ||||||
|     } |     } | ||||||
|    |    | ||||||
| @@ -326,6 +328,7 @@ namespace geom3 { | |||||||
|     else { |     else { | ||||||
|       INFDEEP = (euclid || sphere) ? 0.01 : lev_to_projection(0) * tanh(camera); |       INFDEEP = (euclid || sphere) ? 0.01 : lev_to_projection(0) * tanh(camera); | ||||||
|       ld wh = actual_wall_height(); |       ld wh = actual_wall_height(); | ||||||
|  |       if(DIM == 3) wh = 0.5; | ||||||
|       WALL = lev_to_factor(wh); |       WALL = lev_to_factor(wh); | ||||||
|        |        | ||||||
|       human_height = human_wall_ratio * wh; |       human_height = human_wall_ratio * wh; | ||||||
|   | |||||||
| @@ -603,6 +603,7 @@ double hdist(const hyperpoint& h1, const hyperpoint& h2) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| hyperpoint mscale(const hyperpoint& t, double fac) { | hyperpoint mscale(const hyperpoint& t, double fac) { | ||||||
|  |   if(DIM == 3) return cpush(2, fac) * t; | ||||||
|   hyperpoint res; |   hyperpoint res; | ||||||
|   for(int i=0; i<MDIM; i++)  |   for(int i=0; i<MDIM; i++)  | ||||||
|     res[i] = t[i] * fac; |     res[i] = t[i] * fac; | ||||||
| @@ -610,6 +611,7 @@ hyperpoint mscale(const hyperpoint& t, double fac) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| transmatrix mscale(const transmatrix& t, double fac) { | transmatrix mscale(const transmatrix& t, double fac) { | ||||||
|  |   if(DIM == 3) return t * cpush(2, fac); | ||||||
|   transmatrix res; |   transmatrix res; | ||||||
|   for(int i=0; i<MDIM; i++) for(int j=0; j<MDIM; j++) |   for(int i=0; i<MDIM; i++) for(int j=0; j<MDIM; j++) | ||||||
|     res[i][j] = t[i][j] * fac; |     res[i][j] = t[i][j] * fac; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ?
					?