Browse Source

Define callback default function on prototype instead of in constructor

Matches Object3D and is more efficient
aardgoose 7 years ago
parent
commit
5c3e5e0834
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/core/BufferAttribute.js

+ 2 - 2
src/core/BufferAttribute.js

@@ -25,8 +25,6 @@ function BufferAttribute( array, itemSize, normalized ) {
 	this.dynamic = false;
 	this.dynamic = false;
 	this.updateRange = { offset: 0, count: - 1 };
 	this.updateRange = { offset: 0, count: - 1 };
 
 
-	this.onUploadCallback = function () {};
-
 	this.version = 0;
 	this.version = 0;
 
 
 }
 }
@@ -45,6 +43,8 @@ Object.assign( BufferAttribute.prototype, {
 
 
 	isBufferAttribute: true,
 	isBufferAttribute: true,
 
 
+	onUploadCallback: function () {},
+
 	setArray: function ( array ) {
 	setArray: function ( array ) {
 
 
 		if ( Array.isArray( array ) ) {
 		if ( Array.isArray( array ) ) {