Exemple #1
0
        static public bool IsIntersecting(this Plane2 item, LineSegment2 line_segment, out Vector2 point)
        {
            float distance;
            bool  did_intersect = item.IsIntersecting(line_segment, out distance);

            point = line_segment.GetPointOnByDistance(distance);
            return(did_intersect);
        }
Exemple #2
0
        static public bool IsIntersecting(this Plane2 item, Ray2 ray, out Vector2 point)
        {
            float distance;
            bool  did_intersect = item.IsIntersecting(ray, out distance);

            point = ray.GetPointAlong(distance);
            return(did_intersect);
        }
Exemple #3
0
        static public bool IsIntersecting(this Plane2 item, LineSegment2 line_segment, out float distance)
        {
            if (item.IsIntersecting(line_segment.GetRay(), out distance))
            {
                if (distance <= line_segment.GetLength())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        static public bool IsIntersecting(this Plane2 item, Triangle2 triangle, out LineSegment2 output)
        {
            Vector2 v0;
            Vector2 v1;

            if (triangle.GetEdges()
                .TryConvert((LineSegment2 e, out Vector2 v) => item.IsIntersecting(e, out v))
                .PartOut(out v0, out v1) == 2)
            {
                output = new LineSegment2(v0, v1);
                return(true);
            }

            output = default(LineSegment2);
            return(false);
        }
Exemple #5
0
 static public bool IsIntersecting(this Face item, Plane2 plane, out Vector2 point)
 {
     return(plane.IsIntersecting(item.GetLineSegment(), out point));
 }
Exemple #6
0
 static public bool IsIntersecting(this Face item, Plane2 plane, out float distance)
 {
     return(plane.IsIntersecting(item.GetLineSegment(), out distance));
 }