Description
The OnIntersectionStart
property of the PhysicsBody
class is an event handler that is triggered when a physics intersection begins. This property is of type System.Action<PhysicsIntersection>
, allowing you to assign a delegate or lambda expression that will be called with a PhysicsIntersection
parameter whenever an intersection starts.
Usage
To use the OnIntersectionStart
property, assign a method or lambda expression that matches the System.Action<PhysicsIntersection>
delegate signature. This method will be invoked whenever a new intersection involving this PhysicsBody
begins.
Example
// Example of using OnIntersectionStart
PhysicsBody physicsBody = new PhysicsBody();
// Assigning a lambda expression to handle the intersection start event
physicsBody.OnIntersectionStart = (intersection) =>
{
// Handle the intersection start
Log.Info($"Intersection started with: {intersection.OtherBody}");
};