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(); } }
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); } }
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(); } }