mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-27 17:34:53 +00:00
better isometry in Nil cylinder
This commit is contained in:
parent
0b11c9388b
commit
a84596a355
@ -676,6 +676,15 @@ struct emb_euc_cylinder_nil : emb_euc_cylinder {
|
|||||||
transmatrix intermediate_to_actual_translation(hyperpoint i) override {
|
transmatrix intermediate_to_actual_translation(hyperpoint i) override {
|
||||||
return zpush(i[2]) * cspin(1, 0, i[1]) * xpush(i[0]);
|
return zpush(i[2]) * cspin(1, 0, i[1]) * xpush(i[0]);
|
||||||
}
|
}
|
||||||
|
transmatrix get_lti() override {
|
||||||
|
ld depth = 0; // for now?
|
||||||
|
ld alpha = (1 + depth) / 2.;
|
||||||
|
ld c = pow(1 + alpha * alpha, -0.5);
|
||||||
|
transmatrix U = Id;
|
||||||
|
U[1][1] = (alpha*alpha+1) * c;
|
||||||
|
U[0][1] = alpha * c;
|
||||||
|
return logical_scaled_to_intermediate * U * intermediate_to_logical_scaled * emb_euc_cylinder::get_lti();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct emb_euc_cylinder_horo : emb_euc_cylinder {
|
struct emb_euc_cylinder_horo : emb_euc_cylinder {
|
||||||
@ -711,7 +720,7 @@ struct emb_euc_cylinder_sl2 : emb_euc_cylinder {
|
|||||||
return cspin(2, 3, i[2]) * cspin(0, 1, i[2] + i[1]) * xpush(i[0]);
|
return cspin(2, 3, i[2]) * cspin(0, 1, i[2] + i[1]) * xpush(i[0]);
|
||||||
}
|
}
|
||||||
transmatrix get_lsti() override {
|
transmatrix get_lsti() override {
|
||||||
return cspin90(0, 2);
|
return cspin90(0, 2) * cspin90(0, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -793,9 +802,9 @@ void embedding_method::prepare_lta() {
|
|||||||
if(b) geom3::light_flip(false);
|
if(b) geom3::light_flip(false);
|
||||||
|
|
||||||
logical_scaled_to_intermediate = get_lsti();
|
logical_scaled_to_intermediate = get_lsti();
|
||||||
|
intermediate_to_logical_scaled = inverse(logical_scaled_to_intermediate);
|
||||||
logical_to_intermediate = get_lti();
|
logical_to_intermediate = get_lti();
|
||||||
intermediate_to_logical = inverse(logical_to_intermediate);
|
intermediate_to_logical = inverse(logical_to_intermediate);
|
||||||
intermediate_to_logical_scaled = inverse(logical_scaled_to_intermediate);
|
|
||||||
if(b) geom3::light_flip(true);
|
if(b) geom3::light_flip(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user