mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-09 12:52:49 +00:00
3d:: make monster facing correct, based on FACEUP/FACESIDE
This commit is contained in:
parent
b07a5a5c69
commit
10a82c544b
21
graph.cpp
21
graph.cpp
@ -314,8 +314,6 @@ double hexshiftat(cell *c) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FACE3 (DIM == 3 ? M_PI/2 : 0)
|
|
||||||
|
|
||||||
transmatrix ddspin(cell *c, int d, ld bonus) {
|
transmatrix ddspin(cell *c, int d, ld bonus) {
|
||||||
if(DIM == 3 && d < c->type) return rspintox(tC0(calc_relative_matrix(c->move(d), c, C0))) * cspin(2, 0, bonus);
|
if(DIM == 3 && d < c->type) return rspintox(tC0(calc_relative_matrix(c->move(d), c, C0))) * cspin(2, 0, bonus);
|
||||||
return spin(displayspin(c, d) + bonus - hexshiftat(c));
|
return spin(displayspin(c, d) + bonus - hexshiftat(c));
|
||||||
@ -1129,16 +1127,21 @@ void drawMimic(eMonster m, cell *where, const transmatrix& V, color_t col, doubl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
|
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t col, double footphase) {
|
||||||
|
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
if(DIM == 3 && m != moPlayer)
|
if(DIM == 3 && m != moPlayer)
|
||||||
radarpoints.emplace_back(radarpoint{makeradar(V), minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF });
|
radarpoints.emplace_back(radarpoint{makeradar(V1), minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF });
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CAP_SHAPES
|
#if CAP_SHAPES
|
||||||
char xch = minf[m].glyph;
|
char xch = minf[m].glyph;
|
||||||
|
|
||||||
|
transmatrix V = V1;
|
||||||
|
if(DIM == 3 && (classflag(m) & CF_FACE_UP)) V = V1 * cspin(0, 2, M_PI/2);
|
||||||
|
|
||||||
|
// if(DIM == 3) V = V * cspin(0, 2, M_PI/2);
|
||||||
|
|
||||||
if(m == moTortoise && where && where->stuntime >= 3)
|
if(m == moTortoise && where && where->stuntime >= 3)
|
||||||
drawStunStars(V, where->stuntime-2);
|
drawStunStars(V, where->stuntime-2);
|
||||||
else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ;
|
else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ;
|
||||||
@ -2042,7 +2045,7 @@ bool applyAnimation(cell *c, transmatrix& V, double& footphase, int layer) {
|
|||||||
footphase = a.footphase;
|
footphase = a.footphase;
|
||||||
V = V * a.wherenow;
|
V = V * a.wherenow;
|
||||||
if(a.attacking == 2) V = V * pispin;
|
if(a.attacking == 2) V = V * pispin;
|
||||||
if(DIM == 3) V = V * cspin(0, 2, M_PI/2);
|
// if(DIM == 3) V = V * cspin(0, 2, M_PI/2);
|
||||||
a.ltick = ticks;
|
a.ltick = ticks;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2409,7 +2412,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) {
|
|||||||
bheat = HEAT(c->move(i));
|
bheat = HEAT(c->move(i));
|
||||||
d = i;
|
d = i;
|
||||||
}
|
}
|
||||||
Vs = Vs * ddspin(c, d, FACE3);
|
Vs = Vs * ddspin(c, d, 0);
|
||||||
}
|
}
|
||||||
return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase);
|
return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase);
|
||||||
}
|
}
|
||||||
@ -2459,7 +2462,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hyperpoint V0 = inverse(cwtV) * tC0(Vs);
|
hyperpoint V0 = inverse(cwtV) * tC0(Vs);
|
||||||
Vs = cwtV * rspintox(V0) * xpush(hdist0(V0)) * cspin(0, 2, -M_PI/2);
|
Vs = cwtV * rspintox(V0) * xpush(hdist0(V0)) * cspin(0, 2, -M_PI);
|
||||||
// cwtV * rgpushxto0(inverse(cwtV) * tC0(Vs));
|
// cwtV * rgpushxto0(inverse(cwtV) * tC0(Vs));
|
||||||
}
|
}
|
||||||
if(c->monst == moHunterChanging)
|
if(c->monst == moHunterChanging)
|
||||||
@ -4174,14 +4177,14 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
if(multi::players > 1) {
|
if(multi::players > 1) {
|
||||||
for(int i=0; i<numplayers(); i++)
|
for(int i=0; i<numplayers(); i++)
|
||||||
if(playerpos(i) == c) {
|
if(playerpos(i) == c) {
|
||||||
playerV = V * ddspin(c, multi::player[i].spin, FACE3);
|
playerV = V * ddspin(c, multi::player[i].spin, 0);
|
||||||
if(multi::player[i].mirrored) playerV = playerV * Mirror;
|
if(multi::player[i].mirrored) playerV = playerV * Mirror;
|
||||||
if(multi::player[i].mirrored == mirrored)
|
if(multi::player[i].mirrored == mirrored)
|
||||||
multi::whereis[i] = playerV;
|
multi::whereis[i] = playerV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
playerV = V * ddspin(c, cwt.spin, FACE3);
|
playerV = V * ddspin(c, cwt.spin, 0);
|
||||||
if(cwt.mirrored) playerV = playerV * Mirror;
|
if(cwt.mirrored) playerV = playerV * Mirror;
|
||||||
if(orig) cwtV = playerV;
|
if(orig) cwtV = playerV;
|
||||||
}
|
}
|
||||||
|
12
shmup.cpp
12
shmup.cpp
@ -3589,7 +3589,7 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans
|
|||||||
dynamicval<int> d(cpid, m->pid);
|
dynamicval<int> d(cpid, m->pid);
|
||||||
if(!hide_player() || !subscreens::is_current_player(m->pid)) {
|
if(!hide_player() || !subscreens::is_current_player(m->pid)) {
|
||||||
drawPlayerEffects(view, c, true);
|
drawPlayerEffects(view, c, true);
|
||||||
if(DIM == 3) view = view * spin(-M_PI/2);
|
if(DIM == 3) view = view * spin(-M_PI/2) * cspin(0, 2, -M_PI/2);
|
||||||
if(m->inBoat) m->footphase = 0;
|
if(m->inBoat) m->footphase = 0;
|
||||||
if(mapeditor::drawplayer) drawMonsterType(moPlayer, c, view, 0xFFFFFFC0, m->footphase);
|
if(mapeditor::drawplayer) drawMonsterType(moPlayer, c, view, 0xFFFFFFC0, m->footphase);
|
||||||
}
|
}
|
||||||
@ -3686,11 +3686,11 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans
|
|||||||
if(hasHitpoints(m->type))
|
if(hasHitpoints(m->type))
|
||||||
c->hitpoints = m->hitpoints;
|
c->hitpoints = m->hitpoints;
|
||||||
if(m->type == moTortoise) tortoise::emap[c] = getBits(m->torigin);
|
if(m->type == moTortoise) tortoise::emap[c] = getBits(m->torigin);
|
||||||
if(m->type == moMimic && DIM == 3)
|
/* if(m->type == moMimic && DIM == 3)
|
||||||
drawMonsterType(m->type, c, view * spin(-M_PI/2), col, m->footphase);
|
drawMonsterType(m->type, c, view * spin(-M_PI/2), col, m->footphase); */
|
||||||
else if(DIM == 3)
|
/* else if(DIM == 3)
|
||||||
drawMonsterType(m->type, c, view * cspin(0, 2, M_PI/2), col, m->footphase);
|
drawMonsterType(m->type, c, view * cspin(0, 2, M_PI/2), col, m->footphase); */
|
||||||
else
|
/* else */
|
||||||
drawMonsterType(m->type, c, view, col, m->footphase);
|
drawMonsterType(m->type, c, view, col, m->footphase);
|
||||||
if(m->type == moTortoise) tortoise::emap.erase(c);
|
if(m->type == moTortoise) tortoise::emap.erase(c);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user