1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 22:39:53 +00:00

flock following works better with animations

This commit is contained in:
Zeno Rogue 2018-11-20 00:21:48 +01:00
parent 5e0bd401fc
commit 99fc9085ee

View File

@ -192,20 +192,23 @@ namespace flocking {
if(!on) return false; if(!on) return false;
if(kind == kFlocking) simulate(delta), timetowait = 0; if(kind == kFlocking) simulate(delta), timetowait = 0;
if(follow == 1) { if(follow) {
// follow bird0
View = spin(90 * degree) * inverse(vdata[0].m->pat) * View; if(follow == 1)
optimizeview(); View = spin(90 * degree) * inverse(vdata[0].m->pat) * View;
playermoved = false;
} if(follow == 2) {
using namespace hyperpoint_vec;
hyperpoint h = Hypc;
for(int i=0; i<N; i++) h += tC0(vdata[i].m->pat);
h = normalize(h);
View = gpushxto0(h) * View;
}
if(follow == 2) {
using namespace hyperpoint_vec;
hyperpoint h = Hypc;
for(int i=0; i<N; i++) h += tC0(vdata[i].m->pat);
h = normalize(h);
View = gpushxto0(h) * View;
optimizeview(); optimizeview();
centerover.at = viewctr.at->c7;
compute_graphical_distance();
gmatrix.clear();
playermoved = false; playermoved = false;
} }