newton.geometry.BroadPhaseExplicit#
- class newton.geometry.BroadPhaseExplicit[source]#
Bases:
objectA broad phase collision detection class that only checks explicitly provided geometry pairs.
This class performs collision detection only between geometry pairs that are explicitly specified, rather than checking all possible pairs. This can be more efficient when the set of potential collision pairs is known ahead of time.
The class checks for axis-aligned bounding box (AABB) overlaps between the specified geometry pairs, taking into account per-geometry cutoff distances.
- __init__()#
- launch(shape_lower, shape_upper, shape_contact_margin, shape_pairs, shape_pair_count, candidate_pair, num_candidate_pair, device=None)#
Launch the explicit pairs broad phase collision detection.
This method checks for AABB overlaps only between explicitly specified shape pairs, rather than checking all possible pairs. It populates the candidate_pair array with indices of shape pairs whose AABBs overlap.
- Parameters:
shape_lower (wp.array(dtype=wp.vec3, ndim=1)) – Array of lower bounds for shape bounding boxes
shape_upper (wp.array(dtype=wp.vec3, ndim=1)) – Array of upper bounds for shape bounding boxes
shape_contact_margin (wp.array(dtype=float, ndim=1) | None) – Optional array of per-shape contact margins. If None or empty array, assumes AABBs are pre-expanded (margins = 0). If provided, margins are added during overlap checks.
shape_pairs (wp.array(dtype=wp.vec2i, ndim=1)) – Array of precomputed shape pairs to check
shape_pair_count (int) – Number of shape pairs to check
candidate_pair (wp.array(dtype=wp.vec2i, ndim=1)) – Output array to store overlapping shape pairs
num_candidate_pair (wp.array(dtype=int, ndim=1)) – Output array to store number of overlapping pairs found
device – Device to launch on. If None, uses the device of the input arrays.
The method will populate candidate_pair with the indices of shape pairs whose AABBs overlap (with optional margin expansion), but only checking the explicitly provided pairs.