Browse Source

Implemented @WestLangley fix from #3582.

Mr.doob 12 years ago
parent
commit
40b18a6be6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/js/controls/TrackballControls.js

+ 2 - 2
examples/js/controls/TrackballControls.js

@@ -244,9 +244,9 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 		if ( !_this.noZoom || !_this.noPan ) {
 
-			if ( _this.object.position.lengthSq() > _this.maxDistance * _this.maxDistance ) {
+			if ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) {
 
-				_this.object.position.setLength( _this.maxDistance );
+				_this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) );
 
 			}