BEPUphysics.CollisionShapes.CompoundShape.ComputeVolumeDistribution C# (CSharp) Method

ComputeVolumeDistribution() public method

Computes the volume distribution of the shape.
public ComputeVolumeDistribution ( ) : Matrix3x3
return BEPUutilities.Matrix3x3
        public override Matrix3x3 ComputeVolumeDistribution()
        {
            var volumeDistribution = new Matrix3x3();
            float totalWeight = 0;
            for (int i = 0; i < shapes.Count; i++)
            {
                totalWeight += shapes.Elements[i].Weight;
                Matrix3x3 contribution;
                GetContribution(shapes.Elements[i].Shape, ref shapes.Elements[i].LocalTransform, ref Toolbox.ZeroVector, shapes.Elements[i].Weight, out contribution);
                Matrix3x3.Add(ref contribution, ref volumeDistribution, out volumeDistribution);

            }
            Matrix3x3.Multiply(ref volumeDistribution, 1 / totalWeight, out volumeDistribution);
            return volumeDistribution;
        }

Same methods

CompoundShape::ComputeVolumeDistribution ( IList entries, System.Vector3 &center ) : Matrix3x3
CompoundShape::ComputeVolumeDistribution ( float &volume ) : Matrix3x3