Table of Contents

Interface INarrowPhaseFilter

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

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

shapeA RigidBodyShape

The first shape in the collision.

shapeB RigidBodyShape

The second shape in the collision.

pointA JVector

Contact point on shape A in world space. May be modified.

pointB JVector

Contact point on shape B in world space. May be modified.

normal JVector

Collision normal in world space. May be modified. The contact pushes shape B along this direction and shape A against it.

penetration float

Signed penetration depth. Changing this value alone does not change the contact response; that is determined by the contact points and normal.

Returns

bool

true to keep the collision; false to discard it.