BEPUphysics.CollisionShapes.ConvexShapes.SphereShape.ComputeVolumeDistribution C# (CSharp) Method

ComputeVolumeDistribution() public method

Computes the volume distribution of the shape as well as its volume. The volume distribution can be used to compute inertia tensors when paired with mass and other tuning factors.
public ComputeVolumeDistribution ( float &volume ) : Matrix3x3
volume float Volume of the shape.
return Matrix3x3
        public override Matrix3x3 ComputeVolumeDistribution(out float volume)
        {
            var volumeDistribution = new Matrix3x3();
            float diagValue = ((2f / 5f) * Radius * Radius);
            volumeDistribution.M11 = diagValue;
            volumeDistribution.M22 = diagValue;
            volumeDistribution.M33 = diagValue;

            volume = ComputeVolume();
            return volumeDistribution;
        }