Interface INarrowPhaseFilter
Allows detected contacts to be modified or discarded before they affect the bodies.
public interface INarrowPhaseFilter
Remarks
Assign an implementation to NarrowPhaseFilter.
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 in world space. May be modified.
pointBJVectorContact point on shape B in world space. May be modified.
normalJVectorCollision normal in world space. May be modified. The contact pushes shape B along this direction and shape A against it.
penetrationfloatSigned penetration depth. Changing this value alone does not change the contact response; that is determined by the contact points and normal.
Returns
- bool
trueto keep the collision;falseto discard it.