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

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

Computes the center and volume of a convex shape.
public static ComputeCenter ( ConvexShape shape, float &volume ) : Microsoft.Xna.Framework.Vector3
shape ConvexShape Shape to compute the center of.
volume float Volume of the shape.
Результат Microsoft.Xna.Framework.Vector3
        public static Vector3 ComputeCenter(ConvexShape shape, out float volume)
        {
            var pointContributions = CommonResources.GetVectorList();
            GetPoints(shape, out volume, pointContributions);
            Vector3 center = AveragePoints(pointContributions);
            CommonResources.GiveBack(pointContributions);
            MathChecker.Validate(center);
            return center;
        }

Same methods

InertiaHelper::ComputeCenter ( ConvexShape shape ) : Microsoft.Xna.Framework.Vector3

Usage Example

Пример #1
0
 /// <summary>
 /// Computes the center of the shape.  This can be considered its
 /// center of mass.  This calculation is often associated with the
 /// volume calculation, which is given by this method as well.
 /// </summary>
 /// <param name="volume">Volume of the shape.</param>
 /// <returns>Center of the shape.</returns>
 public override Vector3 ComputeCenter(out float volume)
 {
     return(InertiaHelper.ComputeCenter(this, out volume));
 }
All Usage Examples Of BEPUphysics.CollisionShapes.ConvexShapes.InertiaHelper::ComputeCenter