mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	embeddings:: fixed monster movement animations in euc_in_hyp
This commit is contained in:
		| @@ -234,6 +234,8 @@ EX } | ||||
|     virtual transmatrix get_lti() { return logical_scaled_to_intermediate; } | ||||
|     virtual hyperpoint base_to_logical(hyperpoint h) = 0; | ||||
|     virtual hyperpoint logical_to_base(hyperpoint h) = 0; | ||||
|     virtual ld anim_center_z() { return center_z(); } | ||||
|     virtual hyperpoint anim_tile_center(); | ||||
|      | ||||
|     virtual bool is_euc_in_product() { return false; } | ||||
|     virtual bool is_product_embedding() { return false; } | ||||
| @@ -276,6 +278,12 @@ hyperpoint embedding_method::tile_center() { | ||||
|   return lzpush(z) * C0; | ||||
|   } | ||||
|  | ||||
| hyperpoint embedding_method::anim_tile_center() { | ||||
|   ld z = anim_center_z(); | ||||
|   if(z == 0) return C0; | ||||
|   return lzpush(z) * C0; | ||||
|   } | ||||
|  | ||||
| transmatrix embedding_method::map_relative_push(hyperpoint a) { | ||||
|   auto i = actual_to_intermediate(a); | ||||
|   return intermediate_to_actual_translation(i);   | ||||
| @@ -522,6 +530,7 @@ struct emb_euc_in_hyp : emb_actual { | ||||
|     } | ||||
|   hyperpoint actual_to_base(hyperpoint h) override { return deparabolic13(h); } | ||||
|   transmatrix actual_to_base(const transmatrix& T) override { hyperpoint h = deparabolic13(T * C0); return eupush(h[0], h[1]); } | ||||
|   ld anim_center_z() override { return vid.depth; } | ||||
|   }; | ||||
|  | ||||
| /** sphere into a isotropic space of higher curvature */ | ||||
|   | ||||
							
								
								
									
										12
									
								
								graph.cpp
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								graph.cpp
									
									
									
									
									
								
							| @@ -2608,7 +2608,7 @@ EX bool applyAnimation(cell *c, shiftmatrix& V, double& footphase, int layer) { | ||||
|   ld aspd = td / 1000.0 * exp(vid.mspeed); | ||||
|   ld R; | ||||
|   again: | ||||
|   auto TC0 = tile_center(); | ||||
|   auto TC0 = cgi.emb->anim_tile_center(); | ||||
|  | ||||
|   if(among(a.attacking, 1, 3)) | ||||
|     R = hdist(a.attackat * TC0, a.wherenow * TC0); | ||||
| @@ -2625,7 +2625,7 @@ EX bool applyAnimation(cell *c, shiftmatrix& V, double& footphase, int layer) { | ||||
|     } | ||||
|   else { | ||||
|     transmatrix T = inverse(a.wherenow); | ||||
|     ld z = cgi.emb->center_z(); | ||||
|     ld z = cgi.emb->anim_center_z(); | ||||
|     if(z) T = lzpush(-z) * T; | ||||
|  | ||||
|     hyperpoint wnow; | ||||
| @@ -2635,7 +2635,7 @@ EX bool applyAnimation(cell *c, shiftmatrix& V, double& footphase, int layer) { | ||||
|       wnow = T * TC0; | ||||
|      | ||||
|     shift_v_towards(T, shiftless(wnow), aspd, shift_method(smaAnimation)); | ||||
|     if(z) T = lzpush(1) * T; | ||||
|     if(z) T = lzpush(z) * T; | ||||
|     a.wherenow = inverse(T); | ||||
|     fixmatrix(a.wherenow); | ||||
|  | ||||
| @@ -2666,10 +2666,10 @@ EX bool applyAnimation(cell *c, shiftmatrix& V, double& footphase, int layer) { | ||||
| double chainAngle(cell *c, shiftmatrix& V, cell *c2, double dft, const shiftmatrix &Vwhere) { | ||||
|   if(cgi.emb->no_spin()) return 0; | ||||
|   if(!gmatrix0.count(c2)) return dft; | ||||
|   hyperpoint h = tile_center(); | ||||
|   hyperpoint h = cgi.emb->anim_tile_center(); | ||||
|   if(animations[LAYER_BIG].count(c2)) h = animations[LAYER_BIG][c2].wherenow * h; | ||||
|   h = inverse_shift(V, Vwhere) * calc_relative_matrix(c2, c, C0) * h; | ||||
|   ld z = cgi.emb->center_z(); | ||||
|   ld z = cgi.emb->anim_center_z(); | ||||
|   if(z) h = lzpush(-z) * h; | ||||
|   return atan2(h[1], h[0]); | ||||
|   } | ||||
| @@ -2677,7 +2677,7 @@ double chainAngle(cell *c, shiftmatrix& V, cell *c2, double dft, const shiftmatr | ||||
| // equivalent to V = V * spin(-chainAngle(c,V,c2,dft)); | ||||
| bool chainAnimation(cell *c, cell *c2, shiftmatrix& V, const shiftmatrix &Vwhere, ld& length) { | ||||
|   if(cgi.emb->no_spin()) return false; | ||||
|   hyperpoint h = tile_center(); | ||||
|   hyperpoint h = cgi.emb->anim_tile_center(); | ||||
|   if(animations[LAYER_BIG].count(c2)) h = animations[LAYER_BIG][c2].wherenow * h; | ||||
|   h = inverse_shift(V, Vwhere) * h; | ||||
|   length = hdist(h, tile_center()); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue