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

ScanObject() приватный статический Метод

private static ScanObject ( float rayIncrement, float maxLength, Microsoft.Xna.Framework.Vector3 &increment1, Microsoft.Xna.Framework.Vector3 &increment2, Ray &ray, RayHit &startHit, RayHit &endHit, RawList pointContributions, float &volume ) : void
rayIncrement float
maxLength float
increment1 Microsoft.Xna.Framework.Vector3
increment2 Microsoft.Xna.Framework.Vector3
ray Ray
startHit BEPUutilities.RayHit
endHit BEPUutilities.RayHit
pointContributions RawList
volume float
Результат void
        private static void ScanObject(float rayIncrement, float maxLength, ref Vector3 increment1, ref Vector3 increment2, ref Ray ray, ref RayHit startHit, ref RayHit endHit, RawList<Vector3> pointContributions, out float volume)
        {
            Vector3 cell;
            Vector3.Multiply(ref ray.Direction, rayIncrement, out cell);
            Vector3.Add(ref increment1, ref cell, out cell);
            Vector3.Add(ref increment2, ref cell, out cell);
            float perCellVolume = cell.X * cell.Y * cell.Z;

            volume = 0;

            for (int i = (int)(startHit.T / rayIncrement); i <= (int)((maxLength - endHit.T) / rayIncrement); i++)
            {
                Vector3 position;
                Vector3.Multiply(ref ray.Direction, (i + .5f) * rayIncrement, out position);
                Vector3.Add(ref position, ref ray.Position, out position);
                pointContributions.Add(position);
                volume += perCellVolume;
            }
        }