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

Initialize() public method

Initializes the pair handler.
public Initialize ( BroadPhaseEntry entryA, BroadPhaseEntry entryB ) : void
entryA BroadPhaseEntry First entry in the pair.
entryB BroadPhaseEntry Second entry in the pair.
return void
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {

            triangle = entryA as ConvexCollidable<TriangleShape>;
            convex = entryB as ConvexCollidable;

            if (triangle == null || convex == null)
            {
                triangle = entryB as ConvexCollidable<TriangleShape>;
                convex = entryA as ConvexCollidable;

                if (triangle == null || convex == null)
                    throw new Exception("Inappropriate types used to initialize pair.");
            }

            //Contact normal goes from A to B.
            broadPhaseOverlap.entryA = convex;
            broadPhaseOverlap.entryB = triangle;

            base.Initialize(entryA, entryB);

        }