Skip to content

Commit

Permalink
Frustum.intersectsWorldAABB(minmax) opensourceBIM#72
Browse files Browse the repository at this point in the history
changed minmax from [[xmin, ymin, zmin], [xwidth, ywidth, zwidth]]
to [[xmin, ymin, zmin], [xmax, ymax, zmax]]
  • Loading branch information
WeltWeitBau committed Feb 2, 2021
1 parent 4091d18 commit a7e4c12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion viewer/frustum.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion viewer/octree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a7e4c12

Please sign in to comment.