Ver código fonte

Editor: Expose BoundingSphere radius.

Mr.doob 7 anos atrás
pai
commit
cbdaa9fad1
1 arquivos alterados com 11 adições e 3 exclusões
  1. 11 3
      editor/js/Sidebar.Geometry.js

+ 11 - 3
editor/js/Sidebar.Geometry.js

@@ -125,6 +125,11 @@ Sidebar.Geometry = function ( editor ) {
 
 	container.add( geometryNameRow );
 
+	// parameters
+
+	var parameters = new UI.Span();
+	container.add( parameters );
+
 	// geometry
 
 	container.add( new Sidebar.Geometry.Geometry( editor ) );
@@ -133,11 +138,12 @@ Sidebar.Geometry = function ( editor ) {
 
 	container.add( new Sidebar.Geometry.BufferGeometry( editor ) );
 
-	// parameters
+	// size
 
-	var parameters = new UI.Span();
-	container.add( parameters );
+	var geometryBoundingSphere = new UI.Text();
 
+	container.add( new UI.Text( 'Bounds' ).setWidth( '90px' ) );
+	container.add( geometryBoundingSphere );
 
 	//
 
@@ -170,6 +176,8 @@ Sidebar.Geometry = function ( editor ) {
 
 			}
 
+			geometryBoundingSphere.setValue( Math.floor( geometry.boundingSphere.radius * 1000 ) / 1000 );
+
 		} else {
 
 			container.setDisplay( 'none' );