Skip to content

Commit

Permalink
Fix delete geometry causing the model to disappear (#27484)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored Jan 2, 2024
1 parent 3c1a47a commit 17d8eee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ class BatchedMesh extends Mesh {
const active = this._active;
if ( active[ id ] === false ) {

return this;
return null;

}

Expand Down Expand Up @@ -643,7 +643,7 @@ class BatchedMesh extends Mesh {
const active = this._active;
if ( active[ id ] === false ) {

return this;
return null;

}

Expand Down Expand Up @@ -894,6 +894,7 @@ class BatchedMesh extends Mesh {
const index = geometry.getIndex();
const bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;

const active = this._active;
const visibility = this._visibility;
const multiDrawStarts = this._multiDrawStarts;
const multiDrawCounts = this._multiDrawCounts;
Expand Down Expand Up @@ -922,7 +923,7 @@ class BatchedMesh extends Mesh {

for ( let i = 0, l = visibility.length; i < l; i ++ ) {

if ( visibility[ i ] ) {
if ( visibility[ i ] && active[ i ] ) {

// get the bounds in world space
this.getMatrixAt( i, _matrix );
Expand Down Expand Up @@ -976,7 +977,7 @@ class BatchedMesh extends Mesh {

for ( let i = 0, l = visibility.length; i < l; i ++ ) {

if ( visibility[ i ] ) {
if ( visibility[ i ] && active[ i ] ) {

// determine whether the batched geometry is within the frustum
let culled = false;
Expand Down

0 comments on commit 17d8eee

Please sign in to comment.