Skip to content

Commit

Permalink
Check value equality in setters
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jan 11, 2019
1 parent 9b161e2 commit 812d923
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,10 @@ define([
Check.typeOf.number.greaterThanOrEquals('imageBasedLightingFactor.y', value.y, 0.0);
Check.typeOf.number.lessThanOrEquals('imageBasedLightingFactor.y', value.y, 1.0);
//>>includeEnd('debug');
var imageBasedLightingFactor = this._imageBasedLightingFactor;
if ((value === imageBasedLightingFactor) || Cartesian2.equals(value, imageBasedLightingFactor)) {
return;
}
this._shouldRegenerateShaders = this._shouldRegenerateShaders || (this._imageBasedLightingFactor.x > 0.0 && value.x === 0.0) || (this._imageBasedLightingFactor.x === 0.0 && value.x > 0.0);
this._shouldRegenerateShaders = this._shouldRegenerateShaders || (this._imageBasedLightingFactor.y > 0.0 && value.y === 0.0) || (this._imageBasedLightingFactor.y === 0.0 && value.y > 0.0);
Cartesian2.clone(value, this._imageBasedLightingFactor);
Expand Down Expand Up @@ -1212,6 +1216,9 @@ define([
throw new DeveloperError('sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.');
}
//>>includeEnd('debug');
if (value === this._sphericalHarmonicCoefficients) {
return;
}
this._sphericalHarmonicCoefficients = value;
this._shouldRegenerateShaders = true;
}
Expand Down

0 comments on commit 812d923

Please sign in to comment.