File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,32 @@ Editor.prototype = {
396396
397397 helper = new THREE . PointLightHelper ( object , 1 ) ;
398398
399+ helper . matrix = new THREE . Matrix4 ( ) ;
400+ helper . matrixAutoUpdate = true ;
401+
402+ const light = object ;
403+ const editor = this ;
404+
405+ helper . updateMatrixWorld = function ( ) {
406+
407+ light . getWorldPosition ( this . position ) ;
408+
409+ const distance = editor . viewportCamera . position . distanceTo ( this . position ) ;
410+ this . scale . setScalar ( distance / 30 ) ;
411+
412+ this . updateMatrix ( ) ;
413+ this . matrixWorld . copy ( this . matrix ) ;
414+
415+ const children = this . children ;
416+
417+ for ( let i = 0 , l = children . length ; i < l ; i ++ ) {
418+
419+ children [ i ] . updateMatrixWorld ( ) ;
420+
421+ }
422+
423+ } ;
424+
399425 } else if ( object . isDirectionalLight ) {
400426
401427 helper = new THREE . DirectionalLightHelper ( object , 1 ) ;
You can’t perform that action at this time.
0 commit comments