示例#1
0
 /// <summary>
 /// copy constructor
 /// </summary>
 /// <param name="instance">copy instance</param>
 public CSG(CSG instance)
 {
     Polygons = new List <CSGPolygon>(instance.Polygons.Count);
     foreach (var polygon in instance.Polygons)
     {
         Polygons.Add(new CSGPolygon(polygon));
     }
     root = new CSGNode();
     root.Build(Polygons);
 }
示例#2
0
文件: CSG.cs 项目: jaroosh/Habitat
 /// <summary>
 /// copy constructor
 /// </summary>
 /// <param name="instance">copy instance</param>
 public CSG(CSG instance)
 {
     Polygons = new List<CSGPolygon>(instance.Polygons.Count);
     foreach (var polygon in instance.Polygons)
     {
         Polygons.Add(new CSGPolygon(polygon));
     }
     root = new CSGNode();
     root.Build(Polygons);
 }
示例#3
0
文件: CSG.cs 项目: Smoothstep/VRChat
        // Token: 0x06004176 RID: 16758 RVA: 0x0014A900 File Offset: 0x00148D00
        public CSG Inverse()
        {
            CSG result = new CSG(this);

            foreach (CSGPolygon csgpolygon in this.Polygons)
            {
                csgpolygon.Flip();
            }
            return(result);
        }
示例#4
0
文件: CSG.cs 项目: Smoothstep/VRChat
 // Token: 0x0600416D RID: 16749 RVA: 0x0014A328 File Offset: 0x00148728
 public CSG(CSG instance)
 {
     this.Polygons = new List <CSGPolygon>(instance.Polygons.Count);
     foreach (CSGPolygon instance2 in instance.Polygons)
     {
         this.Polygons.Add(new CSGPolygon(instance2));
     }
     this.root = new CSGNode();
     this.root.Build(this.Polygons);
 }
示例#5
0
        /// <summary>
        /// make a csg inverse operation of this tree
        /// </summary>
        /// <returns>new csg tree</returns>
        public CSG Inverse()
        {
            var a = new CSG(this);

            foreach (var polygon in Polygons)
            {
                polygon.Flip();
            }

            return(a);
        }
示例#6
0
        /// <summary>
        /// make a csg union operation between this and parameter
        /// </summary>
        /// <param name="csg">csg tree</param>
        /// <returns>new csg tree</returns>
        public CSG Union(CSG csg)
        {
            var a = new CSG(this);
            var b = new CSG(csg);

            a.root.ClipTo(b.root);
            b.root.ClipTo(a.root);
            b.root.Invert();
            b.root.ClipTo(a.root);
            b.root.Invert();
            a.root.Build(b.root.AllPolygons());
            return(a);
        }
示例#7
0
文件: CSG.cs 项目: Smoothstep/VRChat
        // Token: 0x06004172 RID: 16754 RVA: 0x0014A764 File Offset: 0x00148B64
        public CSG Union(CSG csg)
        {
            CSG csg2 = new CSG(this);
            CSG csg3 = new CSG(csg);

            csg2.root.ClipTo(csg3.root);
            csg3.root.ClipTo(csg2.root);
            csg3.root.Invert();
            csg3.root.ClipTo(csg2.root);
            csg3.root.Invert();
            csg2.root.Build(csg3.root.AllPolygons());
            return(csg2);
        }
示例#8
0
文件: CSG.cs 项目: jaroosh/Habitat
        /// <summary>
        /// make a csg union operation between this and parameter
        /// </summary>
        /// <param name="csg">csg tree</param>
        /// <returns>new csg tree</returns>
        public CSG Union(CSG csg)
        {
            var a = new CSG(this);
            var b = new CSG(csg);

            a.root.ClipTo(b.root);
            b.root.ClipTo(a.root);
            b.root.Invert();
            b.root.ClipTo(a.root);
            b.root.Invert();
            a.root.Build(b.root.AllPolygons());
            return a;
        }
示例#9
0
文件: CSG.cs 项目: jaroosh/Habitat
        /// <summary>
        /// make a csg inverse operation of this tree
        /// </summary>
        /// <returns>new csg tree</returns>
        public CSG Inverse()
        {
            var a = new CSG(this);

            foreach (var polygon in Polygons)
            {
                polygon.Flip();
            }

            return a;
        }