Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RectAreaLightHelper: Removed unused variables #11236

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 16 additions & 23 deletions src/helpers/RectAreaLightHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,30 @@ RectAreaLightHelper.prototype.dispose = function () {

RectAreaLightHelper.prototype.update = function () {

var vector1 = new Vector3();
var vector2 = new Vector3();
var line = this.children[ 0 ];

return function update() {
// update material

var line = this.children[ 0 ];
line.material.color.copy( this.light.color );

// update material
// calculate new dimensions of the helper

line.material.color.copy( this.light.color );
var hx = this.light.width * 0.5;
var hy = this.light.height * 0.5;

// calculate new dimensions of the helper
var position = line.geometry.attributes.position;
var array = position.array;

var hx = this.light.width * 0.5;
var hy = this.light.height * 0.5;
// update vertices

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

// update vertices
position.needsUpdate = true;

array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0;
array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0;

position.needsUpdate = true;

};

}();
};

export { RectAreaLightHelper };