Skip to main content

Module broadphase

Module broadphase 

Source
Expand description

Broadphase AABB kernels for parallel overlap detection.

Structs§

AabbGpu
Axis-aligned bounding box using f32 coordinates for GPU compatibility.
AabbOverlapKernel
Kernel that detects overlapping AABB pairs.
AabbSortKernel
Kernel that sorts AABBs along the X-axis and outputs sorted indices.
BvhGpuNode
A single node of a GPU-oriented BVH tree.
CompactPairList
A deduplicated, sorted list of overlapping body-ID pairs.
SortAndSweepGpu
Sort-and-sweep broadphase operating on AabbGpu values.
UniformGridGpu
Uniform 3-D grid for GPU broadphase.

Functions§

aabb_surface_area
Compute the surface area of an AabbGpu.
assign_to_grid_cells
Assigns each AABB in a flat array to uniform grid cells.
build_bvh
Build a BVH using a simple midpoint-split heuristic.
build_lbvh
Build a Linear BVH (LBVH) by sorting AABBs on their Morton codes.
bvh_depth
Compute the depth of the BVH tree.
bvh_leaf_count
Count the number of leaf nodes in the BVH.
bvh_sah_cost
Surface Area Heuristic (SAH) cost of a BVH tree.
lbvh_query_pairs
Query overlapping leaf pairs in an LBVH by traversal.
morton_code
Compute the 3-D Morton code (Z-curve) for integer coordinates.
morton_key_for_aabb
Compute a Morton key for a world-space AABB centroid.
morton_sort
Sort a slice of AabbGpu by Morton code (Z-order curve).
pairs_from_grid_assignments
Extract candidate pairs from a cell-assignment list.
refit_bvh
Refit BVH bounding boxes bottom-up after leaf AABBs have changed.
sah_best_split
Surface Area Heuristic (SAH) split for BVH construction.
sap_incremental_update
Update the sort-and-sweep pair list after a set of bodies have moved.
sort_and_sweep_flat
Sort-and-sweep on a flat f64 AABB array (GPU-style parallel data layout).