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 used to solve the contact (modifiable). A positive normal impulse pushes shape B along this direction and shape A against it.
penetrationfloatSigned penetration depth reported by the narrowphase. Changes to this value alone do not affect the registered contact; its separation is derived from the contact points and normal.
Returns
- bool
trueto keep the collision;falseto discard it.