-}
-
-static float eval(struct metasurface *ms, float x, float y, float z)
-{
- int xidx = cround64(x);
- int yidx = cround64(y);
- int zidx = cround64(z);
-
- assert(xidx >= 0 && xidx < VOL_SZ);
- assert(yidx >= 0 && yidx < VOL_SZ);
- assert(zidx >= 0 && zidx < VOL_SZ);
-
- return VOXEL(xidx, yidx, zidx);
-}
-
-static void emit_vertex(struct metasurface *ms, float x, float y, float z)
-{
- struct g3d_vertex v;
-
- v.x = x - VOL_HALF_SCALE;
- v.y = y - VOL_HALF_SCALE;
- v.z = z - VOL_HALF_SCALE;
- v.r = cround64(255.0 * x / VOL_SCALE);
- v.g = cround64(255.0 * y / VOL_SCALE);
- v.b = cround64(255.0 * z / VOL_SCALE);
-
- mmesh.varr = dynarr_push(mmesh.varr, &v);
- assert(mmesh.varr);
- ++mmesh.vcount;