Browse Source

InterleavedBufferAttribute: Simplify toJSON().

Mugen87 5 năm trước cách đây
mục cha
commit
52479c1f53

+ 2 - 2
src/core/BufferGeometry.js

@@ -1026,7 +1026,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 			const attribute = attributes[ key ];
 
-			const attributeData = attribute.toJSON( data.data, false );
+			const attributeData = attribute.toJSON( data.data );
 
 			if ( attribute.name !== '' ) attributeData.name = attribute.name;
 
@@ -1047,7 +1047,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 				const attribute = attributeArray[ i ];
 
-				const attributeData = attribute.toJSON( data.data, false );
+				const attributeData = attribute.toJSON( data.data );
 
 				if ( attribute.name !== '' ) attributeData.name = attribute.name;
 

+ 1 - 1
src/core/InterleavedBufferAttribute.d.ts

@@ -48,7 +48,7 @@ export class InterleavedBufferAttribute {
 		z: number,
 		w: number
 	): InterleavedBufferAttribute;
-	toJSON( data: object, deinterleave: boolean ): {
+	toJSON( data?: object ): {
 		isInterleavedBufferAttribute: true,
 		itemSize: number,
 		data: string,

+ 2 - 2
src/core/InterleavedBufferAttribute.js

@@ -179,9 +179,9 @@ Object.assign( InterleavedBufferAttribute.prototype, {
 
 	},
 
-	toJSON: function ( data = null, deinterleave = true ) {
+	toJSON: function ( data ) {
 
-		if ( deinterleave === true ) {
+		if ( data === undefined ) {
 
 			console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.' );