mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	fixed build_shortest_path in arcm/Penrose euclidean
This commit is contained in:
		
							
								
								
									
										15
									
								
								cell.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								cell.cpp
									
									
									
									
									
								
							| @@ -1014,16 +1014,19 @@ vector<cell*> build_shortest_path(cell *c1, cell *c2) { | |||||||
|   if(euclid) { |   if(euclid) { | ||||||
|     using namespace hyperpoint_vec; |     using namespace hyperpoint_vec; | ||||||
|     p.push_back(c1); |     p.push_back(c1); | ||||||
|     hyperpoint h = tC0(calc_relative_matrix(c2, c1, C0)) - C0; |     hyperpoint h = tC0(calc_relative_matrix(c2, c1, C0)); | ||||||
|     cell *x = c1; |     cell *x = c1; | ||||||
|     hyperpoint h1 = C0;  |     transmatrix T1 = rspintox(h); | ||||||
|     int d = celldistance(c1, c2); |     int d = celldistance(c1, c2); | ||||||
|     for(int i=0; i<=d * 10; i++) { |     int steps = d * 10; | ||||||
|       h1 += h / d / 10.; |     ld step = hdist0(h) / steps; | ||||||
|       virtualRebase(x, h1,  true); |     for(int i=0; i< steps; i++) { | ||||||
|  |       T1 = T1 * xpush(step); | ||||||
|  |       virtualRebase(x, T1,  true); | ||||||
|  |       println(hlog, "x = ", x, "p length = ", isize(p), " dist = ", hdist0(tC0(T1)), " dist from end = ", hdist(tC0(T1), tC0(calc_relative_matrix(c2, x, C0)))); | ||||||
|       while(x != p.back()) { |       while(x != p.back()) { | ||||||
|         forCellCM(c, p.back())  |         forCellCM(c, p.back())  | ||||||
|           if(celldistance(c, x) < celldistance(p.back(), x)) { |           if(celldistance(x, c) < celldistance(x, p.back())) { | ||||||
|             p.push_back(c); |             p.push_back(c); | ||||||
|             break; |             break; | ||||||
|             } |             } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue