BEPUphysics.NarrowPhaseSystems.Pairs.MobileMeshPairHandler.Initialize C# (CSharp) Method

Initialize() public method

Initializes the pair handler.
public Initialize ( BroadPhaseEntry entryA, BroadPhaseEntry entryB ) : void
entryA BEPUphysics.BroadPhaseEntries.BroadPhaseEntry First entry in the pair.
entryB BEPUphysics.BroadPhaseEntries.BroadPhaseEntry Second entry in the pair.
return void
        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);

        }