Table of Contents

Interface INarrowPhaseFilter

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

Provides a hook into the narrowphase collision detection pipeline.

public interface INarrowPhaseFilter

Remarks

Implement this interface to intercept collisions after contact generation. This can be used to modify contact data, implement custom collision responses, or filter out specific collisions.

Methods

Filter(RigidBodyShape, RigidBodyShape, ref JVector, ref JVector, ref JVector, ref float)

Called for each detected collision with its contact data.

[CallbackThread(ThreadContext.Any)]
bool Filter(RigidBodyShape shapeA, RigidBodyShape shapeB, ref JVector pointA, ref JVector pointB, ref JVector normal, ref float penetration)

Parameters

shapeA RigidBodyShape

The first shape in the collision.

shapeB RigidBodyShape

The second shape in the collision.

pointA JVector

Contact point on shape A (modifiable).

pointB JVector

Contact point on shape B (modifiable).

normal JVector

Collision normal from B to A (modifiable).

penetration float

Penetration depth (modifiable).

Returns

bool

true to keep the collision; false to discard it.