BEPUphysics.NarrowPhaseSystems.Pairs.DetectorVolumeGroupPairHandler.TryToAdd C# (CSharp) Метод

TryToAdd() защищенный Метод

protected TryToAdd ( EntityCollidable collidable ) : void
collidable BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable
Результат void
        protected void TryToAdd(EntityCollidable collidable)
        {
            CollisionRule rule;
            if ((rule = CollisionRules.collisionRuleCalculator(DetectorVolume, collidable)) < CollisionRule.NoNarrowPhasePair)
            {
                //Clamp the rule to the parent's rule.  Always use the more restrictive option.
                //Don't have to test for NoNarrowPhasePair rule on the parent's rule because then the parent wouldn't exist!
                if (rule < CollisionRule)
                    rule = CollisionRule;
                if (!subPairs.ContainsKey(collidable))
                {
                    var newPair = NarrowPhaseHelper.GetPairHandler(DetectorVolume, collidable, rule) as DetectorVolumePairHandler;
                    if (newPair != null)
                    {
                        newPair.Parent = this;
                        subPairs.Add(collidable, newPair);
                    }
                }
                containedPairs.Add(collidable);
            }
        }