Interface INarrowPhaseFilter
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
shapeARigidBodyShapeThe first shape in the collision.
shapeBRigidBodyShapeThe second shape in the collision.
pointAJVectorContact point on shape A (modifiable).
pointBJVectorContact point on shape B (modifiable).
normalJVectorCollision normal from B to A (modifiable).
penetrationfloatPenetration depth (modifiable).
Returns
- bool
trueto keep the collision;falseto discard it.