2
0
Эх сурвалжийг харах

BufferAttribute: Make `normalized` parameter to be optional. (#25046)

* BufferAttribute: Make `normalized` parameter to be optional.

* InterleavedBufferAttribute: Removed useless code.
linbingquan 2 жил өмнө
parent
commit
86d6b9f88a

+ 2 - 2
src/core/BufferAttribute.js

@@ -8,7 +8,7 @@ const _vector2 = /*@__PURE__*/ new Vector2();
 
 
 class BufferAttribute {
 class BufferAttribute {
 
 
-	constructor( array, itemSize, normalized ) {
+	constructor( array, itemSize, normalized = false ) {
 
 
 		if ( Array.isArray( array ) ) {
 		if ( Array.isArray( array ) ) {
 
 
@@ -23,7 +23,7 @@ class BufferAttribute {
 		this.array = array;
 		this.array = array;
 		this.itemSize = itemSize;
 		this.itemSize = itemSize;
 		this.count = array !== undefined ? array.length / itemSize : 0;
 		this.count = array !== undefined ? array.length / itemSize : 0;
-		this.normalized = normalized === true;
+		this.normalized = normalized;
 
 
 		this.usage = StaticDrawUsage;
 		this.usage = StaticDrawUsage;
 		this.updateRange = { offset: 0, count: - 1 };
 		this.updateRange = { offset: 0, count: - 1 };

+ 1 - 1
src/core/InterleavedBufferAttribute.js

@@ -16,7 +16,7 @@ class InterleavedBufferAttribute {
 		this.itemSize = itemSize;
 		this.itemSize = itemSize;
 		this.offset = offset;
 		this.offset = offset;
 
 
-		this.normalized = normalized === true;
+		this.normalized = normalized;
 
 
 	}
 	}