+int LightAndVis_CullPointCloud(int numpoints, const float *points)
+{
+ int i;
+ const float *p;
+ int stackpos, sides;
+ mnode_t *node, *stack[4096];
+ //if (R_CullBox(mins, maxs))
+ // return true;
+ if (cl.worldmodel == NULL)
+ return false;
+ stackpos = 0;
+ stack[stackpos++] = cl.worldmodel->nodes;
+ while (stackpos)
+ {
+ node = stack[--stackpos];
+ if (node->contents < 0)
+ {
+ if (((mleaf_t *)node)->visframe == r_framecount && ((mleaf_t *)node)->worldnodeframe == shadowframecount)
+ return false;
+ }
+ else
+ {
+ sides = 0;
+ for (i = 0, p = points;i < numpoints && sides != 3;i++, p += 3)
+ {
+ if (DotProduct(p, node->plane->normal) < node->plane->dist)
+ sides |= 1;
+ else
+ sides |= 2;
+ }
+ if (sides & 2 && stackpos < 4096)
+ stack[stackpos++] = node->children[1];
+ if (sides & 1 && stackpos < 4096)
+ stack[stackpos++] = node->children[0];
+ }
+ }
+ return true;
+}
+