浏览代码

Editor: added handling of AmbientLight.

alteredq 12 年之前
父节点
当前提交
0779f7e782
共有 3 个文件被更改,包括 7 次插入0 次删除
  1. 1 0
      editor/js/ui/Sidebar.Object3D.js
  2. 1 0
      editor/js/ui/Sidebar.Scene.js
  3. 5 0
      editor/js/ui/Viewport.js

+ 1 - 0
editor/js/ui/Sidebar.Object3D.js

@@ -3,6 +3,7 @@ Sidebar.Object3D = function ( signals ) {
 	var objects = {
 
 		'PerspectiveCamera': THREE.PerspectiveCamera,
+		'AmbientLight': THREE.AmbientLight,
 		'PointLight': THREE.PointLight,
 		'DirectionalLight': THREE.DirectionalLight,
 		'Mesh': THREE.Mesh,

+ 1 - 0
editor/js/ui/Sidebar.Scene.js

@@ -3,6 +3,7 @@ Sidebar.Scene = function ( signals ) {
 	var objectTypes = {
 
 		'PerspectiveCamera': THREE.PerspectiveCamera,
+		'AmbientLight': THREE.AmbientLight,
 		'PointLight': THREE.PointLight,
 		'DirectionalLight': THREE.DirectionalLight,
 		'Mesh': THREE.Mesh,

+ 5 - 0
editor/js/ui/Viewport.js

@@ -68,6 +68,8 @@ var Viewport = function ( signals ) {
 	var light3 = new THREE.PointLight( 0xffaa00, 0.75 );
 	light3.position.set( 0, -200, 0 );
 
+	var light4 = new THREE.AmbientLight( 0x111111 );
+
 	// fog
 
 	var oldFogType = "None";
@@ -88,6 +90,8 @@ var Viewport = function ( signals ) {
 
 	light3.name = "Light 3";
 
+	light4.name = "Light 4";
+
 	// active objects
 
 	camera.properties.active = true;
@@ -754,6 +758,7 @@ var Viewport = function ( signals ) {
 	signals.objectAdded.dispatch( light1 );
 	signals.objectAdded.dispatch( light2 );
 	signals.objectAdded.dispatch( light3 );
+	signals.objectAdded.dispatch( light4 );
 
 	//