public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
{
mobileMesh = entryA as MobileMeshCollidable;
convex = entryB as ConvexCollidable;
if (mobileMesh == null || convex == null)
{
mobileMesh = entryB as MobileMeshCollidable;
convex = entryA as ConvexCollidable;
if (mobileMesh == null || convex == null)
throw new Exception("Inappropriate types used to initialize pair.");
}
//Contact normal goes from A to B.
broadPhaseOverlap.entryA = convex;
broadPhaseOverlap.entryB = mobileMesh;
//It's possible that the convex does not have an entity if it is a proxy for a non-entity collidable.
//Similarly, the mesh could be a query object.
UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, mobileMesh.entity != null ? mobileMesh.entity.material : null);
base.Initialize(entryA, entryB);
}