提交 5c1cc3dc 编写于 作者: 0 06wj

GLTFLoader: add KHR_lights_punctual range support

上级 901eb1cc
......@@ -288,6 +288,11 @@ THREE.GLTFLoader = ( function () {
color.fromArray( light.color )
}
var range = 0;
if ( light.range !== undefined ) {
range = light.range;
}
switch ( light.type ) {
case 'directional':
......@@ -298,10 +303,12 @@ THREE.GLTFLoader = ( function () {
case 'point':
lightNode = new THREE.PointLight( color );
lightNode.distance = range;
break;
case 'spot':
lightNode = new THREE.SpotLight( color );
lightNode.distance = range;
// Handle spotlight properties.
light.spot = light.spot || {};
light.spot.innerConeAngle = light.spot.innerConeAngle !== undefined ? light.spot.innerConeAngle : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册