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

Cleanup Particle and Particle System for the 1.46 Release #6510

Merged
merged 6 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Change Log
### 1.46 - 2018-06-01

##### Breaking Changes :mega:
* `ParticleSystem` no longer uses `forces`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510)
* `Particle` no longer uses `size`, `rate`, `lifeTime`, `life`, `minimumLife`, `maximumLife`, `minimumWidth`, `minimumHeight`, `maximumWidth`, and `maximumHeight`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510)
* Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393)
* The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.TERRAIN`. If you wish the geometry to color both terrain and 3D tiles, pass in the option `classificationType: Cesium.ClassificationType.BOTH`.

Expand Down
43 changes: 5 additions & 38 deletions Source/Scene/Particle.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
define([
'../Core/Cartesian2',
'../Core/Cartesian3',
'../Core/Check',
'../Core/Color',
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning'
'../Core/defineProperties'
], function(
Cartesian2,
Cartesian3,
Check,
Color,
defaultValue,
defined,
defineProperties,
deprecationWarning) {
defineProperties) {
'use strict';

var defaultSize = new Cartesian2(1.0, 1.0);
Expand All @@ -34,7 +34,6 @@ define([
* @param {Color} [options.endColor=Color.WHITE] The color of a particle when it dies.
* @param {Number} [options.startScale=1.0] The scale of the particle when it is born.
* @param {Number} [options.endScale=1.0] The scale of the particle when it dies.
* @param {Cartesian2} [options.size=new Cartesian2(1.0, 1.0)] The dimensions of particles in pixels. This has been deprecated. Use imageSize instead.
* @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] The dimensions, width by height, to scale the particle image in pixels.
*/
function Particle(options) {
Expand Down Expand Up @@ -100,10 +99,6 @@ define([
* @default new Cartesian(1.0, 1.0)
*/
this.imageSize = Cartesian2.clone(defaultValue(options.imageSize, defaultSize));
if (defined(options.size)) {
deprecationWarning('size', 'size was deprecated in Cesium 1.45. It will be removed in 1.46. Use imageSize instead.');
this.imageSize = Cartesian2.clone(defaultValue(options.size, defaultSize));
}

this._age = 0.0;
this._normalizedAge = 0.0;
Expand Down Expand Up @@ -132,23 +127,6 @@ define([
get : function() {
return this._normalizedAge;
}
},
/**
* The dimensions of the particle in pixels. This has been deprecated. Use {@link Particle#imageSize} instead.
* @memberof Particle.prototype
* @type {Cartesian2}
* @default new Cartesian(1.0, 1.0)
* @deprecated
*/
size : {
get : function() {
deprecationWarning('size', 'size was deprecated in Cesium 1.45. It will be removed in 1.46. Use imageSize instead.');
return this.imageSize;
},
set : function(value) {
deprecationWarning('size', 'size was deprecated in Cesium 1.45. It will be removed in 1.46. Use imageSize instead.');
this.imageSize = value;
}
}
});

Expand All @@ -164,18 +142,7 @@ define([

// Update any forces.
if (defined(particleUpdateFunction)) {
if (typeof particleUpdateFunction === 'function') {
particleUpdateFunction(this, dt);
} else if (particleUpdateFunction instanceof Array) {
var length = particleUpdateFunction.length;
for (var i = 0; i < length; ++i) {
var force = particleUpdateFunction[i];
if (typeof force === 'function') {
// Force is just a simple callback function.
force(this, dt);
}
}
}
particleUpdateFunction(this, dt);
}

// Age the particle
Expand Down
Loading