Skip to content

Commit da55c5d

Browse files
committed
refactor touching to use bounds, faster
1 parent c49e178 commit da55c5d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • src/main/java/eu/mihosoft/vrl/v3d

src/main/java/eu/mihosoft/vrl/v3d/CSG.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,9 +3161,7 @@ public CSG markForRegeneration() {
31613161
public boolean touching(CSG incoming) {
31623162
// Fast bounding box overlap check, quick fail if not intersecting
31633163
// bounding boxes
3164-
if (this.getMaxX() > incoming.getMinX() && this.getMinX() < incoming.getMaxX()
3165-
&& this.getMaxY() > incoming.getMinY() && this.getMinY() < incoming.getMaxY()
3166-
&& this.getMaxZ() > incoming.getMinZ() && this.getMinZ() < incoming.getMaxZ()) {
3164+
if (isBoundsTouching(incoming)) {
31673165
// Run a full intersection
31683166
CSG inter = this.intersect(incoming);
31693167
if (inter.getPolygons().size() > 0) {

0 commit comments

Comments
 (0)