public void AddTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Color color) { var triangle = _objectPool.NewObject <TerrainMeshTriangle>(); triangle.Vertex0 = v0; triangle.Vertex1 = v1; triangle.Vertex2 = v2; triangle.Color0 = color; triangle.Color1 = color; triangle.Color2 = color; triangle.Region = TerrainMeshTriangle.InvalidRegionIndex; Triangles.Add(triangle); }
private Paths ClipByRectangle(Path clipRect, Paths subjects) { Clipper clipper = _objectPool.NewObject <Clipper>(); clipper.AddPath(clipRect, PolyType.ptClip, true); clipper.AddPaths(subjects, PolyType.ptSubject, true); var solution = new Paths(); clipper.Execute(ClipType.ctIntersection, solution); clipper.Clear(); _objectPool.StoreObject(clipper); return(solution); }
public MeshCanvasBuilder(IObjectPool objectPool) { _objectPool = objectPool; _clipper = objectPool.NewObject <Clipper>(); _offset = objectPool.NewObject <ClipperOffset>(); }