Skip to content

SubShape.ShouldCollide Property

Definition

Namespace: Brine2D.ECS.Components

Per-sub-shape collision filter. When set, called for every candidate contact pair involving this sub-shape — return false to prevent the pair from colliding.

The first parameter is the other PhysicsBodyComponent. The second is the specific SubShape on that body involved in the contact, or null when the other body's primary shape or a chain segment is the candidate. The callback is invoked from the Box2D broad-phase on the simulation thread — keep it allocation-free.

public System.Func<Brine2D.ECS.Components.PhysicsBodyComponent,Brine2D.ECS.Components.SubShape?,bool>? ShouldCollide { get; set; }

Property Value

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