Explorar el Código

Added shadow support for imported JSON files

Previously, Three.JS would IGNORE imported castShadow and receiveShadow settings on objects. This setting is now corrected.
Brian Bosak hace 10 años
padre
commit
9460d15986
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/loaders/ObjectLoader.js

+ 2 - 1
src/loaders/ObjectLoader.js

@@ -530,7 +530,8 @@ THREE.ObjectLoader.prototype = {
 				}
 
 			}
-
+			if (data.castShadow !== undefined) object.castShadow = data.castShadow;
+			if (data.receiveShadow !== undefined) object.receiveShadow = data.receiveShadow;
 			return object;
 
 		}