sol:: solmul

This commit is contained in:
Zeno Rogue 2019-07-25 12:14:18 +02:00
parent 2c3341bf67
commit 816320da94
4 changed files with 14 additions and 8 deletions

View File

@ -283,10 +283,10 @@ void handlePanning(int sym, int uni) {
#if !ISPANDORA
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) {
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(conformal::on)

View File

@ -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); }
transmatrix solmul(transmatrix T, transmatrix V) {
if(sol) return V * eupush(inverse(V) * T * V * C0);
else return T * V;
}
}

View File

@ -1285,10 +1285,10 @@ void centerpc(ld aspd) {
aspd *= (1+R+(shmup::on?1:0));
if(R < aspd) {
View = gpushxto0(H) * View;
View = solmul(gpushxto0(H), View);
}
else
View = rspintox(H) * xpush(-aspd) * spintox(H) * View;
View = solmul(rspintox(H) * xpush(-aspd) * spintox(H), View);
fixmatrix(View);
spinEdge(aspd);

View File

@ -598,11 +598,12 @@ void apply() {
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) *
cspin(0, DIM-1, -movement_angle * degree) * View;
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);
moved();
}
break;
case maRotation:
if(DIM == 3) {
View = spin(-movement_angle * degree) * View;
@ -616,8 +617,8 @@ void apply() {
break;
case maTranslationRotation:
View = 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;
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);
moved();
View = spin(2 * M_PI * t / period) * View;
break;