1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

moved hyperpoint inlines to hyperpoint.cpp

This commit is contained in:
Zeno Rogue 2019-08-10 00:28:28 +02:00
parent 19a01caf55
commit aa1b3f3057
3 changed files with 30 additions and 28 deletions

26
hyper.h
View File

@ -2824,30 +2824,4 @@ static const color_t NOCOLOR = 0;
namespace hr {
inline bool movepcto(const movedir& md) { return movepcto(md.d, md.subdir); }
inline hyperpoint cpush0(int c, ld x) {
hyperpoint h = Hypc;
h[GDIM] = cos_auto(x);
h[c] = sin_auto(x);
return h;
}
inline hyperpoint xspinpush0(ld alpha, ld x) {
hyperpoint h = Hypc;
h[GDIM] = cos_auto(x);
h[0] = sin_auto(x) * cos(alpha);
h[1] = sin_auto(x) * -sin(alpha);
return h;
}
inline hyperpoint xpush0(ld x) { return cpush0(0, x); }
inline hyperpoint ypush0(ld x) { return cpush0(1, x); }
inline void reset_projection() { new_projection_needed = true; }
// T * C0, optimized
inline hyperpoint tC0(const transmatrix &T) {
hyperpoint z;
for(int i=0; i<MDIM; i++) z[i] = T[i][DIM];
return z;
}
}

View File

@ -791,4 +791,32 @@ EX ld ortho_error(transmatrix T) {
return err;
}
#if HDR
inline hyperpoint cpush0(int c, ld x) {
hyperpoint h = Hypc;
h[GDIM] = cos_auto(x);
h[c] = sin_auto(x);
return h;
}
inline hyperpoint xspinpush0(ld alpha, ld x) {
hyperpoint h = Hypc;
h[GDIM] = cos_auto(x);
h[0] = sin_auto(x) * cos(alpha);
h[1] = sin_auto(x) * -sin(alpha);
return h;
}
inline hyperpoint xpush0(ld x) { return cpush0(0, x); }
inline hyperpoint ypush0(ld x) { return cpush0(1, x); }
inline void reset_projection() { new_projection_needed = true; }
// T * C0, optimized
inline hyperpoint tC0(const transmatrix &T) {
hyperpoint z;
for(int i=0; i<MDIM; i++) z[i] = T[i][DIM];
return z;
}
#endif
}

View File

@ -47,13 +47,13 @@ int eupattern4(cell *c) {
return (x&1) + ((y&1)) * 2;
}
bool ishept(cell *c) {
EX bool ishept(cell *c) {
// EUCLIDEAN
if(euclid) return eupattern(c) == 0;
else return c->type == S7;
}
bool ishex1(cell *c) {
EX bool ishex1(cell *c) {
// EUCLIDEAN
if(euclid) return eupattern(c) == 1;
#if CAP_GP