BEPUphysics.NarrowPhaseSystems.Pairs.CompoundMobileMeshPairHandler.UpdateContainedPairs C# (CSharp) Method

UpdateContainedPairs() protected method

protected UpdateContainedPairs ( ) : void
return void
        protected override void UpdateContainedPairs()
        {
            //Could go other way; get triangles in mesh that overlap the compound.
            //Could be faster sometimes depending on the way it's set up.

            var overlappedElements = PhysicsResources.GetCompoundChildList();
            compoundInfo.hierarchy.Tree.GetOverlaps(mesh.boundingBox, overlappedElements);
            for (int i = 0; i < overlappedElements.Count; i++)
            {
                TryToAdd(overlappedElements.Elements[i].CollisionInformation, mesh, overlappedElements.Elements[i].Material);
            }

            PhysicsResources.GiveBack(overlappedElements);

        }