コード例 #1
0
        public static int TrianglePoints(List <Vector2> pts, int Anum, int Bnum, int Cnum)
        {
            int cnt         = 0;
            var triangleABC = new Polygon2D();

            triangleABC.AddVertex(pts[Anum]);
            triangleABC.AddVertex(pts[Bnum]);
            triangleABC.AddVertex(pts[Cnum]);

            for (int i = 0; i < pts.Count; i++)
            {
                if ((i == Bnum) || (i == Anum) || (i == Cnum))
                {
                    continue;
                }
                if (triangleABC.ContainsInside(pts[i]))
                {
                    cnt++;
                }
            }


            //Debug.Log(cnt);
            triangleABC.Clear();
            return(cnt);
        }
コード例 #2
0
        public void ClearTest()
        {
            var poly = new Polygon2D(m_arrowVertices);

            poly.Clear();
            Assert.AreEqual(0, poly.VertexCount);
            Assert.IsEmpty(poly.Vertices);
        }