示例#1
0
文件: KDTree.cs 项目: Arnyev/MG
        private bool CheckIntersection(List <Vector4> points, List <Intersection> intersections, Triangle triangleB, Vector3 p1, Vector3 p2,
                                       TriangleIndices triIndices, Vector2 myParameterP1, Vector2 myParameterP2, TriangleParameters otherParameter)
        {
            if (!IntersectionCurve.CheckIntersection(triangleB.A, triangleB.B, triangleB.C, p1, p2 - p1, out var id))
            {
                return(false);
            }

            var myParams    = myParameterP1 * (1 - id.D) + myParameterP2 * id.D;
            var otherParams = otherParameter.P1 * id.P1 + otherParameter.P2 * id.P2 +
                              otherParameter.P3 * id.P3;

            var worldPoint = new Vector4(p1 * (1 - id.D) + p2 * id.D, 1);

            points.Add(worldPoint);
            intersections.Add(new Intersection(myParams, otherParams));

            return(true);
        }