BEPUphysics.NarrowPhaseSystems.Pairs.CollidablePairHandler.UpdateMaterialProperties C# (CSharp) Method

UpdateMaterialProperties() public method

Forces an update of the pair's material properties. Uses default choices (such as the owning entities' materials).
public UpdateMaterialProperties ( ) : void
return void
        public void UpdateMaterialProperties()
        {
            UpdateMaterialProperties(null, null);
        }

Same methods

CollidablePairHandler::UpdateMaterialProperties ( InteractionProperties properties ) : void
CollidablePairHandler::UpdateMaterialProperties ( BEPUphysics.Materials.Material materialA, BEPUphysics.Materials.Material materialB ) : void

Usage Example

        protected void TryToAdd(Collidable a, Collidable b, Material materialA, Material materialB)
        {
            CollisionRule rule;

            if ((rule = CollisionRules.collisionRuleCalculator(a.collisionRules, b.collisionRules)) < 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;
                }
                var pair = new CollidablePair(a, b);
                if (!subPairs.ContainsKey(pair))
                {
                    CollidablePairHandler newPair = NarrowPhaseHelper.GetPairHandler(ref pair, rule);
                    if (newPair != null)
                    {
                        newPair.UpdateMaterialProperties(materialA, materialB);  //Override the materials, if necessary.
                        newPair.Parent = this;
                        subPairs.Add(pair, newPair);
                    }
                }
                containedPairs.Add(pair);
            }
        }