mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-02 05:20:32 +00:00
additional convenience functions for Euclidean translations and scaling
This commit is contained in:
parent
926ca2808a
commit
7e1df6d9a3
@ -569,6 +569,29 @@ EX transmatrix eupush(ld x, ld y) {
|
|||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX transmatrix euclidean_translate(ld x, ld y, ld z) {
|
||||||
|
transmatrix T = Id;
|
||||||
|
T[0][LDIM] = x;
|
||||||
|
T[1][LDIM] = y;
|
||||||
|
T[2][LDIM] = z;
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
|
EX transmatrix euscale(ld x, ld y) {
|
||||||
|
transmatrix T = Id;
|
||||||
|
T[0][0] = x;
|
||||||
|
T[1][1] = y;
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
|
EX transmatrix euscale3(ld x, ld y, ld z) {
|
||||||
|
transmatrix T = Id;
|
||||||
|
T[0][0] = x;
|
||||||
|
T[1][1] = y;
|
||||||
|
T[2][2] = z;
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
EX transmatrix eupush(hyperpoint h, ld co IS(1)) {
|
EX transmatrix eupush(hyperpoint h, ld co IS(1)) {
|
||||||
if(nonisotropic) return nisot::translate(h, co);
|
if(nonisotropic) return nisot::translate(h, co);
|
||||||
transmatrix T = Id;
|
transmatrix T = Id;
|
||||||
|
Loading…
Reference in New Issue
Block a user