Skip to content

PhysicsBodyComponent.OnCollisionStayWithShape Event

Definition

Namespace: Brine2D.ECS.Components

Fired every fixed-update tick while this body remains in contact with another body, with sub-shape detail.

C#
public event Action<PhysicsBodyComponent,CollisionContact,SubShape?,SubShape?>? OnCollisionStayWithShape;

Event Type

System.Action<PhysicsBodyComponent,CollisionContact,SubShape,SubShape>

Remarks

The sub-shape arguments reflect the sub-shapes that were present at the time the contact was \<em>first established\</em> \(i\.e\. the enter tick\), not necessarily the current sub-shapes. If sub-shapes are rebuilt at runtime \(e\.g\. via a [Shape](Shape.md 'Brine2D\.ECS\.Components\.PhysicsBodyComponent\.Shape') reassignment or [AddSubShape\(ShapeDefinition, bool, Nullable<float>, Nullable<float>\)](AddSubShape(ShapeDefinition,bool,Nullable_float_,Nullable_float_).md 'Brine2D.ECS.Components.PhysicsBodyComponent.AddSubShape\(Brine2D\.Physics\.ShapeDefinition, bool, System\.Nullable\<float\>, System\.Nullable\<float\>\)') call) while a contact is already active, the reported sub-shape references may be stale until the contact ends and re-enters. Use Brine2D.ECS.Components.PhysicsBodyComponent.OnCollisionStay for body-level events that are unaffected by sub-shape rebuilds.