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

Function inithemisphere

source/src/renderparticles.cpp:37–52  ·  view source on GitHub ↗

subdiv version wobble much more nicely than a lat/longitude version

Source from the content-addressed store, hash-verified

35
36//subdiv version wobble much more nicely than a lat/longitude version
37static void inithemisphere(int hres, int depth)
38{
39 const int tris = hres << (2*depth);
40 heminumverts = heminumindices = 0;
41 DELETEA(hemiverts);
42 DELETEA(hemiindices);
43 hemiverts = new vec[tris+1];
44 hemiindices = new GLushort[tris*3];
45 hemiverts[heminumverts++] = vec(0.0f, 0.0f, 1.0f); //build initial 'hres' sided pyramid
46 loopi(hres)
47 {
48 float a = PI2*float(i)/hres;
49 hemiverts[heminumverts++] = vec(cosf(a), sinf(a), 0.0f);
50 }
51 loopi(hres) genface(depth, 0, i+1, 1+(i+1)%hres);
52}
53
54GLuint createexpmodtex(int size, float minval)
55{

Callers 1

setupexplosionFunction · 0.85

Calls 3

vecClass · 0.85
genfaceFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected