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

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

Computes the volume contribution of a point.
public static GetPointContribution ( float pointWeight, Microsoft.Xna.Framework.Vector3 &center, Microsoft.Xna.Framework.Vector3 p, Matrix3x3 &contribution ) : void
pointWeight float Weight of the point.
center Microsoft.Xna.Framework.Vector3 Location to use as the center for the purposes of computing the contribution.
p Microsoft.Xna.Framework.Vector3 Point to compute the contribution of.
contribution BEPUutilities.Matrix3x3 Contribution of the point.
Результат void
        public static void GetPointContribution(float pointWeight, ref Vector3 center, Vector3 p, out Matrix3x3 contribution)
        {
            Vector3.Subtract(ref p, ref center, out p);
            float xx = pointWeight * p.X * p.X;
            float yy = pointWeight * p.Y * p.Y;
            float zz = pointWeight * p.Z * p.Z;
            contribution.M11 = yy + zz;
            contribution.M22 = xx + zz;
            contribution.M33 = xx + yy;
            contribution.M12 = -pointWeight * p.X * p.Y;
            contribution.M13 = -pointWeight * p.X * p.Z;
            contribution.M23 = -pointWeight * p.Y * p.Z;
            contribution.M21 = contribution.M12;
            contribution.M31 = contribution.M13;
            contribution.M32 = contribution.M23;
        }
    }