From a7e4c126e4ca54a41a41d253e5e8256c16ab2658 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 2 Feb 2021 18:03:19 +0100 Subject: [PATCH] Frustum.intersectsWorldAABB(minmax) #72 changed minmax from [[xmin, ymin, zmin], [xwidth, ywidth, zwidth]] to [[xmin, ymin, zmin], [xmax, ymax, zmax]] --- viewer/frustum.js | 2 +- viewer/octree.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/viewer/frustum.js b/viewer/frustum.js index bc8c332f..dfb1c7a0 100644 --- a/viewer/frustum.js +++ b/viewer/frustum.js @@ -39,7 +39,7 @@ export class Frustum { this.planes[5].init(m3 + m2, m7 + m6, m11 + m10, m15 + m14); } - // Tests for intersection with World-space AABB, which is assumed to be: [xmin, ymin, zmin, xwidth, ywidth, zwidth] + // Tests for intersection with World-space AABB, which is assumed to be: [xmin, ymin, zmin, xmax, ymax, zmax] intersectsWorldAABB(minmax) { var result = Frustum.INSIDE_FRUSTUM; var plane = null; diff --git a/viewer/octree.js b/viewer/octree.js index 0ca48a25..17be3c13 100644 --- a/viewer/octree.js +++ b/viewer/octree.js @@ -277,7 +277,10 @@ class Box { vec3.add(this.normalizedMinVector, this.normalizedMinVector, this.globalTranslationVector); vec3.add(this.normalizedMaxVector, this.normalizedMaxVector, this.globalTranslationVector); - this.minmax = [[this.normalizedMinVector[0], this.normalizedMinVector[1], this.normalizedMinVector[2]], [this.normalizedMaxVector[0] - this.normalizedMinVector[0], this.normalizedMaxVector[1] - this.normalizedMinVector[1], this.normalizedMaxVector[2] - this.normalizedMinVector[2]]]; + this.minmax = [ + [this.normalizedMinVector[0], this.normalizedMinVector[1], this.normalizedMinVector[2]], + [this.normalizedMaxVector[0], this.normalizedMaxVector[1], this.normalizedMaxVector[2]], + ]; } set(min, max) {