mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 15:20:27 +00:00
sol:: solmul
This commit is contained in:
parent
2c3341bf67
commit
816320da94
@ -283,10 +283,10 @@ void handlePanning(int sym, int uni) {
|
|||||||
|
|
||||||
#if !ISPANDORA
|
#if !ISPANDORA
|
||||||
if(sym == SDLK_END && DIM == 3) {
|
if(sym == SDLK_END && DIM == 3) {
|
||||||
View = cpush(2, -0.2*shiftmul) * View, didsomething = true, playermoved = false;
|
View = solmul(cpush(2, -0.2*shiftmul), View), didsomething = true, playermoved = false;
|
||||||
}
|
}
|
||||||
if(sym == SDLK_HOME && DIM == 3) {
|
if(sym == SDLK_HOME && DIM == 3) {
|
||||||
View = cpush(2, 0.2*shiftmul) * View, didsomething = true, playermoved = false;
|
View = solmul(cpush(2, +0.2*shiftmul), View), didsomething = true, playermoved = false;
|
||||||
}
|
}
|
||||||
if(sym == SDLK_RIGHT) {
|
if(sym == SDLK_RIGHT) {
|
||||||
if(conformal::on)
|
if(conformal::on)
|
||||||
|
@ -791,4 +791,9 @@ bool asign(ld y1, ld y2) { return signum(y1) != signum(y2); }
|
|||||||
|
|
||||||
ld xcross(ld x1, ld y1, ld x2, ld y2) { return x1 + (x2 - x1) * y1 / (y1 - y2); }
|
ld xcross(ld x1, ld y1, ld x2, ld y2) { return x1 + (x2 - x1) * y1 / (y1 - y2); }
|
||||||
|
|
||||||
|
transmatrix solmul(transmatrix T, transmatrix V) {
|
||||||
|
if(sol) return V * eupush(inverse(V) * T * V * C0);
|
||||||
|
else return T * V;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1285,10 +1285,10 @@ void centerpc(ld aspd) {
|
|||||||
aspd *= (1+R+(shmup::on?1:0));
|
aspd *= (1+R+(shmup::on?1:0));
|
||||||
|
|
||||||
if(R < aspd) {
|
if(R < aspd) {
|
||||||
View = gpushxto0(H) * View;
|
View = solmul(gpushxto0(H), View);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
View = rspintox(H) * xpush(-aspd) * spintox(H) * View;
|
View = solmul(rspintox(H) * xpush(-aspd) * spintox(H), View);
|
||||||
|
|
||||||
fixmatrix(View);
|
fixmatrix(View);
|
||||||
spinEdge(aspd);
|
spinEdge(aspd);
|
||||||
|
@ -598,11 +598,12 @@ void apply() {
|
|||||||
fullcenter(); View = spin(rand() % 1000) * View;
|
fullcenter(); View = spin(rand() % 1000) * View;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
View = cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) *
|
View = solmul(cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) *
|
||||||
cspin(0, DIM-1, -movement_angle * degree) * View;
|
cspin(0, DIM-1, -movement_angle * degree), View);
|
||||||
moved();
|
moved();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case maRotation:
|
case maRotation:
|
||||||
if(DIM == 3) {
|
if(DIM == 3) {
|
||||||
View = spin(-movement_angle * degree) * View;
|
View = spin(-movement_angle * degree) * View;
|
||||||
@ -616,8 +617,8 @@ void apply() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case maTranslationRotation:
|
case maTranslationRotation:
|
||||||
View = cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) *
|
View = solmul(cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) *
|
||||||
cspin(0, DIM-1, -movement_angle * degree) * View;
|
cspin(0, DIM-1, -movement_angle * degree), View);
|
||||||
moved();
|
moved();
|
||||||
View = spin(2 * M_PI * t / period) * View;
|
View = spin(2 * M_PI * t / period) * View;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user