BEPUphysics.CollisionTests.CollisionAlgorithms.MinkowskiToolbox.ExpandMinkowskiSum C# (CSharp) Метод

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

Computes the expansion of the minkowski sum due to margins in a given direction.
public static ExpandMinkowskiSum ( float marginA, float marginB, System.Vector3 &direction, System.Vector3 &contribution ) : void
marginA float First margin.
marginB float Second margin.
direction System.Vector3 Extreme point direction.
contribution System.Vector3 Margin contribution to the extreme point.
Результат void
        public static void ExpandMinkowskiSum(float marginA, float marginB, ref Vector3 direction, out Vector3 contribution)
        {
            float lengthSquared = direction.LengthSquared();
            if (lengthSquared > Toolbox.Epsilon)
            {
                //The contribution to the minkowski sum by the margin is:
                //direction * marginA - (-direction) * marginB.
                Vector3.Multiply(ref direction, (marginA + marginB) / (float)Math.Sqrt(lengthSquared), out contribution);

            }
            else
            {
                contribution = new Vector3();
            }


        }

Same methods

MinkowskiToolbox::ExpandMinkowskiSum ( float marginA, float marginB, System.Vector3 direction, System.Vector3 &toExpandA, System.Vector3 &toExpandB ) : void