22var registerComponent = require ( '../core/component' ) . registerComponent ;
33var THREE = require ( '../lib/three' ) ;
44var utils = require ( '../utils/' ) ;
5- var bind = utils . bind ;
65
76// To avoid recalculation at every mouse movement tick
87var PI_2 = Math . PI / 2 ;
@@ -118,16 +117,16 @@ module.exports.Component = registerComponent('look-controls', {
118117 } ,
119118
120119 bindMethods : function ( ) {
121- this . onMouseDown = bind ( this . onMouseDown , this ) ;
122- this . onMouseMove = bind ( this . onMouseMove , this ) ;
123- this . onMouseUp = bind ( this . onMouseUp , this ) ;
124- this . onTouchStart = bind ( this . onTouchStart , this ) ;
125- this . onTouchMove = bind ( this . onTouchMove , this ) ;
126- this . onTouchEnd = bind ( this . onTouchEnd , this ) ;
127- this . onEnterVR = bind ( this . onEnterVR , this ) ;
128- this . onExitVR = bind ( this . onExitVR , this ) ;
129- this . onPointerLockChange = bind ( this . onPointerLockChange , this ) ;
130- this . onPointerLockError = bind ( this . onPointerLockError , this ) ;
120+ this . onMouseDown = this . onMouseDown . bind ( this ) ;
121+ this . onMouseMove = this . onMouseMove . bind ( this ) ;
122+ this . onMouseUp = this . onMouseUp . bind ( this ) ;
123+ this . onTouchStart = this . onTouchStart . bind ( this ) ;
124+ this . onTouchMove = this . onTouchMove . bind ( this ) ;
125+ this . onTouchEnd = this . onTouchEnd . bind ( this ) ;
126+ this . onEnterVR = this . onEnterVR . bind ( this ) ;
127+ this . onExitVR = this . onExitVR . bind ( this ) ;
128+ this . onPointerLockChange = this . onPointerLockChange . bind ( this ) ;
129+ this . onPointerLockError = this . onPointerLockError . bind ( this ) ;
131130 } ,
132131
133132 /**
@@ -150,7 +149,7 @@ module.exports.Component = registerComponent('look-controls', {
150149
151150 // Wait for canvas to load.
152151 if ( ! canvasEl ) {
153- sceneEl . addEventListener ( 'render-target-loaded' , bind ( this . addEventListeners , this ) ) ;
152+ sceneEl . addEventListener ( 'render-target-loaded' , this . addEventListeners . bind ( this ) ) ;
154153 return ;
155154 }
156155
0 commit comments