diff options
author | Ken Hughes <khughes@pacific.edu> | 2006-06-10 19:47:19 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2006-06-10 19:47:19 +0400 |
commit | 7fcc5800aef8f6355730ef27eb70f49f0480a42a (patch) | |
tree | 72ad0a31363a69c19e6182f2ec8852f9d12c9546 /intern/bsp/intern | |
parent | 3d47bb56fa17304d78b937b0d89dbaf93b9e947c (diff) |
===Tools===
Adding back some code to booleans that got lost in the Orange merge.
I've also added back the code which checked that meshes were solid
("manifolds") but have the actual check in
intern/boolop/intern/BOP_Interface.cpp, since from my testing it was
not causing crashes or hangs. It *can* give odd results depending on
what you're trying to intersect, but seems useful. Additionally, since
existing bugs in the current code can create non-solid/non-manifold
meshes, seems hypocritical to create a mesh that can't later be used in
another boolean operation.
Diffstat (limited to 'intern/bsp/intern')
-rwxr-xr-x | intern/bsp/intern/CSG_BooleanOps.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/bsp/intern/CSG_BooleanOps.cpp b/intern/bsp/intern/CSG_BooleanOps.cpp index a0b4dc0078d..1a3a149adeb 100755 --- a/intern/bsp/intern/CSG_BooleanOps.cpp +++ b/intern/bsp/intern/CSG_BooleanOps.cpp @@ -118,8 +118,6 @@ CSG_PerformBooleanOperation( BSP_MeshInfo * mesh_info = static_cast<BSP_MeshInfo *>(operation->CSG_info); if (mesh_info == NULL) return 0; - bool success = 1; - obAFaces.Reset(obAFaces.it); obBFaces.Reset(obBFaces.it); obAVertices.Reset(obAVertices.it); @@ -139,8 +137,9 @@ CSG_PerformBooleanOperation( break; } + BoolOpState boolOpResult; try { - BOP_performBooleanOperation( boolType, + boolOpResult = BOP_performBooleanOperation( boolType, mesh_info->output_descriptor, (BSP_CSGMesh**) &(mesh_info->output_mesh), mesh_info->obB_descriptor, @@ -155,7 +154,12 @@ CSG_PerformBooleanOperation( return 0; } - return success; + switch (boolOpResult) { + case BOP_OK: return 1; + case BOP_NO_SOLID: return -2; + case BOP_ERROR: return 0; + default: return 1; + } } int |