2
0
Temdog007 6 жил өмнө
parent
commit
97c9defb42

+ 8 - 6
editor/js/Menubar.Add.js

@@ -391,15 +391,17 @@ Menubar.Add = function ( editor ) {
 	// OrthographicCamera
 	// OrthographicCamera
 
 
 	var option = new UI.Row();
 	var option = new UI.Row();
-	option.setClass('option');
-	option.setTextContent(strings.getKey('menubar/add/orthographiccamera'));
-	option.onClick(function(){
+	option.setClass( 'option' );
+	option.setTextContent( strings.getKey( 'menubar/add/orthographiccamera' ) );
+	option.onClick( function () {
+
 		var camera = new THREE.OrthographicCamera();
 		var camera = new THREE.OrthographicCamera();
 		camera.name = 'OrthographicCamera';
 		camera.name = 'OrthographicCamera';
 
 
-		editor.execute(new AddObjectCommand(camera));
-	});
-	options.add(option);
+		editor.execute( new AddObjectCommand( camera ) );
+
+	} );
+	options.add( option );
 
 
 	return container;
 	return container;
 
 

+ 32 - 27
editor/js/Sidebar.Object.js

@@ -149,42 +149,42 @@ Sidebar.Object = function ( editor ) {
 	// left
 	// left
 
 
 	var objectLeftRow = new UI.Row();
 	var objectLeftRow = new UI.Row();
-	var objectLeft = new UI.Number().onChange(update);
+	var objectLeft = new UI.Number().onChange( update );
 
 
-	objectLeftRow.add(new UI.Text(strings.getKey('sidebar/object/left')).setWidth('90px'));
-	objectLeftRow.add(objectLeft);
+	objectLeftRow.add( new UI.Text( strings.getKey( 'sidebar/object/left' ) ).setWidth( '90px' ) );
+	objectLeftRow.add( objectLeft );
 
 
-	container.add(objectLeftRow);
+	container.add( objectLeftRow );
 
 
 	// right
 	// right
-	
+
 	var objectRightRow = new UI.Row();
 	var objectRightRow = new UI.Row();
-	var objectRight = new UI.Number().onChange(update);
+	var objectRight = new UI.Number().onChange( update );
 
 
-	objectRightRow.add(new UI.Text(strings.getKey('sidebar/object/right')).setWidth('90px'));
-	objectRightRow.add(objectRight);
+	objectRightRow.add( new UI.Text( strings.getKey( 'sidebar/object/right' ) ).setWidth( '90px' ) );
+	objectRightRow.add( objectRight );
 
 
-	container.add(objectRightRow);
+	container.add( objectRightRow );
 
 
 	// top
 	// top
-	
+
 	var objectTopRow = new UI.Row();
 	var objectTopRow = new UI.Row();
-	var objectTop = new UI.Number().onChange(update);
+	var objectTop = new UI.Number().onChange( update );
 
 
-	objectTopRow.add(new UI.Text(strings.getKey('sidebar/object/top')).setWidth('90px'));
-	objectTopRow.add(objectTop);
+	objectTopRow.add( new UI.Text( strings.getKey( 'sidebar/object/top' ) ).setWidth( '90px' ) );
+	objectTopRow.add( objectTop );
 
 
-	container.add(objectTopRow);
+	container.add( objectTopRow );
 
 
 	// bottom
 	// bottom
-	
+
 	var objectBottomRow = new UI.Row();
 	var objectBottomRow = new UI.Row();
-	var objectBottom = new UI.Number().onChange(update);
+	var objectBottom = new UI.Number().onChange( update );
 
 
-	objectBottomRow.add(new UI.Text(strings.getKey('sidebar/object/bottom')).setWidth('90px'));
-	objectBottomRow.add(objectBottom);
+	objectBottomRow.add( new UI.Text( strings.getKey( 'sidebar/object/bottom' ) ).setWidth( '90px' ) );
+	objectBottomRow.add( objectBottom );
 
 
-	container.add(objectBottomRow);
+	container.add( objectBottomRow );
 
 
 	// near
 	// near
 
 
@@ -471,8 +471,10 @@ Sidebar.Object = function ( editor ) {
 			if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) {
 			if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) {
 
 
 				editor.execute( new SetValueCommand( object, 'near', objectNear.getValue() ) );
 				editor.execute( new SetValueCommand( object, 'near', objectNear.getValue() ) );
-				if(object.isOrthographicCamera){
+				if ( object.isOrthographicCamera ) {
+
 					object.updateProjectionMatrix();
 					object.updateProjectionMatrix();
+
 				}
 				}
 
 
 			}
 			}
@@ -480,9 +482,12 @@ Sidebar.Object = function ( editor ) {
 			if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) {
 			if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) {
 
 
 				editor.execute( new SetValueCommand( object, 'far', objectFar.getValue() ) );
 				editor.execute( new SetValueCommand( object, 'far', objectFar.getValue() ) );
-				if(object.isOrthographicCamera){
+				if ( object.isOrthographicCamera ) {
+
 					object.updateProjectionMatrix();
 					object.updateProjectionMatrix();
+
 				}
 				}
+
 			}
 			}
 
 
 			if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) {
 			if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) {
@@ -600,12 +605,12 @@ Sidebar.Object = function ( editor ) {
 			'intensity': objectIntensityRow,
 			'intensity': objectIntensityRow,
 			'color': objectColorRow,
 			'color': objectColorRow,
 			'groundColor': objectGroundColorRow,
 			'groundColor': objectGroundColorRow,
-			'distance' : objectDistanceRow,
-			'angle' : objectAngleRow,
-			'penumbra' : objectPenumbraRow,
-			'decay' : objectDecayRow,
-			'castShadow' : objectShadowRow,
-			'receiveShadow' : objectReceiveShadow,
+			'distance': objectDistanceRow,
+			'angle': objectAngleRow,
+			'penumbra': objectPenumbraRow,
+			'decay': objectDecayRow,
+			'castShadow': objectShadowRow,
+			'receiveShadow': objectReceiveShadow,
 			'shadow': objectShadowRadius
 			'shadow': objectShadowRadius
 		};
 		};
 
 

+ 6 - 3
editor/js/Viewport.js

@@ -503,12 +503,15 @@ var Viewport = function ( editor ) {
 
 
 	signals.viewportCameraChanged.add( function ( viewportCamera ) {
 	signals.viewportCameraChanged.add( function ( viewportCamera ) {
 
 
-		if(viewportCamera.isPerspectiveCamera) {
+		if ( viewportCamera.isPerspectiveCamera ) {
+
 			viewportCamera.aspect = editor.camera.aspect;
 			viewportCamera.aspect = editor.camera.aspect;
 			viewportCamera.projectionMatrix.copy( editor.camera.projectionMatrix );
 			viewportCamera.projectionMatrix.copy( editor.camera.projectionMatrix );
-		}
-		else if(!viewportCamera.isOrthographicCamera){
+
+		} else if ( ! viewportCamera.isOrthographicCamera ) {
+
 			throw "Invalid camera set as viewport";
 			throw "Invalid camera set as viewport";
+
 		}
 		}
 
 
 		camera = viewportCamera;
 		camera = viewportCamera;