warp.bvh\_query\_aabb\_tiled ============================ .. function:: warp._src.lang.bvh_query_aabb_tiled(id: uint64, low: vec3f, high: vec3f) -> BvhQueryTiled .. hlist:: :columns: 8 * Kernel Construct an axis-aligned bounding box (AABB) query against a BVH for thread-block parallel traversal. For use in tiled kernels: all threads in the block cooperatively traverse the BVH. Advance the query with :func:`bvh_query_next_tiled` (one result index per thread per step) in a loop guarded by :func:`tile_query_valid`. ``low`` and ``high`` must be identical across all threads in the block and are given in BVH space (the space of the arrays passed to :class:`warp.Bvh`). :param id: The BVH identifier :param low: The lower bound of the query box, in BVH space (must be the same for all threads in the block) :param high: The upper bound of the query box, in BVH space (must be the same for all threads in the block) :returns: A :class:`warp.BvhQueryTiled` to advance with :func:`bvh_query_next_tiled`. .. rubric:: Example .. testcode:: @wp.kernel def tiled_query(bvh_id: wp.uint64, lowers: wp.array[wp.vec3], uppers: wp.array[wp.vec3], lo: wp.vec3, hi: wp.vec3, centers: wp.array[wp.vec3]): query = wp.bvh_query_aabb_tiled(bvh_id, lo, hi) while wp.tile_query_valid(query): result = wp.bvh_query_next_tiled(query) item = wp.untile(result) if item >= 0: centers[item] = 0.5 * (lowers[item] + uppers[item]) lowers = wp.array([[0, 0, 0], [2, 0, 0], [4, 0, 0]], dtype=wp.vec3) uppers = wp.array([[1, 1, 1], [3, 1, 1], [5, 1, 1]], dtype=wp.vec3) bvh = wp.Bvh(lowers=lowers, uppers=uppers) centers = wp.zeros(3, dtype=wp.vec3) wp.launch_tiled(tiled_query, dim=[1], inputs=[bvh.id, lowers, uppers, wp.vec3(0.5, 0.5, 0.5), wp.vec3(4.5, 0.5, 0.5)], outputs=[centers], block_dim=32) print(centers.numpy().tolist()) .. testoutput:: [[0.5, 0.5, 0.5], [2.5, 0.5, 0.5], [4.5, 0.5, 0.5]]