Skip to content

Commit 5b03561

Browse files
author
Samuel Rigaud
committed
GltfLoader: fix too generic assigment of light decay
1 parent 0fb4b68 commit 5b03561

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

examples/jsm/loaders/GLTFLoader.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,11 @@ class GLTFLightsExtension {
574574
break;
575575

576576
case 'point':
577-
lightNode = new PointLight( color );
578-
lightNode.distance = range;
577+
lightNode = new PointLight( color, 1, range, 2 );
579578
break;
580579

581580
case 'spot':
582-
lightNode = new SpotLight( color );
583-
lightNode.distance = range;
581+
lightNode = new SpotLight( color, 1, range, 2 );
584582
// Handle spotlight properties.
585583
lightDef.spot = lightDef.spot || {};
586584
lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0;
@@ -600,8 +598,6 @@ class GLTFLightsExtension {
600598
// here, because node-level parsing will only override position if explicitly specified.
601599
lightNode.position.set( 0, 0, 0 );
602600

603-
lightNode.decay = 2;
604-
605601
assignExtrasToUserData( lightNode, lightDef );
606602

607603
if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;
@@ -2855,7 +2851,7 @@ class GLTFParser {
28552851
* Requests the specified dependency asynchronously, with caching.
28562852
* @param {string} type
28572853
* @param {number} index
2858-
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
2854+
* @return {Promise<Object3D|Material|Texture|AnimationClip|ArrayBuffer|Object>}
28592855
*/
28602856
getDependency( type, index ) {
28612857

@@ -3185,7 +3181,7 @@ class GLTFParser {
31853181
/**
31863182
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
31873183
* @param {number} textureIndex
3188-
* @return {Promise<THREE.Texture|null>}
3184+
* @return {Promise<Texture|null>}
31893185
*/
31903186
loadTexture( textureIndex ) {
31913187

0 commit comments

Comments
 (0)