Beispiel #1
0
        public void PointInTriangleTest2()
        {
            Vector2 point = Vector2.zero;
            Vector2 t0    = new Vector2(-1, 1);
            Vector2 t1    = new Vector2(1, 1);
            Vector2 t2    = new Vector2(0, -10);

            Assert.IsTrue(MeshBuilder3D.PointInTriangle(point, t0, t1, t2));
        }
Beispiel #2
0
        public void PointInTriangleTest3()
        {
            Vector2 point = new Vector2(10, 10);
            Vector2 t0    = new Vector2(-1, -1);
            Vector2 t1    = new Vector2(1, -1);
            Vector2 t2    = new Vector2(0, -10);

            Assert.IsFalse(MeshBuilder3D.PointInTriangle(point, t0, t1, t2));
        }
Beispiel #3
0
    /* parameters: None
     * returns: ObjectUpdate with information neccesary to actually make the planet in unity.
     */
    public int[] GeneratePlanet(DateTime start, out List <int>[] map, out List <Vector3> pts, out List <int>[][] trianglesHash)
    {
        map = ObjectUpdate.GetMap(connections);
        pts = Points;
        Debug.Log(pts.Count);

        triangles = new ObjectUpdate().GetTrianglesFromConnections(Points, map, out trianglesHash);
        //EventSystemMono.cacheObjMap = new List<int>[Points.Count];
        List <Vector3> pointsCopy = new List <Vector3>();

        foreach (Vector3 v in Points)
        {
            pointsCopy.Add(v);
        }
        //EventSystemMono.SetPoints(pointsCopy);
        //EventSystemMono.map = map;
        int[] mesh = MeshBuilder3D.GetMeshFrom(Points, triangles, map, trianglesHash);
        return(mesh);
    }