mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 22:39:53 +00:00
reg3:: subcubes:: optimized also identifying cells
This commit is contained in:
parent
889866f166
commit
45bdbdbbcc
12
reg3.cpp
12
reg3.cpp
@ -638,17 +638,20 @@ EX namespace reg3 {
|
|||||||
|
|
||||||
map<int, int> by_sides;
|
map<int, int> by_sides;
|
||||||
|
|
||||||
|
vector<map<unsigned, vector<hyperpoint> > > which_cell_0;
|
||||||
|
which_cell_0.resize(isize(allh));
|
||||||
|
|
||||||
acells_by_master.resize(isize(allh));
|
acells_by_master.resize(isize(allh));
|
||||||
for(int a=0; a<isize(allh); a++) {
|
for(int a=0; a<isize(allh); a++) {
|
||||||
for(int id=0; id<isize(ss); id++) {
|
for(int id=0; id<isize(ss); id++) {
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
|
auto& cc = ss[id].cellcenter;
|
||||||
for(auto& va: vertex_adjacencies[a]) {
|
for(auto& va: vertex_adjacencies[a]) {
|
||||||
for(auto c1: acells_by_master[va.h_id]) {
|
hyperpoint h = iso_inverse(va.T) * cc;
|
||||||
int id1 = local_id[c1].second;
|
for(auto h1: which_cell_0[va.h_id][bucketer(h)])
|
||||||
if(hdist(ss[id].cellcenter, va.T * ss[id1].cellcenter) < 1e-6)
|
if(hdist(h1, h) < 1e-6)
|
||||||
exists = true;
|
exists = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(exists) continue;
|
if(exists) continue;
|
||||||
cell *c = newCell(isize(ss[id].faces), allh[a]);
|
cell *c = newCell(isize(ss[id].faces), allh[a]);
|
||||||
by_sides[isize(ss[id].faces)]++;
|
by_sides[isize(ss[id].faces)]++;
|
||||||
@ -657,6 +660,7 @@ EX namespace reg3 {
|
|||||||
local_id[c] = {isize(acells), id};
|
local_id[c] = {isize(acells), id};
|
||||||
acells.push_back(c);
|
acells.push_back(c);
|
||||||
acells_by_master[a].push_back(c);
|
acells_by_master[a].push_back(c);
|
||||||
|
which_cell_0[a][bucketer(cc)].push_back(cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user