diff --git a/3d-models.cpp b/3d-models.cpp index 32732114..480cd99f 100644 --- a/3d-models.cpp +++ b/3d-models.cpp @@ -30,7 +30,6 @@ vector geometry_information::get_shape(hpcshape sh) { hyperpoint get_center(const vector& vh) { hyperpoint h = Hypc; - using namespace hyperpoint_vec; for(auto h1: vh) h = h + h1; return normalize(h); } @@ -124,7 +123,6 @@ void geometry_information::add_texture(hpcshape& sh) { vector scaleshape(const vector& vh, ld s) { vector res; - using namespace hyperpoint_vec; for(hyperpoint h: vh) res.push_back(normalize(h * s + shcenter * (1-s))); return res; } @@ -542,7 +540,6 @@ void geometry_information::make_revolution_cut(hpcshape &sh, int each, ld push, for(int i=0; i d(vid.texture_step, 8); texture_order([&] (ld x, ld y) { - using namespace hyperpoint_vec; ld z = 1-x-y; ld r = scalefactor * hcrossf7 * (0 + pow(max(x,max(y,z)), .3) * 0.8); hyperpoint h = rspintox(a*x+b*y+c*z) * xpush0(r); @@ -709,7 +705,6 @@ hyperpoint psmin(hyperpoint H) { } void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye, ld shift_head, int q, ld zoom) { - using namespace hyperpoint_vec; hyperpoint center = Hypc; for(int i=eye.s; i 0) center += hpc[i]; center = normalize(center); @@ -785,7 +780,6 @@ void queueball(const transmatrix& V, ld rad, color_t col, eItem what) { auto line = [&] (transmatrix A, transmatrix B) { hyperpoint h0 = A * xpush0(1); hyperpoint h1 = B * xpush0(1); - using namespace hyperpoint_vec; for(int i=0; i<=8; i++) curvepoint(V1 * rspintox(normalize(h0*(8-i) + h1*i)) * xpush0(rad)); queuecurve(col, 0, PPR::LINE); @@ -899,7 +893,6 @@ void geometry_information::make_3d_models() { hyperpoint front_leg = Hypc; hyperpoint rear_leg = Hypc; - using namespace hyperpoint_vec; for(int i=shDogFrontPaw.s; i dv(vid.texture_step, 16); texture_order([&] (ld x, ld y) { - using namespace hyperpoint_vec; ld z = 1-x-y; ld rad = 2.1 - i * 0.2; hyperpoint hx = ddi(t*12, -zhexf*rad) * C0; diff --git a/binary-tiling.cpp b/binary-tiling.cpp index a5fe4915..6b5a4901 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -428,7 +428,6 @@ namespace binary { vector get_vertices(cell* c) override { vector res; ld yy = log(2) / 2; - using namespace hyperpoint_vec; auto add = [&] (hyperpoint h) { res.push_back(binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2])); }; @@ -644,7 +643,6 @@ namespace binary { // on which horocycle are we ld horo_level(hyperpoint h) { - using namespace hyperpoint_vec; h /= (1 + h[GDIM]); h[0] -= 1; h /= sqhypot_d(GDIM, h); @@ -653,7 +651,6 @@ namespace binary { } hyperpoint deparabolic3(hyperpoint h) { - using namespace hyperpoint_vec; h /= (1 + h[3]); hyperpoint one = point3(1,0,0); h -= one; diff --git a/cell.cpp b/cell.cpp index 22282fb5..3fde1a37 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1015,7 +1015,6 @@ vector build_shortest_path(cell *c1, cell *c2) { #endif vector p; if(euclid) { - using namespace hyperpoint_vec; p.push_back(c1); hyperpoint h = tC0(calc_relative_matrix(c2, c1, C0)); cell *x = c1; diff --git a/crystal.cpp b/crystal.cpp index c4dff5e3..1252409e 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -913,9 +913,6 @@ void centerrug(ld aspd) { } void cut_triangle2(const hyperpoint pa, const hyperpoint pb, const hyperpoint pc, const hyperpoint ha, const hyperpoint hb, const hyperpoint hc) { - using namespace hyperpoint_vec; - using hyperpoint_vec::operator *; - using hyperpoint_vec::operator +; ld zac = pc[3] / (pc[3] - pa[3]); hyperpoint pac = pa * zac + pc * (1-zac); hyperpoint hac = ha * zac + hc * (1-zac); diff --git a/drawing.cpp b/drawing.cpp index e381735f..0aadbab7 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -126,7 +126,6 @@ bool is_behind(const hyperpoint& H) { } hyperpoint be_just_on_view(const hyperpoint& H1, const hyperpoint &H2) { - using namespace hyperpoint_vec; // H1[2] * t + H2[2] * (1-t) == BEHIND_LIMIT - vid.alpha // H2[2]- BEHIND_LIMIT + vid.alpha = t * (H2[2] - H1[2]) ld t = (H2[2] - BEHIND_LIMIT + vid.alpha) / (H2[2] - H1[2]); @@ -236,7 +235,6 @@ void addpoint(const hyperpoint& H) { hyperpoint Hscr1; band_shift += 2 * M_PI; applymodel(H, Hscr1); - using namespace hyperpoint_vec; if(hypot_d(2, Hlast-Hscr1) < hypot_d(2, Hlast-Hscr)) { Hscr = Hscr1; } band_shift -= 4 * M_PI; applymodel(H, Hscr1); @@ -312,7 +310,6 @@ void addpoly(const transmatrix& V, const vector &tab, int ofs, int cnt if(correct_side(mid)) Hy = mid; else Hx = mid; } - using namespace hyperpoint_vec; goodpoint = midz(Hy, goodpoint); } @@ -561,7 +558,6 @@ void dqi_poly::gldraw() { ld scale_at(const transmatrix& T) { if(DIM == 3 && pmodel == mdPerspective) return 1 / abs((tC0(T))[2]); if(sol) return 1; - using namespace hyperpoint_vec; hyperpoint h1, h2, h3; applymodel(tC0(T), h1); applymodel(T * xpush0(.01), h2); @@ -582,7 +578,6 @@ ld linewidthat(const hyperpoint& h) { } } else if(svg::in || inHighQual) { - using namespace hyperpoint_vec; hyperpoint h0 = h / zlevel(h); transmatrix T = rgpushxto0(h0); return scale_at(T); @@ -839,7 +834,6 @@ void dqi_poly::draw() { for(int j=0; jradius); h[1] *= vid.stretch; if(i == 0) phases[j].push_back(h); @@ -866,7 +860,6 @@ void dqi_poly::draw() { // lin(a,b) is of form (x, 0, z) int cpha = 0; for(int i=0; itype; t++) texture_order([&] (ld x, ld y) { - using namespace hyperpoint_vec; hyperpoint left = binary::get_corner_horo_coordinates(c, t); hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), dfloor_table[k])); @@ -511,7 +508,6 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i int s = fsh.b[id].s; int e = fsh.b[id].e-1; for(int t=0; ttype; t++) texture_order([&] (ld x, ld y) { - using namespace hyperpoint_vec; hyperpoint left = binary::get_corner_horo_coordinates(c, t); hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), top + h * (x+y))); @@ -542,7 +537,6 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i int s = fsh.b[id].s; int e = fsh.b[id].e-1; for(int t=0; trenderedTexture; - using namespace hyperpoint_vec; hyperpoint center = eupush(gx, gy) * C0; hyperpoint v1 = hpxyz3(0.25, 0.25, 0, 0); hyperpoint v2 = hpxyz3(0.25, -0.25, 0, 0); diff --git a/geometry2.cpp b/geometry2.cpp index 3a88bdc6..578e1d9d 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -529,7 +529,6 @@ hyperpoint nearcorner(cell *c, int i) { return neis[i]; } if(penrose) { - using namespace hyperpoint_vec; if(approx_nearcorner) return kite::get_corner(c, i, 3) + kite::get_corner(c, i+1, 3) - C0; else diff --git a/goldberg.cpp b/goldberg.cpp index 29fa08c5..be3bf5d4 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -490,7 +490,7 @@ namespace hr { namespace gp { hyperpoint atz(const transmatrix& T, const transmatrix& corners, loc at, int cornerid = 6, ld cf = 3) { int sp = 0; again: - auto corner = corners * hyperpoint_vec::operator+ (loctoh_ort(at), hyperpoint_vec::operator/ (corner_coords[cornerid], cf)); + auto corner = corners * (loctoh_ort(at) + (corner_coords[cornerid] / cf)); if(corner[1] < -1e-6 || corner[2] < -1e-6) { at = at * eudir(1); if(cornerid < SG6) cornerid = (1 + cornerid) % SG6; diff --git a/graph.cpp b/graph.cpp index 2af92827..b6e35659 100644 --- a/graph.cpp +++ b/graph.cpp @@ -766,7 +766,6 @@ transmatrix radar_transform; pair makeradar(hyperpoint h) { if(GDIM == 3 && WDIM == 2) h = radar_transform * h; - using namespace hyperpoint_vec; ld d = hdist0(h); if(sol && nisot::geodesic_movement) { @@ -4489,7 +4488,6 @@ ld mousedist(transmatrix T) { if(mouseaim_sensitivity) return sqhypot_d(2, T1) + (point_behind(T1) ? 1e10 : 0); hyperpoint h1; applymodel(T1, h1); - using namespace hyperpoint_vec; h1 = h1 - hpxy((mousex - current_display->xcenter) / current_display->radius, (mousey - current_display->ycenter) / current_display->radius); return sqhypot_d(2, h1) + (point_behind(T1) ? 1e10 : 0); } @@ -4502,7 +4500,6 @@ void make_clipping_planes() { clipping_planes.clear(); if(sphere) return; auto add_clipping_plane = [] (ld x1, ld y1, ld x2, ld y2) { - using namespace hyperpoint_vec; ld z1 = 1, z2 = 1; hyperpoint sx = point3(y1 * z2 - y2 * z1, z1 * x2 - z2 * x1, x1 * y2 - x2 * y1); sx /= hypot_d(3, sx); @@ -5051,7 +5048,6 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { if(just_gmatrix) return; #if MAXMDIM >= 4 if(WDIM == 3 && pmodel == mdPerspective && !nil) { - using namespace hyperpoint_vec; hyperpoint H = tC0(V); for(hyperpoint& cpoint: clipping_planes) if((H|cpoint) < -sin_auto(cgi.corner_bonus)) { drawcell_in_radar(c, V); @@ -5060,7 +5056,6 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { noclipped++; } if(pmodel == mdGeodesic && sol) { - using namespace hyperpoint_vec; hyperpoint H = tC0(V); if(abs(H[0]) <= 3 && abs(H[1]) <= 3 && abs(H[2]) <= 3 ) ; else { @@ -5070,7 +5065,6 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { noclipped++; } if(pmodel == mdGeodesic && nil) { - using namespace hyperpoint_vec; hyperpoint H = tC0(V); if(abs(H[0]) <= 3 && abs(H[1]) <= 3 && abs(H[2]) <= 3 ) ; else { @@ -7210,7 +7204,6 @@ void precise_mouseover() { for(int i=0; itype; i++) { hyperpoint h1 = get_corner_position(mouseover, (i+mouseover->type-1) % mouseover->type); hyperpoint h2 = get_corner_position(mouseover, i); - using namespace hyperpoint_vec; hyperpoint hx = r_mouseh - h1; h2 = h2 - h1; ld z = h2[1] * hx[0] - h2[0] * hx[1]; diff --git a/hud.cpp b/hud.cpp index 2dfa1034..16d0ebe1 100644 --- a/hud.cpp +++ b/hud.cpp @@ -401,7 +401,6 @@ void draw_radar(bool cornermode) { if(scompass) { auto compassdir = [&] (char dirname, hyperpoint h) { - using namespace hyperpoint_vec; h = nisot::local_perspective * h * .8; queueline(atscreenpos(cx+rad * h[0], cy - rad * h[2] * si + rad * h[1] * co, 0)*C0, atscreenpos(cx+rad*h[0], cy - rad*h[2] * si, 0)*C0, 0xA0401040, -1); displaychr(int(cx+rad * h[0]), int(cy - rad * h[2] * si + rad * h[1] * co), 0, 8, dirname, 0xA04010); diff --git a/hyper.h b/hyper.h index 89ff9219..4142884b 100644 --- a/hyper.h +++ b/hyper.h @@ -339,39 +339,85 @@ extern videopar vid; extern array sightranges; +#define self (*this) + struct hyperpoint : array { hyperpoint() {} hyperpoint(ld x, ld y, ld z, ld w) { - (*this)[0] = x; (*this)[1] = y; (*this)[2] = z; - if(MAXMDIM == 4) (*this)[3] = w; + self[0] = x; self[1] = y; self[2] = z; + if(MAXMDIM == 4) self[3] = w; } + + inline hyperpoint& operator *= (ld d) { + for(int i=0; i 1-1e-6 && zlev < 1+1e-6) return 1; H /= zlev; return zlev; @@ -252,7 +251,6 @@ void make_twopoint(ld& x, ld& y) { } hyperpoint mobius(hyperpoint h, ld angle, ld scale = 1) { - using namespace hyperpoint_vec; h = perspective_to_space(h * scale, 1, gcSphere); h = rotmatrix(angle * degree, 1, 2) * h; return space_to_perspective(h, 1) / scale; @@ -306,8 +304,6 @@ hyperpoint compute_hybrid(hyperpoint H, int rootid) { void applymodel(hyperpoint H, hyperpoint& ret) { - using namespace hyperpoint_vec; - hyperpoint H_orig = H; switch(pmodel) { @@ -1510,7 +1506,6 @@ void draw_model_elements() { hyperpoint res = compute_hybrid(H, 2 | mode); conformal::apply_orientation(res[0], res[1]); conformal::apply_orientation_yz(res[2], res[1]); - using namespace hyperpoint_vec; curvepoint(res * current_display->radius); } queuecurve(ringcolor, 0, PPR::CIRCLE); @@ -1582,7 +1577,6 @@ void draw_model_elements() { void queuestraight(hyperpoint X, int style, color_t lc, color_t fc, PPR p) { - using namespace hyperpoint_vec; hyperpoint H; applymodel(X, H); H *= current_display->radius; @@ -1640,7 +1634,6 @@ void draw_boundary(int w) { for(int b=-1; b<=1; b+=2) for(ld a=-90; a<=90+1e-6; a+=pow(.5, vid.linequality)) { - using namespace hyperpoint_vec; ld x = sin(a * vid.twopoint_param * b / 90); ld y = 0; ld z = -sqrt(1 - x*x); @@ -1775,7 +1768,6 @@ void draw_boundary(int w) { } case mdSpiral: { - using namespace hyperpoint_vec; if(euclid) return; if(conformal::ring_not_spiral) return; // if(p == PPR::CIRCLE) p = PPR::OUTCIRCLE; diff --git a/irregular.cpp b/irregular.cpp index 555053f0..a12a9221 100644 --- a/irregular.cpp +++ b/irregular.cpp @@ -37,7 +37,6 @@ ld inner(hyperpoint h1, hyperpoint h2) { } hyperpoint circumscribe(hyperpoint a, hyperpoint b, hyperpoint c) { - using namespace hyperpoint_vec; hyperpoint h = C0; b = b - a; @@ -207,7 +206,6 @@ int rearrange(bool total, ld minedge) { int tooshort = 0; for(int i=0; id) for(const hyperpoint& h: layer.list) { - using namespace hyperpoint_vec; hyperpoint h1; applymodel(drawtrans * h, h1); ld d = sqhypot_d(2, h1 - onscr); diff --git a/nonisotropic.cpp b/nonisotropic.cpp index bb8dde27..cf241b14 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -524,7 +524,6 @@ namespace nilv { }; hyperpoint on_geodesic(hyperpoint s0, hyperpoint s1, ld x) { - using namespace hyperpoint_vec; hyperpoint local = inverse(nisot::translate(s0)) * s1; hyperpoint h = get_inverse_exp(local, 100); return nisot::translate(s0) * formula_exp(h * x); @@ -551,7 +550,6 @@ namespace nisot { } void geodesic_step(hyperpoint& at, hyperpoint& velocity) { - using namespace hyperpoint_vec; auto acc = christoffel(at, velocity, velocity); auto at2 = at + velocity / 2; @@ -565,7 +563,6 @@ namespace nisot { } hyperpoint direct_exp(hyperpoint v, int steps) { - using namespace hyperpoint_vec; hyperpoint at = point31(0, 0, 0); v /= steps; v[3] = 0; @@ -589,7 +586,6 @@ namespace nisot { h = Pos * h; int steps = 100; - using namespace hyperpoint_vec; h /= steps; auto tPos = transpose(Pos); diff --git a/pattern2.cpp b/pattern2.cpp index dd39310e..9b81b119 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -2179,7 +2179,6 @@ namespace linepatterns { hyperpoint vh1 = V1 * h1; hyperpoint vh2 = V2 * h2; ld cros = vh1[0]*vh2[0] + vh1[1]*vh2[1] + vh1[2]*vh2[2]; - using namespace hyperpoint_vec; if(cros > 0) gridline(V1, h1, V2, h2, col, par), gridline(V1, -1*h1, V2, -1*h2, col, par); diff --git a/polygons.cpp b/polygons.cpp index 032bbb35..5bbcad35 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -44,7 +44,6 @@ void geometry_information::chasmifyPoly(double fac, double fac2, int k) { last->flags |= POLY_TRIANGLES; last->texture_offset = 0; last->s = isize(hpc); - using namespace hyperpoint_vec; auto at = [&] (ld x, ld y) { x *= (isize(points) - 1); int zf = int(x); @@ -121,7 +120,6 @@ void geometry_information::finishshape() { if(area >= 0) last->flags |= POLY_INVERSE; if(DIM == 3) { - using namespace hyperpoint_vec; last->intester = Hypc; for(int i=last->s; ie; i++) last->intester += hpc[i]; if(last->s != last->e) last->intester /= last->e-last->s; @@ -689,7 +687,6 @@ void geometry_information::procedural_shapes() { vector equal_weights(20, 1); void geometry_information::make_wall(int id, vector vertices, vector weights) { - using namespace hyperpoint_vec; // orient correctly transmatrix T; @@ -745,18 +742,15 @@ void geometry_information::make_wall(int id, vector vertices, vector } vector make4(hyperpoint a, hyperpoint b, hyperpoint c) { - using namespace hyperpoint_vec; return {a, b, b+c-a, c}; } vector make5(hyperpoint a, hyperpoint b, hyperpoint c) { - using namespace hyperpoint_vec; return {a, (a+b)/2, b, b+c-a, c}; } void geometry_information::create_wall3d() { if(WDIM == 2) return; - using namespace hyperpoint_vec; int howmany = penrose ? 22 : S7; shWall3D.resize(howmany); shPlainWall3D.resize(howmany); @@ -875,7 +869,6 @@ void geometry_information::create_wall3d() { } if(DIM == 3 && euclid && S7 == 12) { - using namespace hyperpoint_vec; auto v = euclid3::get_shifttable(); for(int w=0; w<12; w++) { auto co = euclid3::getcoord(v[w]); @@ -889,7 +882,6 @@ void geometry_information::create_wall3d() { } if(DIM == 3 && euclid && S7 == 14) { - using namespace hyperpoint_vec; auto v = euclid3::get_shifttable(); for(int w=0; w<14; w++) { bshape(shWall3D[w], PPR::WALL); diff --git a/reg3.cpp b/reg3.cpp index e64a108d..7a76b4fc 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -49,8 +49,6 @@ namespace reg3 { void generate() { - using namespace hyperpoint_vec; - if(S7 == 4) face = 3; if(S7 == 6) face = 4; if(S7 == 12) face = 5; diff --git a/rug.cpp b/rug.cpp index 6eb2134d..23c1849a 100644 --- a/rug.cpp +++ b/rug.cpp @@ -79,7 +79,6 @@ bool rug_perspective = ISANDROID; // such that inverse(M) * h1 = ( |h1|, 0, 0) and inverse(M) * h2 = ( .., .., 0) transmatrix orthonormalize(hyperpoint h1, hyperpoint h2) { - using namespace hyperpoint_vec; hyperpoint vec[3] = {h1, h2, h1 ^ h2}; @@ -200,8 +199,6 @@ rugpoint *addRugpoint(hyperpoint h, double dist) { m->y1 = (1 - onscreen[1] * vid.scale) / 2; m->valid = false; - using namespace hyperpoint_vec; - if(euwrap && !bounded) { hyperpoint h1 = eumove(torusconfig::sdx, torusconfig::sdy) * C0; h1 /= sqhypot_d(2, h1); @@ -293,7 +290,6 @@ rugpoint *addRugpoint(hyperpoint h, double dist) { } rugpoint *findRugpoint(hyperpoint h) { - using namespace hyperpoint_vec; for(int i=0; ih - h) < 1e-5) return points[i]; return NULL; @@ -718,7 +714,6 @@ bool force(rugpoint& m1, rugpoint& m2, double rd, bool is_anticusp=false, double if(gwhere == gEuclid && fast_euclidean) { return force_euclidean(m1, m2, rd, is_anticusp, d1, d2); } - using namespace hyperpoint_vec; normalizer n(m1.flat, m2.flat); hyperpoint f1 = n(m1.flat); hyperpoint f2 = n(m2.flat); @@ -756,7 +751,6 @@ void preset(rugpoint *m) { int q = 0; hyperpoint h; for(int i=0; i<3; i++) h[i] = 0; - using namespace hyperpoint_vec; preset_points.clear(); @@ -891,7 +885,6 @@ void subdivide() { rugpoint *mm = addRugpoint(mid(m->h, m2->h), (m->dist+m2->dist)/2); halves[make_pair(m, m2)] = mm; if(!good_shape) { - using namespace hyperpoint_vec; normalizer n(m->flat, m2->flat); hyperpoint h1 = n(m->flat); hyperpoint h2 = n(m2->flat); @@ -1101,7 +1094,6 @@ void physics() { bool use_precompute; void getco(rugpoint *m, hyperpoint& h, int &spherepoints) { - using namespace hyperpoint_vec; h = use_precompute ? m->getglue()->precompute : m->getglue()->flat; if(rug_perspective && gwhere >= gSphere) { if(h[2] > 0) { @@ -1141,7 +1133,6 @@ bool project_ods(hyperpoint azeq, hyperpoint& h1, hyperpoint& h2, bool eye) { if(eye) tanalpha = -tanalpha; if(!sphere) tanalpha = -tanalpha; - using namespace hyperpoint_vec; ld d = hypot_d(3, azeq); ld sindbd = sin_auto(d)/d, cosd = cos_auto(d); @@ -1190,7 +1181,6 @@ vector cp_array; void drawTriangle(triangle& t) { int num = t.m[2] ? 3 : 2; - using namespace hyperpoint_vec; for(int i=0; ivalid) return; // if(t.m[i]->dist >= get_sightrange()+.51) return; @@ -1969,7 +1959,6 @@ void show() { if(!camera_center) push_all_points(2, model_distance); for(auto p:points) { if(adjust_edges) for(auto& e: p->edges) e.len *= modelscale / last; - using namespace hyperpoint_vec; if(adjust_points) p->flat *= modelscale / last; enqueue(p); } diff --git a/shmup.cpp b/shmup.cpp index 85db6313..d45348ad 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -1286,7 +1286,6 @@ void shootBullet(monster *m) { bullet->pid = m->pid; bullet->parenttype = m->type; bullet->hitpoints = 0; - using namespace hyperpoint_vec; bullet->inertia = cspin(0, WDIM-1, -M_PI/4 * i) * m->inertia; bullet->inertia[frontdir()] += bullet_velocity(m->type) * SCALE; additional.push_back(bullet); @@ -1815,7 +1814,6 @@ void movePlayer(monster *m, int delta) { hyperpoint avg_inertia; if(inertia_based && canmove) { - using namespace hyperpoint_vec; avg_inertia = m->inertia; ld coef = m->base->land == laWestWall ? 0.65 : falling ? 0.15 : 1; coef /= 1000; @@ -1981,7 +1979,6 @@ void movePlayer(monster *m, int delta) { if(!go || abs(playergo[cpid]) < 1e-3 || abs(playerturn[cpid]) > 1e-3) bulltime[cpid] = curtime; if(!go) { - using namespace hyperpoint_vec; playergo[cpid] = playergoturn[cpid] = playerstrafe[cpid] = 0; if(WDIM == 3) playerturn[cpid] = playerturny[cpid] = 0; if(falling) m->inertia = m->inertia * -1; @@ -2429,7 +2426,6 @@ void spawn_asteroids(monster *bullet, monster *target) { hyperpoint bullet_inertia = inverse(target->pat) * bullet->pat * bullet->inertia; for(int i=0; i<2; i++) { - using namespace hyperpoint_vec; monster* child = new monster; child->base = target->base; child->at = target->at; diff --git a/surface.cpp b/surface.cpp index 5eae21be..353d3176 100644 --- a/surface.cpp +++ b/surface.cpp @@ -6,8 +6,6 @@ #if CAP_SURFACE namespace hr { namespace surface { -using namespace hyperpoint_vec; - ld sech(ld d) { return 1 / cosh(d); } string shape_name[] = { "hypersian rug", "tractricoid", "Dini's surface", "Kuen surface", "concave barrel", diff --git a/textures.cpp b/textures.cpp index e1309466..d946f7fb 100644 --- a/textures.cpp +++ b/textures.cpp @@ -462,7 +462,6 @@ void texture_config::finish_mapping() { tinf3.texture_id = config.data.textureid; if(isize(texture_map) && isize(texture_map.begin()->second.triangles)) { auto& tris = texture_map.begin()->second.triangles; - using namespace hyperpoint_vec; for(int a=0; a<8; a++) { auto& tri = tris[a % isize(tris)]; @@ -645,7 +644,6 @@ ld magic_quality() { applymodel(ggmatrix(p.c) * p.cell_relative, inmodel); inmodel[0] *= current_display->radius * 1. / current_display->scrsize; inmodel[1] *= current_display->radius * 1. / current_display->scrsize; - using namespace hyperpoint_vec; q += sqhypot_d(2, inmodel - p.texture_coords); } return q;