@@ -254,7 +254,7 @@ class Light {
254254
255255 this . _position = new Vec3 ( 0 , 0 , 0 ) ;
256256 this . _direction = new Vec3 ( 0 , 0 , 0 ) ;
257- this . _innerConeAngleCos = Math . cos ( this . _innerConeAngle * Math . PI / 180 ) ;
257+ this . _innerConeAngleCos = Math . cos ( this . _innerConeAngle * math . DEG_TO_RAD ) ;
258258 this . _updateOuterAngle ( this . _outerConeAngle ) ;
259259
260260 this . _usePhysicalUnits = undefined ;
@@ -630,7 +630,7 @@ class Light {
630630 }
631631
632632 this . _innerConeAngle = value ;
633- this . _innerConeAngleCos = Math . cos ( value * Math . PI / 180 ) ;
633+ this . _innerConeAngleCos = Math . cos ( value * math . DEG_TO_RAD ) ;
634634 this . updateClusterData ( false , true ) ;
635635
636636 if ( this . _usePhysicalUnits ) {
@@ -677,7 +677,7 @@ class Light {
677677 }
678678
679679 _updateOuterAngle ( angle ) {
680- const radAngle = angle * Math . PI / 180 ;
680+ const radAngle = angle * math . DEG_TO_RAD ;
681681 this . _outerConeAngleCos = Math . cos ( radAngle ) ;
682682 this . _outerConeAngleSin = Math . sin ( radAngle ) ;
683683 this . updateClusterData ( false , true ) ;
@@ -1205,13 +1205,13 @@ class Light {
12051205
12061206 // Shrink angles slightly (~1%) to prevent light leaking outside shadow boundaries
12071207 const angleShrinkFactor = 0.99 ;
1208- let innerCos = Math . cos ( this . _innerConeAngle * angleShrinkFactor * Math . PI / 180 ) ;
1208+ let innerCos = Math . cos ( this . _innerConeAngle * angleShrinkFactor * math . DEG_TO_RAD ) ;
12091209 if ( innerCos > cosThreshold ) {
12101210 innerCos = 1.0 - innerCos ;
12111211 flags |= 1 ; // Use bit 0 for inner angle: 1 = versine, 0 = cosine
12121212 }
12131213
1214- let outerCos = Math . cos ( this . _outerConeAngle * angleShrinkFactor * Math . PI / 180 ) ;
1214+ let outerCos = Math . cos ( this . _outerConeAngle * angleShrinkFactor * math . DEG_TO_RAD ) ;
12151215 if ( outerCos > cosThreshold ) {
12161216 outerCos = 1.0 - outerCos ;
12171217 flags |= 2 ; // Use bit 1 for outer angle: 1 = versine, 0 = cosine
0 commit comments