Пример #1
0
/**
 * Find points in bbox
 *
 * quadtree_within(quadtree_t *tree, bbox_t *bbox, results_t *results)
 * @return void
 */
void
quadtree_within(node_t *root, bounds_t *bounds, within_callback_t cb) {
  if (node_isleaf(root)) {
    cb(root->point);
  } else {
    if (root->sw && bounds_intersect(bounds, root->sw)) {
      quadtree_within(root->sw, bounds, cb);
    }
    if (root->se && bounds_intersect(bounds, root->se)) {
      quadtree_within(root->se, bounds, cb);
    }
    if (root->nw && bounds_intersect(bounds, root->nw)) {
      quadtree_within(root->nw, bounds, cb);
    }
    if (root->ne && bounds_intersect(bounds, root->ne)) {
      quadtree_within(root->ne, bounds, cb);
    }
  }
}
Пример #2
0
bool galileo::c_bounds::ray_intersect(const c_ray& r, t_float tmin, t_float tmax) const
{
	return bounds_intersect(r, tmin, tmax, pp);
}