示例#1
0
    private void OnDrawGizmos()
    {
        if (triangulatedMesh != null)
        {
            //Display the triangles with a random color
            TestAlgorithmsHelpMethods.DisplayMeshWithRandomColors(triangulatedMesh, seed);

            //Display the points
            TestAlgorithmsHelpMethods.DisplayPoints(points, 0.1f, Color.black);

            //Display the points on the hull
            if (pointsOnHull != null && pointsOnHull.Count > 0)
            {
                HashSet <Vector3> pointsOnHull_3d = new HashSet <Vector3>();

                foreach (MyVector2 p in pointsOnHull)
                {
                    pointsOnHull_3d.Add(p.ToVector3());
                }

                TestAlgorithmsHelpMethods.DisplayPoints(pointsOnHull_3d, 0.3f, Color.black);
            }
        }

        if (testTriangles != null)
        {
            List <Triangle2> test = new List <Triangle2>(testTriangles);

            testTriangleNumber = Mathf.Clamp(testTriangleNumber, 0, testTriangles.Count - 1);

            Triangle2 t = test[testTriangleNumber];

            TestAlgorithmsHelpMethods.DisplayTriangleEdges(t.p1.ToVector3(), t.p2.ToVector3(), t.p3.ToVector3(), Color.white);
        }
    }