Skip to content

Commit

Permalink
Add copy and toJSON support for object sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Nov 12, 2023
1 parent 9d767fa commit d1b68f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/jsm/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ class BatchedMesh extends Mesh {

this.geometry = source.geometry.clone();
this.perObjectFrustumCulled = source.perObjectFrustumCulled;
this.sortObjects = source.sortObjects;
this.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;
this.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;

Expand Down
1 change: 1 addition & 0 deletions src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ class Object3D extends EventDispatcher {

object.type = 'BatchedMesh';
object.perObjectFrustumCulled = this.perObjectFrustumCulled;
object.sortObjects = this.sortObjects;

object.drawRanges = this._drawRanges;
object.reservedRanges = this._reservedRanges;
Expand Down

0 comments on commit d1b68f8

Please sign in to comment.