瀏覽代碼

OrbitControls: Backwards compatibility for center.

Mr.doob 9 年之前
父節點
當前提交
48b018387b
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      examples/js/controls/OrbitControls.js

+ 11 - 1
examples/js/controls/OrbitControls.js

@@ -939,6 +939,17 @@ THREE.OrbitControls.prototype.constructor = THREE.OrbitControls;
 
 Object.defineProperties( THREE.OrbitControls.prototype, {
 
+	center: {
+
+		get: function () {
+
+			console.warn( 'THREE.OrbitControls: .center has been renamed to .target' );
+			return this.target;
+
+		}
+
+	},
+
 	// backward compatibility
 
 	noZoom: {
@@ -1050,4 +1061,3 @@ Object.defineProperties( THREE.OrbitControls.prototype, {
 	}
 
 } );
-