BEPUphysics.CollisionShapes.ConvexShapes.CapsuleShape.ComputeVolumeDistribution C# (CSharp) Метод

ComputeVolumeDistribution() публичный Метод

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.
Результат BEPUutilities.Matrix3x3
        public override Matrix3x3 ComputeVolumeDistribution(out float volume)
        {
            volume = ComputeVolume();


            //Calculate inertia tensor.
            var volumeDistribution = new Matrix3x3();
            float effectiveLength = Length + Radius / 2;
            float diagValue = (.0833333333f * effectiveLength * effectiveLength + .25f * Radius * Radius);
            volumeDistribution.M11 = diagValue;
            volumeDistribution.M22 = .5f * Radius * Radius;
            volumeDistribution.M33 = diagValue;

            return volumeDistribution;
        }