Skip to content

PhysicsWorld.SetCustomCollisionFilter(Func) Method

Definition

Namespace: Brine2D.Physics

Registers a user-level collision filter invoked for every potential contact pair. Return false to prevent the pair from colliding. Pass null to remove it. This filter is evaluated after per-body ShouldCollide and per-sub-shape ShouldCollide checks — all must pass for a contact to proceed. The callback is invoked from the Box2D broad-phase during fixed-update — keep it allocation-free.

public void SetCustomCollisionFilter(System.Func<Brine2D.ECS.Components.PhysicsBodyComponent,Brine2D.ECS.Components.PhysicsBodyComponent,bool>? filter);

Parameters

filter System.Func<PhysicsBodyComponent,PhysicsBodyComponent,System.Boolean>