Browse Source

OrbitControls: Added warning about target now being immutable.

Mr.doob 10 years ago
parent
commit
dc9cfc5240

+ 7 - 0
examples/js/controls/OrbitControls.js

@@ -782,6 +782,13 @@
 
 				return this.constraint.target;
 
+			},
+
+			set: function ( value ) {
+
+				console.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );
+				this.constraint.target.copy( value );
+
 			}
 
 		},

+ 1 - 1
examples/webgl_animation_skinning_blending.html

@@ -209,7 +209,7 @@
 				camera.position.set( 0.0, radius, radius * 3.5 );
 
 				controls = new THREE.OrbitControls( camera );
-				controls.target = new THREE.Vector3( 0, radius, 0 );
+				controls.target.set( 0, radius, 0 );
 				controls.update();
 
 				// Set default weights