TerrainDisplay.Collision.Intersection.Test2DSegmentSegment C# (CSharp) Method

Test2DSegmentSegment() public static method

public static Test2DSegmentSegment ( System.Vector2 a, System.Vector2 b, System.Vector2 c, System.Vector2 d, float &t, System.Vector2 &p ) : bool
a System.Vector2
b System.Vector2
c System.Vector2
d System.Vector2
t float
p System.Vector2
return bool
        public static bool Test2DSegmentSegment(Vector2 a, Vector2 b, Vector2 c, Vector2 d, ref float t, ref Vector2 p)
        {
            var num = Signed2DTriArea(a, b, d);
            var num2 = Signed2DTriArea(a, b, c);
            if ((num * num2) < 0f)
            {
                var num3 = Signed2DTriArea(c, d, a);
                var num4 = (num3 + num2) - num;
                if ((num3 * num4) < 0f)
                {
                    t = num3 / (num3 - num4);
                    p = a + (t * (b - a));
                    return true;
                }
            }
            return false;
        }