未验证 提交 e7ca4934 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #14790 from WestLangley/dev-inst_buf_attr_normalized

InstancedBufferAttribute: support normalized attribute
......@@ -17,7 +17,7 @@
</p>
<h2>Constructor</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Boolean normalized], [param:Number meshPerAttribute] )</h3>
<p>
</p>
......
......@@ -4,9 +4,19 @@ import { BufferAttribute } from './BufferAttribute.js';
* @author benaadams / https://twitter.com/ben_a_adams
*/
function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) {
function InstancedBufferAttribute( array, itemSize, normalized, meshPerAttribute ) {
BufferAttribute.call( this, array, itemSize );
if ( typeof ( normalized ) === 'number' ) {
meshPerAttribute = normalized;
normalized = false;
console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
}
BufferAttribute.call( this, array, itemSize, normalized );
this.meshPerAttribute = meshPerAttribute || 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册