BEPUphysics.CollisionShapes.ConvexShapes.CylinderShape.GetLocalExtremePointWithoutMargin C# (CSharp) Метод

GetLocalExtremePointWithoutMargin() публичный Метод

Gets the extreme point of the shape in local space in a given direction.
public GetLocalExtremePointWithoutMargin ( System.Vector3 &direction, System.Vector3 &extremePoint ) : void
direction System.Vector3 Direction to find the extreme point in.
extremePoint System.Vector3 Extreme point on the shape.
Результат void
        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)
        {
            float horizontalLengthSquared = direction.X * direction.X + direction.Z * direction.Z;
            if (horizontalLengthSquared > Toolbox.Epsilon)
            {
                float multiplier = (radius - collisionMargin) / (float)Math.Sqrt(horizontalLengthSquared);
                extremePoint = new Vector3(direction.X * multiplier, Math.Sign(direction.Y) * (halfHeight - collisionMargin), direction.Z * multiplier);
            }
            else
            {
                extremePoint = new Vector3(0, Math.Sign(direction.Y) * (halfHeight - collisionMargin), 0);
            }

        }