Skip to content

Commit 6988d98

Browse files
committed
SpotLightHelper clean up.
1 parent aa0f1fd commit 6988d98

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/extras/helpers/SpotLightHelper.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,23 @@ THREE.SpotLightHelper = function ( light ) {
1616

1717
var geometry = new THREE.BufferGeometry();
1818

19-
var positions = [];
20-
21-
positions.push(
19+
var positions = [
2220
0, 0, 0, 0, 0, 1,
2321
0, 0, 0, 1, 0, 1,
2422
0, 0, 0, - 1, 0, 1,
2523
0, 0, 0, 0, 1, 1,
2624
0, 0, 0, 0, - 1, 1
27-
);
28-
29-
var length = 32;
25+
];
3026

31-
for ( var i = 0; i < length; i ++ ) {
27+
for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {
3228

33-
var p1 = ( i / length ) * Math.PI * 2;
34-
var p2 = ( ( i + 1 ) / length ) * Math.PI * 2;
29+
var p1 = ( i / l ) * Math.PI * 2;
30+
var p2 = ( j / l ) * Math.PI * 2;
3531

36-
positions.push( Math.cos( p1 ), Math.sin( p1 ), 1 );
37-
positions.push( Math.cos( p2 ), Math.sin( p2 ), 1 );
32+
positions.push(
33+
Math.cos( p1 ), Math.sin( p1 ), 1,
34+
Math.cos( p2 ), Math.sin( p2 ), 1
35+
);
3836

3937
}
4038

0 commit comments

Comments
 (0)