Skip to content

Commit 32889ea

Browse files
committed
don't bind render on each tick
1 parent 8d6bdff commit 32889ea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/core/scene/a-scene.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ module.exports = registerElement('a-scene', {
4545

4646
createdCallback: {
4747
value: function () {
48-
this.isMobile = isMobile;
48+
this.init();
4949
this.isIOS = isIOS;
50+
this.isMobile = isMobile;
5051
this.isScene = true;
5152
this.object3D = new THREE.Scene();
53+
this.renderBinded = this.render.bind(this);
5254
this.systems = {};
5355
this.time = 0;
54-
this.init();
5556
}
5657
},
5758

@@ -404,7 +405,7 @@ module.exports = registerElement('a-scene', {
404405
this.effect.render(this.object3D, this.camera);
405406

406407
this.time = time;
407-
this.animationFrameID = window.requestAnimationFrame(this.render.bind(this));
408+
this.animationFrameID = window.requestAnimationFrame(this.renderBinded);
408409
},
409410
writable: window.debug
410411
}

0 commit comments

Comments
 (0)