Skip to content

Commit 3ceb4d3

Browse files
authored
Merge pull request #11236 from Mugen87/helper
RectAreaLightHelper: Removed unused variables
2 parents 1558bf0 + eab640f commit 3ceb4d3

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

src/helpers/RectAreaLightHelper.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,37 +45,30 @@ RectAreaLightHelper.prototype.dispose = function () {
4545

4646
RectAreaLightHelper.prototype.update = function () {
4747

48-
var vector1 = new Vector3();
49-
var vector2 = new Vector3();
48+
var line = this.children[ 0 ];
5049

51-
return function update() {
50+
// update material
5251

53-
var line = this.children[ 0 ];
52+
line.material.color.copy( this.light.color );
5453

55-
// update material
54+
// calculate new dimensions of the helper
5655

57-
line.material.color.copy( this.light.color );
56+
var hx = this.light.width * 0.5;
57+
var hy = this.light.height * 0.5;
5858

59-
// calculate new dimensions of the helper
59+
var position = line.geometry.attributes.position;
60+
var array = position.array;
6061

61-
var hx = this.light.width * 0.5;
62-
var hy = this.light.height * 0.5;
62+
// update vertices
6363

64-
var position = line.geometry.attributes.position;
65-
var array = position.array;
64+
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
65+
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
66+
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
67+
array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0;
68+
array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0;
6669

67-
// update vertices
70+
position.needsUpdate = true;
6871

69-
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
70-
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
71-
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
72-
array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0;
73-
array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0;
74-
75-
position.needsUpdate = true;
76-
77-
};
78-
79-
}();
72+
};
8073

8174
export { RectAreaLightHelper };

0 commit comments

Comments
 (0)