提交 b66d8b01 编写于 作者: M Mr.doob

SceneLoader: Rescued lost DirectionalLight handler.

上级 16ffe247
......@@ -361,7 +361,9 @@ THREE.SceneLoader.prototype = {
// lights
} else if (objJSON.type === "PointLight" || objJSON.type === "AmbientLight" || objJSON.type === "SpotLight" || objJSON.type === "HemisphereLight" || objJSON.type === "AreaLight") {
} else if ( objJSON.type === "AmbientLight" || objJSON.type === "PointLight" ||
objJSON.type === "DirectionalLight" || objJSON.type === "SpotLight" ||
objJSON.type === "HemisphereLight" || objJSON.type === "AreaLight" ) {
var color = objJSON.color;
var intensity = objJSON.intensity;
......@@ -380,6 +382,11 @@ THREE.SceneLoader.prototype = {
light.position.fromArray( position );
break;
case 'DirectionalLight':
light = new THREE.DirectionalLight( color, intensity );
light.position.fromArray( objJSON.direction );
break;
case 'SpotLight':
light = new THREE.SpotLight( color, intensity, distance, 1 );
light.angle = objJSON.angle;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册