ClipOutTriangles() public method

public ClipOutTriangles ( FastLinkedList triangles, bool clipLessThan = true, IList discarded = null ) : void
triangles FastLinkedList
clipLessThan bool
discarded IList
return void
コード例 #1
0
ファイル: BSPTree.cs プロジェクト: polytronicgr/CSG-BSP
        /**
         * Recursive version of ClipByTree. This method recursively visits each node in this
         * BSPTree instance and clips the triangles of each based on the geometry of @tree.
         * By default it will remove the portions of triangles that are completely inside the
         * geometry contained by @tree.
         *
         * If @clipLessThan is false, the operation is reversed and triangle portions
         * outside the geometry of @tree instance are removed.
         */
        private void ClipByTree(Node node, BSPTree tree, bool clipLessThan = true, IList <Triangle> discarded = null)
        {
            if (node == null)
            {
                return;
            }

            tree.ClipOutTriangles(node.GetTriangleList(), clipLessThan, discarded);
            ClipByTree(node.LessThan, tree, clipLessThan, discarded);
            ClipByTree(node.GreaterThan, tree, clipLessThan, discarded);
        }
コード例 #2
0
ファイル: BSPTree.cs プロジェクト: mkkellogg/CSG-BSP
        /**
         * Recursive version of ClipByTree. This method recursively visits each node in this
         * BSPTree instance and clips the triangles of each based on the geometry of @tree.
         * By default it will remove the portions of triangles that are completely inside the
         * geometry contained by @tree.
         *
         * If @clipLessThan is false, the operation is reversed and triangle portions
         * outside the geometry of @tree instance are removed.
         */
        private void ClipByTree(Node node, BSPTree tree, bool clipLessThan = true, IList<Triangle> discarded = null)
        {
            if(node == null)return;

            tree.ClipOutTriangles (node.GetTriangleList(), clipLessThan, discarded);
            ClipByTree (node.LessThan, tree, clipLessThan, discarded);
            ClipByTree (node.GreaterThan, tree, clipLessThan, discarded);
        }