瀏覽代碼

Editor: Menubar.Add/Object3D

Mr.doob 11 年之前
父節點
當前提交
9ef7f48579
共有 1 個文件被更改,包括 20 次插入2 次删除
  1. 20 2
      editor/js/Menubar.Add.js

+ 20 - 2
editor/js/Menubar.Add.js

@@ -18,6 +18,26 @@ Menubar.Add = function ( editor ) {
 	var meshCount = 0;
 	var lightCount = 0;
 
+	// add object
+
+	var option = new UI.Panel();
+	option.setClass( 'option' );
+	option.setTextContent( 'Object3D' );
+	option.onClick( function () {
+
+		var mesh = new THREE.Object3D();
+		mesh.name = 'Object3D ' + ( ++ meshCount );
+
+		editor.addObject( mesh );
+		editor.select( mesh );
+
+	} );
+	options.add( option );
+
+	// divider
+
+	options.add( new UI.HorizontalRule() );
+
 	// add plane
 
 	var option = new UI.Panel();
@@ -36,8 +56,6 @@ Menubar.Add = function ( editor ) {
 		var mesh = new THREE.Mesh( geometry, material );
 		mesh.name = 'Plane ' + ( ++ meshCount );
 
-		mesh.rotation.x = - Math.PI/2;
-
 		editor.addObject( mesh );
 		editor.select( mesh );