Skip to main content

sap_incremental_update

Function sap_incremental_update 

Source
pub fn sap_incremental_update(
    existing: &CompactPairList,
    aabbs: &[AabbGpu],
    moved_ids: &[u32],
) -> CompactPairList
Expand description

Update the sort-and-sweep pair list after a set of bodies have moved.

This is an incremental update: only re-run SAP for the bodies that moved and merge with the existing pair list. All existing pairs involving moved bodies are removed and recomputed.

moved_ids: set of body_ids that have moved. aabbs: updated AABB array (all bodies).

Returns the updated pair list.