1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-18 03:58:04 +00:00

further work on textures

This commit is contained in:
Zeno Rogue
2017-12-14 02:53:29 +01:00
parent 45cc122927
commit 6c4538df69
6 changed files with 473 additions and 201 deletions

View File

@@ -150,13 +150,6 @@ const transmatrix MirrorX = {{{-1,0,0}, {0,1,0}, {0,0,1}}};
// rotate by PI
const transmatrix pispin = {{{-1,0,0}, {0,-1,0}, {0,0,1}}};
// T * C0, optimized
inline hyperpoint tC0(const transmatrix &T) {
hyperpoint z;
z[0] = T[0][2]; z[1] = T[1][2]; z[2] = T[2][2];
return z;
}
// rotate by alpha degrees
transmatrix spin(ld alpha) {
transmatrix T = Id;
@@ -173,6 +166,29 @@ transmatrix eupush(ld x, ld y) {
return T;
}
transmatrix eupush(hyperpoint h) {
transmatrix T = Id;
T[0][2] = h[0];
T[1][2] = h[1];
return T;
}
transmatrix euscalezoom(hyperpoint h) {
transmatrix T = Id;
T[0][0] = h[0];
T[0][1] = -h[1];
T[1][0] = h[1];
T[1][1] = h[0];
return T;
}
transmatrix euaffine(hyperpoint h) {
transmatrix T = Id;
T[1][0] = h[0];
T[1][2] = h[1];
return T;
}
// push alpha units to the right
transmatrix xpush(ld alpha) {
if(euclid) return eupush(alpha, 0);