-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Particle Systems #5212
Particle Systems #5212
Changes from 1 commit
6103848
dccaaeb
b69ecc6
58c41ca
994fe50
1c07d77
0245f40
9644b85
eaf1cbd
8184286
adc2cc7
0d5b5b6
867c69c
2297924
1876ad6
4555cfb
1840d19
917c78a
80ad97a
fb4affd
7b475ac
a2ec79b
2f11ce0
ddb464f
f6baa2a
00406de
034a4f3
d165f45
2ecfa59
617c317
f64422f
d2959ba
64be343
fbc3ffc
6720615
98b1601
e52c608
de432ab
fc0493d
c2996a2
431ef2d
982fd09
4f5279b
72d8a5c
f34760f
64f782f
72bb6d7
2185bb4
4bd4cc4
54962e8
7a6b1d4
8de7a3b
ebc1427
c05f581
1a33efb
251bb1c
f76b890
e5e0998
dcacd47
a475545
3fc0e0b
c980b70
9821d5e
e372fa0
acd31e7
388f2d3
879e610
223ec9c
d16ab77
001d92c
2fb8637
ac6d4e0
5a46750
0a36b48
bbb128d
8a8626c
7e2a965
788d422
47c7a6d
76d6ccf
5b95fa2
f2b0a7b
319b9ce
de1dbcf
b49f8cd
ae54804
5be6977
d0d71b6
501abf5
8abd935
4789ff1
5fd4e4d
fda2fdb
b4806bb
4eeb893
e91de94
985498e
5d4d333
d37d322
def17e1
e3af3ea
b17adcf
08bd544
baddc32
ec341c6
cd4ffd8
41390b9
116d515
ce18cf8
f8de4ea
129772f
95fc96f
0e44fbd
70c191e
ec59d9f
2e5e510
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- workspaces
- pre-template-literals
- pre-prettier-v3
- pre-prettier
- pre-let-const
- post-workspaces
- post-template-literals
- post-prettier-v3
- post-prettier
- post-let-const
- cesium-workspaces
- 1.127
- 1.126
- 1.125
- 1.124
- 1.123.1
- 1.123
- 1.122
- 1.121.1
- 1.121
- 1.120
- 1.119
- 1.118.2
- 1.118.1
- 1.118
- 1.117
- 1.116
- 1.115
- 1.114
- 1.113
- 1.112
- 1.111
- 1.111-release
- 1.110.1
- 1.110
- 1.109
- 1.108
- 1.107.2
- 1.107.1
- 1.107
- 1.106.1
- 1.106
- 1.105.2
- 1.105.1
- 1.105
- 1.104
- 1.103
- 1.102
- 1.101
- 1.100
- 1.99
- 1.98.1
- 1.98
- 1.97
- 1.96
- 1.95
- 1.94.3
- 1.94.2
- 1.94.1
- 1.94
- 1.93
- 1.92
- 1.91
- 1.90
- 1.89
- 1.88
- 1.87.1
- 1.87
- 1.86.1
- 1.86
- 1.85
- 1.84
- 1.83
- 1.82
- 1.81
- 1.80
- 1.79.1
- 1.79
- 1.78
- 1.77
- 1.76
- 1.75
- 1.74
- 1.73
- 1.72
- 1.71
- 1.70.1
- 1.70
- 1.69
- 1.68
- 1.67
- 1.66
- 1.65
- 1.64
- 1.63.1
- 1.63
- 1.62
- 1.61
- 1.60
- 1.59
- 1.58.1
- 1.58
- 1.57
- 1.56.1
- 1.56
- 1.55
- 1.54
- 1.53
- 1.52
- 1.51
- 1.50
- 1.49
- 1.48
- 1.47
- 1.46
- 1.45
- 1.44
- 1.43
- 1.42.1
- 1.42
- 1.41
- 1.40
- 1.39
- 1.38
- 1.37
- 1.36
- 1.35.2
- 1.35
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,22 +38,22 @@ define([ | |
this._endColorSubscription = undefined; | ||
this._rate = undefined; | ||
this._rateSubscription = undefined; | ||
this._minWidth = undefined; | ||
this._minWidthSubscription = undefined; | ||
this._maxWidth = undefined; | ||
this._maxWidthSubscription = undefined; | ||
this._minHeight = undefined; | ||
this._minHeightSubscription = undefined; | ||
this._maxHeight = undefined; | ||
this._maxHeightSubscription = undefined; | ||
this._minSpeed = undefined; | ||
this._minSpeedSubscription = undefined; | ||
this._maxSpeed = undefined; | ||
this._maxSpeedSubscription = undefined; | ||
this._minLife = undefined; | ||
this._minLifeSubscription = undefined; | ||
this._maxLife = undefined; | ||
this._maxLifeSubscription = undefined; | ||
this._minimumWidth = undefined; | ||
this._minimumWidthSubscription = undefined; | ||
this._maximumWidth = undefined; | ||
this._maximumWidthSubscription = undefined; | ||
this._minimumHeight = undefined; | ||
this._minimumHeightSubscription = undefined; | ||
this._maximumHeight = undefined; | ||
this._maximumHeightSubscription = undefined; | ||
this._minimumSpeed = undefined; | ||
this._minimumSpeedSubscription = undefined; | ||
this._maximumSpeed = undefined; | ||
this._maximumSpeedSubscription = undefined; | ||
this._minimumLife = undefined; | ||
this._minimumLifeSubscription = undefined; | ||
this._maximumLife = undefined; | ||
this._maximumLifeSubscription = undefined; | ||
this._loop = undefined; | ||
this._loopSubscription = undefined; | ||
this._lifeTime = undefined; | ||
|
@@ -153,47 +153,47 @@ define([ | |
* @type {Property} | ||
* @default 16.0 | ||
*/ | ||
minWidth: createPropertyDescriptor('minWidth'), | ||
minimumWidth: createPropertyDescriptor('minimumWidth'), | ||
|
||
/** | ||
* The maximum width of a particle billboard. | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 16.0 | ||
*/ | ||
maxWidth: createPropertyDescriptor('maxWidth'), | ||
maximumWidth: createPropertyDescriptor('maximumWidth'), | ||
|
||
/** | ||
* The minimum height of a particle billboard. | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 16.0 | ||
*/ | ||
minHeight: createPropertyDescriptor('minHeight'), | ||
minimumHeight: createPropertyDescriptor('minimumHeight'), | ||
|
||
/** | ||
* The maximum height of a particle billboard. | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 16.0 | ||
*/ | ||
maxHeight: createPropertyDescriptor('maxHeight'), | ||
maximumHeight: createPropertyDescriptor('maximumHeight'), | ||
|
||
/** | ||
* The minimum speed of a particle. | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 5.0 | ||
*/ | ||
minSpeed: createPropertyDescriptor('minSpeed'), | ||
minimumSpeed: createPropertyDescriptor('minimumSpeed'), | ||
|
||
/** | ||
* The maximum speed of a particle. | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 5.0 | ||
*/ | ||
maxSpeed: createPropertyDescriptor('maxSpeed'), | ||
maximumSpeed: createPropertyDescriptor('maximumSpeed'), | ||
|
||
/** | ||
* Whether the particle system should loop when it's complete. | ||
|
@@ -237,15 +237,15 @@ define([ | |
* @type {Property} | ||
* @default 5.0 | ||
*/ | ||
minLife: createPropertyDescriptor("minLife"), | ||
minimumLife: createPropertyDescriptor("minimumLife"), | ||
|
||
/** | ||
* The maximum life in seconds of a particle | ||
* @memberof ParticleSystemGraphics.prototype | ||
* @type {Property} | ||
* @default 5.0 | ||
*/ | ||
maxLife: createPropertyDescriptor("maxLife"), | ||
maximumLife: createPropertyDescriptor("maximumLife"), | ||
|
||
/** | ||
* An array of callbacks that apply a force to a given particle over time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "given" -> probably "each" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, to provide more precise doc for the callback function signature, check out this example: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/binarySearch.js#L66 |
||
|
@@ -274,14 +274,14 @@ define([ | |
result.startColor = this.startColor; | ||
result.endColor = this.endColor; | ||
result.rate = this.rate; | ||
result.minWidth = this.minWidth; | ||
result.maxWidth = this.maxWidth; | ||
result.minHeight = this.minHeight; | ||
result.maxHeight = this.maxHeight; | ||
result.minSpeed = this.minSpeed; | ||
result.maxSpeed = this.maxSpeed; | ||
result.minLife = this.minLife; | ||
result.maxLife = this.maxLife; | ||
result.minimumWidth = this.minimumWidth; | ||
result.maximumWidth = this.maximumWidth; | ||
result.minimumHeight = this.minimumHeight; | ||
result.maximumHeight = this.maximumHeight; | ||
result.minimumSpeed = this.minimumSpeed; | ||
result.maximumSpeed = this.maximumSpeed; | ||
result.minimumLife = this.minimumLife; | ||
result.maximumLife = this.maximumLife; | ||
result.loop = this.loop; | ||
result.lifeTime = this.lifeTime; | ||
result.emitterModelMatrix = this.emitterModelMatrix; | ||
|
@@ -312,14 +312,14 @@ define([ | |
this.startColor = defaultValue(this.startColor, source.startColor); | ||
this.endColor = defaultValue(this.endColor, source.endColor); | ||
this.rate = defaultValue(this.rate, source.rate); | ||
this.minWidth = defaultValue(this.minWidth, source.minWidth); | ||
this.maxWidth = defaultValue(this.maxWidth, source.maxWidth); | ||
this.minHeight = defaultValue(this.minHeight, source.minHeight); | ||
this.maxHeight = defaultValue(this.maxHeight, source.maxHeight); | ||
this.minSpeed = defaultValue(this.minSpeed, source.minSpeed); | ||
this.maxSpeed = defaultValue(this.maxSpeed, source.maxSpeed); | ||
this.minLife = defaultValue(this.minLife, source.minLife); | ||
this.maxLife = defaultValue(this.maxLife, source.maxLife); | ||
this.minimumWidth = defaultValue(this.minimumWidth, source.minimumWidth); | ||
this.maximumWidth = defaultValue(this.maximumWidth, source.maximumWidth); | ||
this.minimumHeight = defaultValue(this.minimumHeight, source.minimumHeight); | ||
this.maximumHeight = defaultValue(this.maximumHeight, source.maximumHeight); | ||
this.minimumSpeed = defaultValue(this.minimumSpeed, source.minimumSpeed); | ||
this.maximumSpeed = defaultValue(this.maximumSpeed, source.maximumSpeed); | ||
this.minimumLife = defaultValue(this.minimumLife, source.minimumLife); | ||
this.maximumLife = defaultValue(this.maximumLife, source.maximumLife); | ||
this.loop = defaultValue(this.loop, source.loop); | ||
this.lifeTime = defaultValue(this.lifeTime, source.lifeTime); | ||
this.emitterModelMatrix = defaultValue(this.emitterModelMatrix, source.emitterModelMatrix); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,54 +51,54 @@ define([ | |
|
||
var speed = defaultValue(options.speed, undefined); | ||
if (speed) { | ||
this.minSpeed = speed; | ||
this.maxSpeed = speed; | ||
this.minimumSpeed = speed; | ||
this.maximumSpeed = speed; | ||
} | ||
else { | ||
this.minSpeed = defaultValue(options.minSpeed, 1.0); | ||
this.maxSpeed = defaultValue(options.maxSpeed, 1.0); | ||
this.minimumSpeed = defaultValue(options.minimumSpeed, 1.0); | ||
this.maximumSpeed = defaultValue(options.maximumSpeed, 1.0); | ||
} | ||
|
||
var life = defaultValue(options.life, undefined); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just var life = options.life; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comments throughout this constructor function. |
||
if (life) { | ||
this.minLife = life; | ||
this.maxLife = life; | ||
this.minimumLife = life; | ||
this.maximumLife = life; | ||
} | ||
else { | ||
this.minLife = defaultValue(options.minLife, 5.0); | ||
this.maxLife = defaultValue(options.maxLife, 5.0); | ||
this.minimumLife = defaultValue(options.minimumLife, 5.0); | ||
this.maximumLife = defaultValue(options.maximumLife, 5.0); | ||
} | ||
|
||
var mass = defaultValue(options.mass, undefined); | ||
if (mass) { | ||
this.minMass = mass; | ||
this.maxMass = mass; | ||
this.minimumMass = mass; | ||
this.maximumMass = mass; | ||
} | ||
else { | ||
this.minMass = defaultValue(options.minMass, 1.0); | ||
this.maxMass = defaultValue(options.maxMass, 1.0); | ||
this.minimumMass = defaultValue(options.minimumMass, 1.0); | ||
this.maximumMass = defaultValue(options.maximumMass, 1.0); | ||
} | ||
|
||
this.image = defaultValue(options.image, null); | ||
|
||
var width = defaultValue(options.width, undefined); | ||
if (width) { | ||
this.minWidth = width; | ||
this.maxWidth = width; | ||
this.minimumWidth = width; | ||
this.maximumWidth = width; | ||
} | ||
else { | ||
this.minWidth = defaultValue(options.minWidth, 1.0); | ||
this.maxWidth = defaultValue(options.maxWidth, 1.0); | ||
this.minimumWidth = defaultValue(options.minimumWidth, 1.0); | ||
this.maximumWidth = defaultValue(options.maximumWidth, 1.0); | ||
} | ||
|
||
var height = defaultValue(options.height, undefined); | ||
if (height) { | ||
this.minHeight = height; | ||
this.maxHeight = height; | ||
this.minimumHeight = height; | ||
this.maximumHeight = height; | ||
} | ||
else { | ||
this.minHeight = defaultValue(options.minHeight, 1.0); | ||
this.maxHeight = defaultValue(options.maxHeight, 1.0); | ||
this.minimumHeight = defaultValue(options.minimumHeight, 1.0); | ||
this.maximumHeight = defaultValue(options.maximumHeight, 1.0); | ||
} | ||
|
||
this.lifeTime = defaultValue(options.lifeTime, Number.MAX_VALUE); | ||
|
@@ -151,12 +151,12 @@ define([ | |
particle.startScale = this.startScale; | ||
particle.endScale = this.endScale; | ||
particle.image = this.image; | ||
particle.life = random(this.minLife, this.maxLife); | ||
particle.mass = random(this.minMass, this.maxMass); | ||
particle.life = random(this.minimumLife, this.maximumLife); | ||
particle.mass = random(this.minimumMass, this.maximumMass); | ||
|
||
particle.size = new Cartesian2(random(this.minWidth, this.maxWidth), random(this.minHeight, this.maxHeight)); | ||
particle.size = new Cartesian2(random(this.minimumWidth, this.maximumWidth), random(this.minimumHeight, this.maximumHeight)); | ||
|
||
var speed = random(this.minSpeed, this.maxSpeed); | ||
var speed = random(this.minimumSpeed, this.maximumSpeed); | ||
Cartesian3.multiplyByScalar(particle.velocity, speed, particle.velocity); | ||
|
||
this.particles.push(particle); | ||
|
@@ -292,4 +292,4 @@ define([ | |
}; | ||
|
||
return ParticleSystem; | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about the units.