Example #1
0
 public Polygon(List <Vertex> vertices, PolygonShared shared = null, Plane plane = null)
 {
     Vertices = vertices;
     Shared   = shared ?? defaultShared;
     Plane    = plane ?? Plane.FromVector3Ds(vertices[0].Pos, vertices[1].Pos, vertices[2].Pos);
     if (debug)
     {
         //CheckIfConvex();
     }
 }
Example #2
0
        public PolygonShared GetPolygonShared(PolygonShared sourceshared)
        {
            var           hash = sourceshared.Hash;
            PolygonShared result;

            if (polygonsharedfactory.TryGetValue(hash, out result))
            {
                return(result);
            }
            else
            {
                polygonsharedfactory.Add(hash, sourceshared);
                return(sourceshared);
            }
        }
Example #3
0
        public Polygon(List <Vertex> vertices, PolygonShared?shared = null, Plane?plane = null)
        {
            Vertices = vertices;
            Shared   = shared ?? defaultShared;
            var verts = new Vector3D[vertices.Count];

            for (int i = 0; i < verts.Length; i++)
            {
                verts[i] = vertices[i].Pos;
            }
            Plane = plane ?? Plane.FromVector3Ds(verts);
            if (debug)
            {
                //CheckIfConvex();
            }
        }