/// <summary> /// remove all polygons that are inside this subtree /// </summary> /// <param name="polygons">polygons to remove</param> private List <CSGPolygon> ClipPolygons(List <CSGPolygon> polygons) { if (Plane == null) { return(new List <CSGPolygon>(polygons)); } var frontList = new List <CSGPolygon>(); var backList = new List <CSGPolygon>(); foreach (var polygon in polygons) { Plane.Split(polygon, frontList, backList, frontList, backList); } if (FrontChild != null) { frontList = FrontChild.ClipPolygons(frontList); } if (BackChild != null) { backList = BackChild.ClipPolygons(backList); } else { backList.Clear(); } var concat = new List <CSGPolygon>(frontList); concat.AddRange(backList); return(concat); }
// Token: 0x0600417B RID: 16763 RVA: 0x0014ABC0 File Offset: 0x00148FC0 public void ClipTo(CSGNode node) { this.Polygons = node.ClipPolygons(this.Polygons); if (this.FrontChild != null) { this.FrontChild.ClipTo(node); } if (this.BackChild != null) { this.BackChild.ClipTo(node); } }
/// <summary> /// remove all polygons from this tree that are inside the other tree /// </summary> public void ClipTo(CSGNode node) { Polygons = node.ClipPolygons(Polygons); if (FrontChild != null) { FrontChild.ClipTo(node); } if (BackChild != null) { BackChild.ClipTo(node); } }