Browse Source

fix(core): Clean up. (#21955)

linbingquan 4 years ago
parent
commit
0bb7a813ae

+ 1 - 1
src/core/InstancedBufferAttribute.js

@@ -4,7 +4,7 @@ class InstancedBufferAttribute extends BufferAttribute {
 
 	constructor( array, itemSize, normalized, meshPerAttribute ) {
 
-		if ( typeof ( normalized ) === 'number' ) {
+		if ( typeof normalized === 'number' ) {
 
 			meshPerAttribute = normalized;
 

+ 1 - 1
src/core/InstancedInterleavedBuffer.js

@@ -6,7 +6,7 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {
 
 		super( array, stride );
 
-		this.meshPerAttribute = meshPerAttribute || 1;
+		this.meshPerAttribute = meshPerAttribute;
 
 	}
 

+ 2 - 2
src/core/InterleavedBufferAttribute.js

@@ -5,7 +5,7 @@ const _vector = /*@__PURE__*/ new Vector3();
 
 class InterleavedBufferAttribute {
 
-	constructor( interleavedBuffer, itemSize, offset, normalized ) {
+	constructor( interleavedBuffer, itemSize, offset, normalized = false ) {
 
 		this.name = '';
 
@@ -13,7 +13,7 @@ class InterleavedBufferAttribute {
 		this.itemSize = itemSize;
 		this.offset = offset;
 
-		this.normalized = normalized === true;
+		this.normalized = normalized;
 
 	}