Skip to content

Commit c371b50

Browse files
authored
[Community] [3D particles] Fix the size of particles that were 3 times too small (#1004)
1 parent 83974fd commit c371b50

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

extensions/community/ParticleEmitter3D.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
"name": "ParticleEmitter3D",
99
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg",
1010
"shortDescription": "Display a large number of particles to create visual effects.",
11-
"version": "0.0.2",
11+
"version": "1.0.0",
1212
"description": [
1313
"Particle emitters can be used to display:",
1414
"- Fire",
1515
"- Smoke",
1616
"- Splashes",
17-
"- Lights"
17+
"- Lights",
18+
"",
19+
"Breaking change from 1.0.0:",
20+
"- Particles were 3 times too small"
1821
],
1922
"tags": [
2023
"3d",
@@ -2787,7 +2790,7 @@
27872790
" }",
27882791
" if (this.worldSpace) {",
27892792
" particle.position.applyMatrix4(matrix);",
2790-
" particle.startSize = (particle.startSize * (scale.x + scale.y + scale.z)) / 3;",
2793+
" particle.startSize = (particle.startSize * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3;",
27912794
" particle.size = particle.startSize;",
27922795
" particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);",
27932796
" if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {",
@@ -3835,7 +3838,7 @@
38353838
" this.sizeBuffer.setX(index, particle.size);",
38363839
" }",
38373840
" else {",
3838-
" this.sizeBuffer.setX(index, (particle.size * (scale.x + scale.y + scale.z)) / 3);",
3841+
" this.sizeBuffer.setX(index, (particle.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);",
38393842
" }",
38403843
" }",
38413844
" this.uvTileBuffer.setX(index, particle.uvTile);",
@@ -4189,8 +4192,8 @@
41894192
" this.widthBuffer.setX(index + 1, current.size);",
41904193
" }",
41914194
" else {",
4192-
" this.widthBuffer.setX(index, (current.size * (scale.x + scale.y + scale.z)) / 3);",
4193-
" this.widthBuffer.setX(index + 1, (current.size * (scale.x + scale.y + scale.z)) / 3);",
4195+
" this.widthBuffer.setX(index, (current.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);",
4196+
" this.widthBuffer.setX(index + 1, (current.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);",
41944197
" }",
41954198
" }",
41964199
" this.uvBuffer.setXY(index, (i / particle.previous.length + col) * tileWidth, (vTileCount - row - 1) * tileHeight);",

0 commit comments

Comments
 (0)