Interface ICollisionCallbacks
- Namespace
- BepuPhysics.CollisionDetection
- Assembly
- BepuPhysics.dll
Callbacks invoked by a CollisionBatcher<TCallbacks>.
public interface ICollisionCallbacks
Methods
AllowCollisionTesting(int, int, int)
Checks whether further collision testing should be performed for a given subtask.
bool AllowCollisionTesting(int pairId, int childA, int childB)
Parameters
pairId
intId of the parent pair.
childA
intIndex of the child belonging to collidable A in the subpair under consideration.
childB
intIndex of the child belonging to collidable B in the subpair under consideration.
Returns
- bool
True if testing should proceed, false otherwise.
OnChildPairCompleted(int, int, int, ref ConvexContactManifold)
Provides control over subtask generated results before they are reported to the parent task.
void OnChildPairCompleted(int pairId, int childA, int childB, ref ConvexContactManifold manifold)
Parameters
pairId
intId of the parent pair that spawned this child pair.
childA
intIndex of the child belonging to collidable A in the subpair under consideration.
childB
intIndex of the child belonging to collidable B in the subpair under consideration.
manifold
ConvexContactManifoldManifold of the child pair to configure.
OnPairCompleted<TManifold>(int, ref TManifold)
Called when a pair submitted to a collision batcher has finished collision detection.
void OnPairCompleted<TManifold>(int pairId, ref TManifold manifold) where TManifold : unmanaged, IContactManifold<TManifold>
Parameters
pairId
intId of the pair that completed.
manifold
TManifoldContact manifold generated by collision testing.
Type Parameters
TManifold
Type of the contact manifold generated by collision detection.