BEPUphysics.BroadPhaseEntries.MobileCollidables.CompoundHelper.RemoveChildFromCompound C# (CSharp) Метод

RemoveChildFromCompound() публичный статический Метод

Removes a child from a compound body.
public static RemoveChildFromCompound ( Entity compound, bool>.Func removalPredicate, IList childContributions, ShapeDistributionInformation &distributionInfo ) : bool
compound Entity Original compound to have a child removed.
removalPredicate bool>.Func Delegate which determines if a child in the original compound should be moved to the new compound.
childContributions IList List of distribution information associated with each child shape of the whole compound shape used by the compound being split.
distributionInfo BEPUphysics.CollisionShapes.ShapeDistributionInformation Volume, volume distribution, and center information about the new form of the original compound collidable.
Результат bool
        public static bool RemoveChildFromCompound(Entity<CompoundCollidable> compound, Func<CompoundChild, bool> removalPredicate, IList<ShapeDistributionInformation> childContributions,
                        out ShapeDistributionInformation distributionInfo)
        {
            float weight;
            float removedWeight;
            Vector3 removedCenter;
            if (RemoveChildFromCompound(compound.CollisionInformation, removalPredicate, childContributions, out distributionInfo, out weight, out removedWeight, out removedCenter))
            {
                //Reconfigure the entities using the data computed in the split.
                //Only bother if there are any children left in the compound!
                if (compound.CollisionInformation.Children.Count > 0)
                {
                    float originalMass = compound.mass;
                    float newMass = (weight / (weight + removedWeight)) * originalMass;
                    Matrix3x3.Multiply(ref distributionInfo.VolumeDistribution, newMass * InertiaHelper.InertiaTensorScale, out distributionInfo.VolumeDistribution);
                    compound.Initialize(compound.CollisionInformation, newMass, distributionInfo.VolumeDistribution, distributionInfo.Volume);

                    RemoveReposition(compound, ref distributionInfo, weight, removedWeight, ref removedCenter);
                }

                return true;
            }
            else
                return false;
        }

Same methods

CompoundHelper::RemoveChildFromCompound ( CompoundCollidable compound, bool>.Func removalPredicate, IList childContributions, ShapeDistributionInformation &distributionInfo, float &weight, float &removedWeight, System.Vector3 &removedCenter ) : bool
CompoundHelper::RemoveChildFromCompound ( Entity compound, bool>.Func removalPredicate, IList childContributions ) : bool