MCPcopy Create free account
hub / github.com/assaultcube/AC / subdivide

Function subdivide

source/src/renderparticles.cpp:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20static void subdivide(int depth, int face)
21{
22 if(depth-- <= 0) return;
23 int idx[6];
24 loopi(3) idx[i] = hemiindices[face+i];
25 loopi(3)
26 {
27 int vert = heminumverts++;
28 hemiverts[vert] = vec(hemiverts[idx[i]]).add(hemiverts[idx[(i+1)%3]]).normalize(); //push on to unit sphere
29 idx[3+i] = vert;
30 hemiindices[face+i] = vert;
31 }
32 subdivide(depth, face);
33 loopi(3) genface(depth, idx[i], idx[3+i], idx[3+(i+2)%3]);
34}
35
36//subdiv version wobble much more nicely than a lat/longitude version
37static void inithemisphere(int hres, int depth)

Callers 1

genfaceFunction · 0.85

Calls 4

vecClass · 0.85
genfaceFunction · 0.85
loopiFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected