|
@@ -3,13 +3,14 @@
|
|
|
* @author alteredq / http://alteredqualia.com/
|
|
|
*/
|
|
|
|
|
|
-THREE.Light = function ( color ) {
|
|
|
+THREE.Light = function ( color, intensity ) {
|
|
|
|
|
|
THREE.Object3D.call( this );
|
|
|
|
|
|
this.type = 'Light';
|
|
|
|
|
|
this.color = new THREE.Color( color );
|
|
|
+ this.intensity = intensity !== undefined ? intensity : 1;
|
|
|
|
|
|
this.receiveShadow = undefined;
|
|
|
|
|
@@ -23,6 +24,7 @@ THREE.Light.prototype.copy = function ( source ) {
|
|
|
THREE.Object3D.prototype.copy.call( this, source );
|
|
|
|
|
|
this.color.copy( source.color );
|
|
|
+ this.intensity = source.intensity;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -33,9 +35,10 @@ THREE.Light.prototype.toJSON = function ( meta ) {
|
|
|
var data = THREE.Object3D.prototype.toJSON.call( this, meta );
|
|
|
|
|
|
data.object.color = this.color.getHex();
|
|
|
+ data.object.intensity = this.intensity;
|
|
|
+
|
|
|
if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();
|
|
|
|
|
|
- if ( this.intensity !== undefined ) data.object.intensity = this.intensity;
|
|
|
if ( this.distance !== undefined ) data.object.distance = this.distance;
|
|
|
if ( this.angle !== undefined ) data.object.angle = this.angle;
|
|
|
if ( this.decay !== undefined ) data.object.decay = this.decay;
|