mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-23 06:20:09 +00:00
redone spinEdge so that fixed_yz works in gravity lands
This commit is contained in:
parent
6713726975
commit
d2c20fee22
15
graph.cpp
15
graph.cpp
@ -2644,8 +2644,9 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
double downspin;
|
|
||||||
cell *straightDownSeek;
|
cell *straightDownSeek;
|
||||||
|
hyperpoint straightDownPoint;
|
||||||
|
ld straightDownSpeed;
|
||||||
|
|
||||||
#define AURA 180
|
#define AURA 180
|
||||||
|
|
||||||
@ -5958,12 +5959,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
|
|
||||||
if(usethis) {
|
if(usethis) {
|
||||||
straightDownSeek = c;
|
straightDownSeek = c;
|
||||||
downspin = atan2(V[1][GDIM], V[0][GDIM]);
|
straightDownPoint = tC0(V);
|
||||||
downspin += (side-1) * M_PI/2;
|
straightDownSpeed = spd;
|
||||||
downspin += conformal::rotation * degree;
|
if(side == 2) for(int i=0; i<3; i++) straightDownPoint[i] = -straightDownPoint[i];
|
||||||
while(downspin < -M_PI) downspin += 2*M_PI;
|
if(side == 1) straightDownPoint = spin(-M_PI/2) * straightDownPoint;
|
||||||
while(downspin > +M_PI) downspin -= 2*M_PI;
|
|
||||||
downspin = downspin * min(spd, (double)1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6529,7 +6528,7 @@ void drawthemap() {
|
|||||||
multi::ccdist[i] = 1e20; multi::ccat[i] = NULL;
|
multi::ccdist[i] = 1e20; multi::ccat[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
straightDownSeek = NULL; downspin = 0;
|
straightDownSeek = NULL;
|
||||||
|
|
||||||
#if ISMOBILE
|
#if ISMOBILE
|
||||||
mouseovers = XLAT("No info about this...");
|
mouseovers = XLAT("No info about this...");
|
||||||
|
4
hyper.h
4
hyper.h
@ -2678,7 +2678,9 @@ void preparesort();
|
|||||||
|
|
||||||
bool dodrawcell(cell *c);
|
bool dodrawcell(cell *c);
|
||||||
void drawcell(cell *c, transmatrix V, int spinv, bool mirrored);
|
void drawcell(cell *c, transmatrix V, int spinv, bool mirrored);
|
||||||
extern double downspin;
|
extern cell* straightDownSeek;
|
||||||
|
extern hyperpoint straightDownPoint;
|
||||||
|
extern ld straightDownSpeed;
|
||||||
|
|
||||||
extern int frameid;
|
extern int frameid;
|
||||||
extern bool leftclick;
|
extern bool leftclick;
|
||||||
|
26
hypgraph.cpp
26
hypgraph.cpp
@ -1063,7 +1063,7 @@ transmatrix eumovedir(int d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void spinEdge(ld aspd) {
|
void spinEdge(ld aspd) {
|
||||||
|
ld downspin = 0;
|
||||||
if(playerfound && vid.fixed_facing) {
|
if(playerfound && vid.fixed_facing) {
|
||||||
hyperpoint H = gpushxto0(playerV * C0) * playerV * xpush0(5);
|
hyperpoint H = gpushxto0(playerV * C0) * playerV * xpush0(5);
|
||||||
downspin = atan2(H[1], H[0]);
|
downspin = atan2(H[1], H[0]);
|
||||||
@ -1073,14 +1073,28 @@ void spinEdge(ld aspd) {
|
|||||||
while(downspin > +M_PI) downspin -= 2*M_PI;
|
while(downspin > +M_PI) downspin -= 2*M_PI;
|
||||||
aspd = (1 + 2 * abs(downspin)) * aspd;
|
aspd = (1 + 2 * abs(downspin)) * aspd;
|
||||||
}
|
}
|
||||||
|
else if(WDIM == 2 && GDIM == 3 && vid.fixed_yz) {
|
||||||
|
aspd = 999999;
|
||||||
|
if(straightDownSeek) {
|
||||||
|
if(straightDownPoint[0])
|
||||||
|
downspin = conformal::rotation * degree - atan2(straightDownPoint[0], straightDownPoint[1]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(View[0][2])
|
||||||
|
downspin = -atan2(View[0][2], View[1][2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(straightDownSeek) {
|
||||||
|
downspin = atan2(straightDownPoint[1], straightDownPoint[0]);
|
||||||
|
downspin -= M_PI/2;
|
||||||
|
downspin += conformal::rotation * degree;
|
||||||
|
while(downspin < -M_PI) downspin += 2*M_PI;
|
||||||
|
while(downspin > +M_PI) downspin -= 2*M_PI;
|
||||||
|
downspin = downspin * min(straightDownSpeed, (double)1);
|
||||||
|
}
|
||||||
if(downspin > aspd) downspin = aspd;
|
if(downspin > aspd) downspin = aspd;
|
||||||
if(downspin < -aspd) downspin = -aspd;
|
if(downspin < -aspd) downspin = -aspd;
|
||||||
View = spin(downspin) * View;
|
View = spin(downspin) * View;
|
||||||
|
|
||||||
if(WDIM == 2 && GDIM == 3 && vid.fixed_yz && View[0][2]) {
|
|
||||||
ld d12 = atan2(View[0][2], View[1][2]);
|
|
||||||
View = cspin(1, 0, d12) * View;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void centerpc(ld aspd) {
|
void centerpc(ld aspd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user