Exemple #1
0
        internal static CSGTreeNode DuplicateInternal(CSGTreeNode node)
        {
            switch (node.Type)
            {
            case CSGNodeType.Brush:
            {
                var srcTreeBrush = (CSGTreeBrush)node;
                return(CSGTreeBrush.Create(srcTreeBrush.UserID, srcTreeBrush.LocalTransformation, srcTreeBrush.BrushMesh, srcTreeBrush.Operation, srcTreeBrush.Flags));
            }

            case CSGNodeType.Tree:
            {
                var srcTree = (CSGTree)node;
                return(CSGTree.Create(srcTree.UserID, DuplicateChildNodesInternal(srcTree)));
            }

            case CSGNodeType.Branch:
            {
                var srcTreeBranch = (CSGTreeBranch)node;
                return(CSGTreeBranch.Create(srcTreeBranch.UserID, srcTreeBranch.Operation, DuplicateChildNodesInternal(srcTreeBranch)));
            }

            default:
                throw new NotImplementedException();
            }
        }
Exemple #2
0
 public static ChiselWireframe CreateWireframe(CSGTreeBrush brush, int surfaceID)
 {
     if (!brush.Valid)
     {
         return(null);
     }
     return(CreateSurfaceWireframe(brush.NodeID, surfaceID));
 }
Exemple #3
0
 public static ChiselWireframe CreateWireframe(CSGTreeBrush brush)
 {
     if (!brush.Valid)
     {
         return(null);
     }
     return(CreateBrushWireframe(brush.NodeID));
 }
Exemple #4
0
 private static bool GetBrushOutlineValues(CSGTreeBrush brush,
                                           ref float3[]      vertices,
                                           ref Int32[]       visibleOuterLines)
 {
     ref var brushOutline = ref brush.Outline;
Exemple #5
0
        // TODO: generate outlines somewhere in managed code


        private static uint GetBrushOutlineHash(CSGTreeBrush brush)
        {
            return(brush.Outline.hash);
        }
Exemple #6
0
 public bool             IsInTree(CSGTreeBrush brush)
 {
     return(DoesTreeContainBrush(treeNodeID, brush.NodeID));
 }
Exemple #7
0
 public CSGTreeBrush CreateBrush(Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive)
 {
     return(CSGTreeBrush.Create(userID, brushMesh, operation));
 }