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

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

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

Same methods

InertiaHelper::ComputeVolumeDistribution ( ConvexShape shape, 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));
 }