浏览代码

fix: remove string concat

oguz 6 年之前
父节点
当前提交
0ae4d897e5
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14 6
      src/renderers/webgl/WebGLRenderLists.js

+ 14 - 6
src/renderers/webgl/WebGLRenderLists.js

@@ -128,15 +128,23 @@ function WebGLRenderLists() {
 
 	function get( scene, camera ) {
 
-		var hash = scene.id + ',' + camera.id;
-		var list = lists[ hash ];
+		var cameras = lists[ scene.id ];
+		var list;
+		if ( cameras === undefined ) {
 
-		if ( list === undefined ) {
+			list = new WebGLRenderList();
+			lists[ scene.id ] = {};
+			lists[ scene.id ][ camera.id ] = list;
 
-			// console.log( 'THREE.WebGLRenderLists:', hash );
+		} else {
 
-			list = new WebGLRenderList();
-			lists[ hash ] = list;
+			list = cameras[ camera.id ];
+			if ( list === undefined ) {
+
+				list = new WebGLRenderList();
+				cameras[ camera.id ] = list;
+
+			}
 
 		}