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

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

Computes the volume and volume distribution of a shape.
public static ComputeVolumeDistribution ( ConvexShape shape, float &volume ) : Matrix3x3
shape ConvexShape Shape to compute the volume information of.
volume float Volume of the shape.
Результат BEPUutilities.Matrix3x3
        public static Matrix3x3 ComputeVolumeDistribution(ConvexShape shape, out float volume)
        {
            var pointContributions = CommonResources.GetVectorList();
            GetPoints(shape, out volume, pointContributions);
            Vector3 center = AveragePoints(pointContributions);
            Matrix3x3 volumeDistribution = ComputeVolumeDistribution(pointContributions, ref center);
            CommonResources.GiveBack(pointContributions);
            return volumeDistribution;
        }

Same methods

InertiaHelper::ComputeVolumeDistribution ( ConvexShape shape, Microsoft.Xna.Framework.Vector3 &center, float &volume ) : Matrix3x3
InertiaHelper::ComputeVolumeDistribution ( RawList pointContributions, Microsoft.Xna.Framework.Vector3 &center ) : Matrix3x3

Usage Example

Пример #1
0
 /// <summary>
 /// 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.
 /// </summary>
 /// <param name="volume">Volume of the shape.</param>
 /// <returns>Volume distribution of the shape.</returns>
 public override Matrix3X3 ComputeVolumeDistribution(out float volume)
 {
     return(InertiaHelper.ComputeVolumeDistribution(this, out volume));
 }