mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-24 02:17:40 +00:00
embeddings:: 3d-models:: fixed animate_bird
This commit is contained in:
@@ -632,11 +632,15 @@ void geometry_information::animate_bird(hpcshape& orig, hpcshape_animated& anima
|
|||||||
clone_shape(orig, tgt);
|
clone_shape(orig, tgt);
|
||||||
ld alpha = cos(M_PI * i / WINGS) * 30 * degree;
|
ld alpha = cos(M_PI * i / WINGS) * 30 * degree;
|
||||||
for(int i=tgt.s; i<tgt.e; i++) {
|
for(int i=tgt.s; i<tgt.e; i++) {
|
||||||
if(abs(hpc[i][1]) > body) {
|
hyperpoint h = hpc[i];
|
||||||
ld off = hpc[i][1] > 0 ? body : -body;
|
h = cgi.emb->actual_to_logical(hpc[i]);
|
||||||
hpc[i][2] += abs(hpc[i][1] - off) * sin(alpha);
|
if(abs(h[1]) > body) {
|
||||||
hpc[i][1] = off + (hpc[i][1] - off) * cos(alpha);
|
ld off = h[1] > 0 ? body : -body;
|
||||||
hpc[i] = normalize(hpc[i]);
|
h[2] += abs(h[1] - off) * sin(alpha);
|
||||||
|
h[1] = off + (h[1] - off) * cos(alpha);
|
||||||
|
h = cgi.emb->logical_to_actual(h);
|
||||||
|
h = normalize(h);
|
||||||
|
hpc[i] = h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user