@@ -14198,43 +14198,56 @@ class Object3D extends EventDispatcher {
1419814198 object.drawRanges = this._drawRanges;
1419914199 object.reservedRanges = this._reservedRanges;
1420014200
14201- object.visibility = this._visibility;
14202- object.active = this._active;
14203- object.bounds = this._bounds.map( bound => ( {
14204- boxInitialized: bound.boxInitialized ,
14205- boxMin: bound.box.min .toArray(),
14206- boxMax: bound.box.max.toArray() ,
14207-
14208- sphereInitialized: bound.sphereInitialized ,
14209- sphereRadius: bound.sphere.radius,
14210- sphereCenter: bound.sphere.center.toArray()
14201+ object.geometryInfo = this._geometryInfo.map( info => ( {
14202+ ...info,
14203+ boundingBox: info.boundingBox ? {
14204+ min: info.boundingBox.min.toArray() ,
14205+ max: info.boundingBox.max .toArray()
14206+ } : undefined ,
14207+ boundingSphere: info.boundingSphere ? {
14208+ radius: info.boundingSphere.radius ,
14209+ center: info.boundingSphere.center.toArray()
14210+ } : undefined
1421114211 } ) );
14212+ object.instanceInfo = this._instanceInfo.map( info => ( { ...info } ) );
14213+
14214+ object.availableInstanceIds = this._availableInstanceIds.slice();
14215+ object.availableGeometryIds = this._availableGeometryIds.slice();
14216+
14217+ object.nextIndexStart = this._nextIndexStart;
14218+ object.nextVertexStart = this._nextVertexStart;
14219+ object.geometryCount = this._geometryCount;
1421214220
1421314221 object.maxInstanceCount = this._maxInstanceCount;
1421414222 object.maxVertexCount = this._maxVertexCount;
1421514223 object.maxIndexCount = this._maxIndexCount;
1421614224
1421714225 object.geometryInitialized = this._geometryInitialized;
14218- object.geometryCount = this._geometryCount;
1421914226
1422014227 object.matricesTexture = this._matricesTexture.toJSON( meta );
1422114228
14222- if ( this._colorsTexture !== null ) object.colorsTexture = this._colorsTexture.toJSON( meta );
14229+ object.indirectTexture = this._indirectTexture.toJSON( meta );
14230+
14231+ if ( this._colorsTexture !== null ) {
14232+
14233+ object.colorsTexture = this._colorsTexture.toJSON( meta );
14234+
14235+ }
1422314236
1422414237 if ( this.boundingSphere !== null ) {
1422514238
1422614239 object.boundingSphere = {
14227- center: object .boundingSphere.center.toArray(),
14228- radius: object .boundingSphere.radius
14240+ center: this .boundingSphere.center.toArray(),
14241+ radius: this .boundingSphere.radius
1422914242 };
1423014243
1423114244 }
1423214245
1423314246 if ( this.boundingBox !== null ) {
1423414247
1423514248 object.boundingBox = {
14236- min: object .boundingBox.min.toArray(),
14237- max: object .boundingBox.max.toArray()
14249+ min: this .boundingBox.min.toArray(),
14250+ max: this .boundingBox.max.toArray()
1423814251 };
1423914252
1424014253 }
@@ -27993,15 +28006,24 @@ class BatchedMesh extends Mesh {
2799328006 } ) );
2799428007 this._instanceInfo = source._instanceInfo.map( info => ( { ...info } ) );
2799528008
28009+ this._availableInstanceIds = source._availableInstanceIds.slice();
28010+ this._availableGeometryIds = source._availableGeometryIds.slice();
28011+
28012+ this._nextIndexStart = source._nextIndexStart;
28013+ this._nextVertexStart = source._nextVertexStart;
28014+ this._geometryCount = source._geometryCount;
28015+
2799628016 this._maxInstanceCount = source._maxInstanceCount;
2799728017 this._maxVertexCount = source._maxVertexCount;
2799828018 this._maxIndexCount = source._maxIndexCount;
2799928019
2800028020 this._geometryInitialized = source._geometryInitialized;
28001- this._geometryCount = source._geometryCount;
2800228021 this._multiDrawCounts = source._multiDrawCounts.slice();
2800328022 this._multiDrawStarts = source._multiDrawStarts.slice();
2800428023
28024+ this._indirectTexture = source._indirectTexture.clone();
28025+ this._indirectTexture.image.data = this._indirectTexture.image.data.slice();
28026+
2800528027 this._matricesTexture = source._matricesTexture.clone();
2800628028 this._matricesTexture.image.data = this._matricesTexture.image.data.slice();
2800728029
@@ -44800,6 +44822,14 @@ class LightShadow {
4480044822 */
4480144823 this.mapSize = new Vector2( 512, 512 );
4480244824
44825+ /**
44826+ * The type of shadow texture. The default is `UnsignedByteType`.
44827+ *
44828+ * @type {number}
44829+ * @default UnsignedByteType
44830+ */
44831+ this.mapType = UnsignedByteType;
44832+
4480344833 /**
4480444834 * The depth map generated using the internal camera; a location beyond a
4480544835 * pixel's depth is in shadow. Computed internally during rendering.
@@ -48083,37 +48113,73 @@ class ObjectLoader extends Loader {
4808348113 object._drawRanges = data.drawRanges;
4808448114 object._reservedRanges = data.reservedRanges;
4808548115
48086- object._visibility = data.visibility;
48087- object._active = data.active;
48088- object._bounds = data.bounds.map( bound => {
48116+ object._geometryInfo = data.geometryInfo.map( info => {
4808948117
48090- const box = new Box3() ;
48091- box.min.fromArray( bound.boxMin ) ;
48092- box.max.fromArray( bound.boxMax );
48118+ let box = null ;
48119+ let sphere = null ;
48120+ if ( info.boundingBox !== undefined ) {
4809348121
48094- const sphere = new Sphere ();
48095- sphere.radius = bound.sphereRadius ;
48096- sphere.center .fromArray( bound.sphereCenter );
48122+ box = new Box3 ();
48123+ box.min.fromArray( info.boundingBox.min ) ;
48124+ box.max .fromArray( info.boundingBox.max );
4809748125
48098- return {
48099- boxInitialized: bound.boxInitialized,
48100- box: box,
48126+ }
48127+
48128+ if ( info.boundingSphere !== undefined ) {
4810148129
48102- sphereInitialized: bound.sphereInitialized,
48103- sphere: sphere
48130+ sphere = new Sphere();
48131+ sphere.radius = info.boundingSphere.radius;
48132+ sphere.center.fromArray( info.boundingSphere.center );
48133+
48134+ }
48135+
48136+ return {
48137+ ...info,
48138+ boundingBox: box,
48139+ boundingSphere: sphere
4810448140 };
4810548141
4810648142 } );
48143+ object._instanceInfo = data.instanceInfo;
48144+
48145+ object._availableInstanceIds = data._availableInstanceIds;
48146+ object._availableGeometryIds = data._availableGeometryIds;
48147+
48148+ object._nextIndexStart = data.nextIndexStart;
48149+ object._nextVertexStart = data.nextVertexStart;
48150+ object._geometryCount = data.geometryCount;
4810748151
4810848152 object._maxInstanceCount = data.maxInstanceCount;
4810948153 object._maxVertexCount = data.maxVertexCount;
4811048154 object._maxIndexCount = data.maxIndexCount;
4811148155
4811248156 object._geometryInitialized = data.geometryInitialized;
48113- object._geometryCount = data.geometryCount;
4811448157
4811548158 object._matricesTexture = getTexture( data.matricesTexture.uuid );
48116- if ( data.colorsTexture !== undefined ) object._colorsTexture = getTexture( data.colorsTexture.uuid );
48159+
48160+ object._indirectTexture = getTexture( data.indirectTexture.uuid );
48161+
48162+ if ( data.colorsTexture !== undefined ) {
48163+
48164+ object._colorsTexture = getTexture( data.colorsTexture.uuid );
48165+
48166+ }
48167+
48168+ if ( data.boundingSphere !== undefined ) {
48169+
48170+ object.boundingSphere = new Sphere();
48171+ object.boundingSphere.center.fromArray( data.boundingSphere.center );
48172+ object.boundingSphere.radius = data.boundingSphere.radius;
48173+
48174+ }
48175+
48176+ if ( data.boundingBox !== undefined ) {
48177+
48178+ object.boundingBox = new Box3();
48179+ object.boundingBox.min.fromArray( data.boundingBox.min );
48180+ object.boundingBox.max.fromArray( data.boundingBox.max );
48181+
48182+ }
4811748183
4811848184 break;
4811948185
0 commit comments