the code below in TrackBallControls or OrthgraphicTrackBallControls may lead to endless rendering in some project. Is this a bug?
this.panCamera = ( function () {
var mouseChange = new THREE.Vector2(),
objectUp = new THREE.Vector3(),
pan = new THREE.Vector3();
return function panCamera() {
mouseChange.copy( _panEnd ).sub( _panStart );
// here, this value may never be zero. why not use a numerical small value? like:
// if( mouseChange.lengthSq() < 1e-9)
if ( mouseChange.lengthSq() ) {
// Scale movement to keep clicked/dragged position under cursor
var scale_x = ( _this.object.right - _this.object.left ) / _this.object.zoom;
var scale_y = ( _this.object.top - _this.object.bottom ) / _this.object.zoom;
mouseChange.x *= scale_x;
mouseChange.y *= scale_y;