1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 15:00:26 +00:00

solv:: fixmatrix

This commit is contained in:
Zeno Rogue 2019-07-30 13:02:24 +02:00
parent 3b7d80bb17
commit bbabd47ad0
3 changed files with 13 additions and 1 deletions

View File

@ -513,7 +513,7 @@ transmatrix rgpushxto0(const hyperpoint& H) {
// (without using this, imprecision could accumulate)
void fixmatrix(transmatrix& T) {
if(sol) ;
if(sol) ; // fixed inside solmul
else if(euclid) {
for(int x=0; x<GDIM; x++) for(int y=0; y<=x; y++) {
ld dp = 0;

10
sol.cpp
View File

@ -315,6 +315,16 @@ namespace solv {
transmatrix push_back = eupush( tC0(inverse(V)) );
transmatrix space_to_view = V * push_back;
for(int x=0; x<3; x++) for(int y=0; y<=x; y++) {
auto& T = space_to_view;
ld dp = 0;
for(int z=0; z<3; z++) dp += T[z][x] * T[z][y];
if(y == x) dp = 1 - sqrt(1/dp);
for(int z=0; z<3; z++) T[z][x] -= dp * T[z][y];
}
transmatrix view_to_space = inverse(space_to_view);
using namespace hyperpoint_vec;
hyperpoint shift = /* inverse(V) * T * V * C0; */ view_to_space * T * C0;

View File

@ -72,6 +72,8 @@ void welcomeMessage() {
addMessage(XLAT("Good luck in the elliptic plane!"));
else if(sphere)
addMessage(XLAT("Welcome to Spherogue!"));
else if(sol)
addMessage(XLAT("Welcome to SolvRogue!"));
else if(PURE && geometry == gNormal && !cheater)
addMessage(XLAT("Welcome to the Heptagonal Mode!"));
else if(cheater || autocheat)