Skip to content

Commit 9cb679b

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

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

4646
createdCallback: {
4747
value: function () {
48-
this.isMobile = isMobile;
4948
this.isIOS = isIOS;
49+
this.isMobile = isMobile;
5050
this.isScene = true;
5151
this.object3D = new THREE.Scene();
52+
this.renderBinded = this.render.bind(this);
5253
this.systems = {};
5354
this.time = 0;
55+
5456
this.init();
5557
}
5658
},
@@ -404,7 +406,7 @@ module.exports = registerElement('a-scene', {
404406
this.effect.render(this.object3D, this.camera);
405407

406408
this.time = time;
407-
this.animationFrameID = window.requestAnimationFrame(this.render.bind(this));
409+
this.animationFrameID = window.requestAnimationFrame(this.renderBinded);
408410
},
409411
writable: window.debug
410412
}

0 commit comments

Comments
 (0)