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

Merge pull request #11288 from lojjic/Object3D-callbacks-to-prototype

onBeforeRender/onAfterRender from constructor to prototype
Mr.doob 8 жил өмнө
parent
commit
553d17f35f
1 өөрчлөгдсөн 3 нэмэгдсэн , 4 устгасан
  1. 3 4
      src/core/Object3D.js

+ 3 - 4
src/core/Object3D.js

@@ -92,10 +92,6 @@ function Object3D() {
 	this.renderOrder = 0;
 
 	this.userData = {};
-
-	this.onBeforeRender = function () {};
-	this.onAfterRender = function () {};
-
 }
 
 Object3D.DefaultUp = new Vector3( 0, 1, 0 );
@@ -105,6 +101,9 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 	isObject3D: true,
 
+	onBeforeRender: function () {},
+	onAfterRender: function () {},
+
 	applyMatrix: function ( matrix ) {
 
 		this.matrix.multiplyMatrices( matrix, this.matrix );