Skip to content

Commit b0fab49

Browse files
author
Hannah
authored
Merge pull request #6510 from hanbollar/cleanup-particle-particleSystem
Cleanup Particle and Particle System for the 1.46 Release
2 parents a32d774 + 87a1fcd commit b0fab49

File tree

4 files changed

+9
-316
lines changed

4 files changed

+9
-316
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Change Log
44
### 1.46 - 2018-06-01
55

66
##### Breaking Changes :mega:
7+
* `ParticleSystem` no longer uses `forces`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510)
8+
* `Particle` no longer uses `size`, `rate`, `lifeTime`, `life`, `minimumLife`, `maximumLife`, `minimumWidth`, `minimumHeight`, `maximumWidth`, and `maximumHeight`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510)
79
* Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393)
810
* 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`.
911

Source/Scene/Particle.js

+5-38
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
define([
22
'../Core/Cartesian2',
33
'../Core/Cartesian3',
4+
'../Core/Check',
45
'../Core/Color',
56
'../Core/defaultValue',
67
'../Core/defined',
7-
'../Core/defineProperties',
8-
'../Core/deprecationWarning'
8+
'../Core/defineProperties'
99
], function(
1010
Cartesian2,
1111
Cartesian3,
12+
Check,
1213
Color,
1314
defaultValue,
1415
defined,
15-
defineProperties,
16-
deprecationWarning) {
16+
defineProperties) {
1717
'use strict';
1818

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

108103
this._age = 0.0;
109104
this._normalizedAge = 0.0;
@@ -132,23 +127,6 @@ define([
132127
get : function() {
133128
return this._normalizedAge;
134129
}
135-
},
136-
/**
137-
* The dimensions of the particle in pixels. This has been deprecated. Use {@link Particle#imageSize} instead.
138-
* @memberof Particle.prototype
139-
* @type {Cartesian2}
140-
* @default new Cartesian(1.0, 1.0)
141-
* @deprecated
142-
*/
143-
size : {
144-
get : function() {
145-
deprecationWarning('size', 'size was deprecated in Cesium 1.45. It will be removed in 1.46. Use imageSize instead.');
146-
return this.imageSize;
147-
},
148-
set : function(value) {
149-
deprecationWarning('size', 'size was deprecated in Cesium 1.45. It will be removed in 1.46. Use imageSize instead.');
150-
this.imageSize = value;
151-
}
152130
}
153131
});
154132

@@ -164,18 +142,7 @@ define([
164142

165143
// Update any forces.
166144
if (defined(particleUpdateFunction)) {
167-
if (typeof particleUpdateFunction === 'function') {
168-
particleUpdateFunction(this, dt);
169-
} else if (particleUpdateFunction instanceof Array) {
170-
var length = particleUpdateFunction.length;
171-
for (var i = 0; i < length; ++i) {
172-
var force = particleUpdateFunction[i];
173-
if (typeof force === 'function') {
174-
// Force is just a simple callback function.
175-
force(this, dt);
176-
}
177-
}
178-
}
145+
particleUpdateFunction(this, dt);
179146
}
180147

181148
// Age the particle

0 commit comments

Comments
 (0)