9 mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
13 // if (!model || !model->nodes)
14 // Sys_Error ("Mod_PointInLeaf: bad model");
17 if (node->contents < 0)
18 return (mleaf_t *)node;
21 node = node->children[(node->plane->type < 3 ? p[node->plane->type] : DotProduct (p,node->plane->normal)) < node->plane->dist];
22 if (node->contents < 0)
23 return (mleaf_t *)node;
26 return NULL; // never reached
29 mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
35 if (!model || !model->nodes)
36 Sys_Error ("Mod_PointInLeaf: bad model");
41 if (node->contents < 0)
42 return (mleaf_t *)node;
44 d = DotProduct (p,plane->normal) - plane->dist;
46 node = node->children[0];
48 node = node->children[1];
51 return NULL; // never reached
61 int SV_HullPointContents (hull_t *hull, int num, vec3_t p)
64 num = hull->clipnodes[num].children[(hull->planes[hull->clipnodes[num].planenum].type < 3 ? p[hull->planes[hull->clipnodes[num].planenum].type] : DotProduct (hull->planes[hull->clipnodes[num].planenum].normal, p)) < hull->planes[hull->clipnodes[num].planenum].dist];