mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 15:00:26 +00:00
solv:: fixmatrix
This commit is contained in:
parent
3b7d80bb17
commit
bbabd47ad0
@ -513,7 +513,7 @@ transmatrix rgpushxto0(const hyperpoint& H) {
|
|||||||
// (without using this, imprecision could accumulate)
|
// (without using this, imprecision could accumulate)
|
||||||
|
|
||||||
void fixmatrix(transmatrix& T) {
|
void fixmatrix(transmatrix& T) {
|
||||||
if(sol) ;
|
if(sol) ; // fixed inside solmul
|
||||||
else if(euclid) {
|
else if(euclid) {
|
||||||
for(int x=0; x<GDIM; x++) for(int y=0; y<=x; y++) {
|
for(int x=0; x<GDIM; x++) for(int y=0; y<=x; y++) {
|
||||||
ld dp = 0;
|
ld dp = 0;
|
||||||
|
10
sol.cpp
10
sol.cpp
@ -315,6 +315,16 @@ namespace solv {
|
|||||||
transmatrix push_back = eupush( tC0(inverse(V)) );
|
transmatrix push_back = eupush( tC0(inverse(V)) );
|
||||||
transmatrix space_to_view = V * push_back;
|
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);
|
transmatrix view_to_space = inverse(space_to_view);
|
||||||
using namespace hyperpoint_vec;
|
using namespace hyperpoint_vec;
|
||||||
hyperpoint shift = /* inverse(V) * T * V * C0; */ view_to_space * T * C0;
|
hyperpoint shift = /* inverse(V) * T * V * C0; */ view_to_space * T * C0;
|
||||||
|
@ -72,6 +72,8 @@ void welcomeMessage() {
|
|||||||
addMessage(XLAT("Good luck in the elliptic plane!"));
|
addMessage(XLAT("Good luck in the elliptic plane!"));
|
||||||
else if(sphere)
|
else if(sphere)
|
||||||
addMessage(XLAT("Welcome to Spherogue!"));
|
addMessage(XLAT("Welcome to Spherogue!"));
|
||||||
|
else if(sol)
|
||||||
|
addMessage(XLAT("Welcome to SolvRogue!"));
|
||||||
else if(PURE && geometry == gNormal && !cheater)
|
else if(PURE && geometry == gNormal && !cheater)
|
||||||
addMessage(XLAT("Welcome to the Heptagonal Mode!"));
|
addMessage(XLAT("Welcome to the Heptagonal Mode!"));
|
||||||
else if(cheater || autocheat)
|
else if(cheater || autocheat)
|
||||||
|
Loading…
Reference in New Issue
Block a user