From 3e0f2bcd65d91f148e3df2b8d62a8f9d15b190f0 Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Wed, 30 Nov 2022 18:16:47 +0800 Subject: [PATCH 1/2] BufferAttribute: Make `normalized` parameter to be optional. --- src/core/BufferAttribute.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/BufferAttribute.js b/src/core/BufferAttribute.js index 688842c1186d09..b146f3479176fb 100644 --- a/src/core/BufferAttribute.js +++ b/src/core/BufferAttribute.js @@ -8,7 +8,7 @@ const _vector2 = /*@__PURE__*/ new Vector2(); class BufferAttribute { - constructor( array, itemSize, normalized ) { + constructor( array, itemSize, normalized = false ) { if ( Array.isArray( array ) ) { @@ -23,7 +23,7 @@ class BufferAttribute { this.array = array; this.itemSize = itemSize; this.count = array !== undefined ? array.length / itemSize : 0; - this.normalized = normalized === true; + this.normalized = normalized; this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; From c507fb88ae5df8b269240cb50f88b927c692d216 Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Wed, 30 Nov 2022 19:09:29 +0800 Subject: [PATCH 2/2] InterleavedBufferAttribute: Removed useless code. --- src/core/InterleavedBufferAttribute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/InterleavedBufferAttribute.js b/src/core/InterleavedBufferAttribute.js index 993f57be4e9183..b24fe14ba12e80 100644 --- a/src/core/InterleavedBufferAttribute.js +++ b/src/core/InterleavedBufferAttribute.js @@ -16,7 +16,7 @@ class InterleavedBufferAttribute { this.itemSize = itemSize; this.offset = offset; - this.normalized = normalized === true; + this.normalized = normalized; }