Skip to content

Commit

Permalink
fix(Octree): Improve Octree's sample (Orillusion#289)
Browse files Browse the repository at this point in the history
Improve Octree's sample
  • Loading branch information
hellmor authored Sep 1, 2023
1 parent 6dc9f37 commit 1321153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion samples/octree/Sample_OctTreeBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class Sample_OctTreeBox {

let retBoolean = {};
for (let item of this.queryResult) {
retBoolean[item.uuid] = true;
let enable = this.movingBox.containsBox(item.renderer.object3D.bound as BoundingBox);
retBoolean[item.uuid] = enable;
}
for (let item of this.entities) {
item.renderer.enable = retBoolean[item.uuid];
Expand Down
3 changes: 2 additions & 1 deletion samples/octree/Sample_OctTreeFrustum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export class Sample_OctTreeFrustum {

let retBoolean = {};
for (let item of this.queryResult) {
retBoolean[item.uuid] = true;
let enable = this.camera.frustum.containsBox(item.renderer.object3D.bound);
retBoolean[item.uuid] = enable;
}
for (let item of this.entities) {
item.renderer.enable = retBoolean[item.uuid];
Expand Down

0 comments on commit 1321153

Please sign in to comment.