sim.collision.pipeline.SapCollisionPipeline#

class sim.collision.pipeline.SapCollisionPipeline(model: Any, *, reduce_contacts: bool = True, rigid_contact_max: int | None = None, max_triangle_pairs: int = 1000000, shape_pairs_filtered: wp.array(dtype=wp.vec2i) | None = None, requires_grad: bool | None = None, broad_phase: Literal['nxn', 'sap', 'explicit'] | SapBroadPhaseAllPairs | SapBroadPhaseSAP | SapBroadPhaseExplicit | None = None, narrow_phase: SapNarrowPhase | None = None)[source]#

Bases: object

Newton-compatible collision front end that writes SAP-owned rigid contacts.

The broad-phase, narrow-phase, and geometry data layout intentionally track Newton’s collision implementation for asset and behavior compatibility. Drake-style hydroelastic support is being merged; this class documents and exposes the rigid-contact path used by the SAP solver today.

__init__(model: Any, *, reduce_contacts: bool = True, rigid_contact_max: int | None = None, max_triangle_pairs: int = 1000000, shape_pairs_filtered: wp.array(dtype=wp.vec2i) | None = None, requires_grad: bool | None = None, broad_phase: Literal['nxn', 'sap', 'explicit'] | SapBroadPhaseAllPairs | SapBroadPhaseSAP | SapBroadPhaseExplicit | None = None, narrow_phase: SapNarrowPhase | None = None) None[source]#

Methods

__init__(model, *[, reduce_contacts, ...])

collide(state, contacts)

Populate a SapContacts buffer from the current collision state by running AABB setup, broad phase, and narrow phase.

contacts()

Allocate a SapContacts buffer sized for this pipeline and carrying any contact attributes requested by the model.

Attributes

rigid_contact_max

Return the configured flat rigid-contact capacity for this collision pipeline.