Ver Fonte

Change screenSpacePanning default value

WestLangley há 5 anos atrás
pai
commit
dcc6abe55f

+ 2 - 1
docs/examples/en/controls/OrbitControls.html

@@ -236,7 +236,8 @@ controls.mouseButtons = {
 		<h3>[property:Boolean screenSpacePanning]</h3>
 		<p>
 		Defines how the camera's position is translated when panning. If true, the camera pans in screen space.
-		Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is false.
+		Otherwise, the camera pans in the plane orthogonal to the camera's up direction.
+		Default is true for OrbitControls; false for MapControls.
 		</p>
 
 		<h3>[property:Vector3 target0]</h3>

+ 4 - 1
docs/examples/zh/controls/OrbitControls.html

@@ -234,7 +234,10 @@ controls.mouseButtons = {
 		<h3>[property:Boolean screenSpacePanning]</h3>
 		<p>
 			定义当平移的时候摄像机的位置将如何移动。如果为true,摄像机将在屏幕空间内平移。
-			否则,摄像机将在与摄像机向上方向垂直的平面中平移。其默认值为false。
+			否则,摄像机将在与摄像机向上方向垂直的平面中平移。
+			Defines how the camera's position is translated when panning. If true, the camera pans in screen space.
+			Otherwise, the camera pans in the plane orthogonal to the camera's up direction.
+			Default is true for OrbitControls; false for MapControls.
 		</p>
 
 		<h3>[property:Vector3 target0]</h3>

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

@@ -64,7 +64,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 	// Set to false to disable panning
 	this.enablePan = true;
 	this.panSpeed = 1.0;
-	this.screenSpacePanning = false; // if true, pan in screen-space
+	this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
 	this.keyPanSpeed = 7.0;	// pixels moved per arrow key push
 
 	// Set to true to automatically rotate around the target
@@ -1139,6 +1139,8 @@ THREE.MapControls = function ( object, domElement ) {
 
 	THREE.OrbitControls.call( this, object, domElement );
 
+	this.screenSpacePanning = false; // pan orthogonal to world-space direction camera.up
+
 	this.mouseButtons.LEFT = THREE.MOUSE.PAN;
 	this.mouseButtons.RIGHT = THREE.MOUSE.ROTATE;
 

+ 3 - 1
examples/jsm/controls/OrbitControls.js

@@ -73,7 +73,7 @@ var OrbitControls = function ( object, domElement ) {
 	// Set to false to disable panning
 	this.enablePan = true;
 	this.panSpeed = 1.0;
-	this.screenSpacePanning = false; // if true, pan in screen-space
+	this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
 	this.keyPanSpeed = 7.0;	// pixels moved per arrow key push
 
 	// Set to true to automatically rotate around the target
@@ -1148,6 +1148,8 @@ var MapControls = function ( object, domElement ) {
 
 	OrbitControls.call( this, object, domElement );
 
+	this.screenSpacePanning = false; // pan orthogonal to world-space direction camera.up
+
 	this.mouseButtons.LEFT = MOUSE.PAN;
 	this.mouseButtons.RIGHT = MOUSE.ROTATE;