A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(particle): an emitter has its own simulation speed, and the Cocos simulation speed, noise, trail and burst time map onto the emitter
yhh2396c944c9ce
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex adcada9c0..fd6311c93 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,7 @@ published separately; it ships inside the editor.- **Scroll areas can be pulled past an end and spring back.** A scroll area whose movement is Elastic now does what the setting always said: a drag past an end is stiffer the further out it goes, letting go returns the content, and a flick that reaches an end bounces off it. It is opt-in per area (`ScrollMovement.Elastic`; Clamped, the default, behaves as before), and the gesture model (`ScrollMotion`, with `ScrollContainer.dragTo` and `getOverscroll`) is exported for scrolling anything else the same way.- **More easing curves.** Sine, quart, quint, expo and circ (each in, out and in-out), bounce in and in-out, and smoothstep and smootherstep join the quad, cubic, back, elastic and out-bounce curves. They are new `EasingType` members after the existing ones, so a saved tween keeps its curve, and they ease the same in a C++ tween and a script value tween.- **World content has a rectangle: `ContentRect`.** A size and the pivot the entity's transform sits on, which the `Sprite` and `Text` on the entity follow and which a `UIMask` on it clips to — no `UINode` needed, so a clipping region or a scroll viewport can stand in the world. `contentRectContains` tests a world point against it.+- **An emitter runs on its own clock.** `ParticleEmitter.simulationSpeed` scales how fast that emitter's time runs: 2 plays it twice as fast, 0.5 at half, 0 holds it. Emission, lifetimes and motion all follow it. The default, 1, is the behaviour before.- **An animator state can play at the speed of a parameter.** `speedParameter` on an `AnimatorState` names a float parameter; the state's clock advances by `dt` times its value, so a run clip follows a character's speed and a value of 0 holds the pose. It applies to every kind of motion, since it is the state's own clock that is scaled.- **Particles can carry an added velocity and be held to a speed limit.** `ParticleEmitter.addedVelocityMin` and `addedVelocityMax` give each particle a velocity on top of its own, chosen between the two when it is born and untouched by gravity, damping and noise. `speedLimit` pulls a faster particle back toward the limit, by `limitDampen` of the excess every 1/60 s so the braking does not depend on the frame rate. Both are run by the CPU simulation.- **An emitter can start late.** `ParticleEmitter.startDelay` holds back emission for that many seconds after the emitter starts playing; the duration of a non-looping emitter is counted from the end of the delay. Zero, the default, is the behaviour before.diff --git a/docs/astro/src/content/docs/world/particles.mdx b/docs/astro/src/content/docs/world/particles.mdxindex 16c1820aa..f9169fabf 100644--- a/docs/astro/src/content/docs/world/particles.mdx+++ b/docs/astro/src/content/docs/world/particles.mdx@@ -91,6 +91,7 @@ in degrees.| `burstCount` | number | `0` | Particles released per burst. `0` disables bursts. || `burstInterval` | number | `1` | Seconds between bursts. || `duration` | number | `5` | Seconds the emitter runs before stopping (see `looping`). |+| `simulationSpeed` | number | `1` | How fast this emitter's own time runs: `2` plays it twice as fast, `0` holds it. Emission, lifetimes and motion all follow it. || `startDelay` | number | `0` | Seconds the emitter plays before it emits anything; `duration` counts from the end of the delay. || `looping` | boolean | `true` | Restart after `duration` instead of stopping. || `playOnStart` | boolean | `true` | Begin emitting as soon as the entity exists. |diff --git a/docs/astro/src/content/docs/zh-cn/world/particles.mdx b/docs/astro/src/content/docs/zh-cn/world/particles.mdxindex 02c3c4720..81a0f11ba 100644--- a/docs/astro/src/content/docs/zh-cn/world/particles.mdx+++ b/docs/astro/src/content/docs/zh-cn/world/particles.mdx@@ -82,6 +82,7 @@ const spawnEmbers = defineSystem([Commands()], (cmds) => {| `burstCount` | number | `0` | 每次爆发释放的粒子数。`0` 禁用爆发。 || `burstInterval` | number | `1` | 两次爆发之间的秒数。 || `duration` | number | `5` | 发射器停止前运行的秒数(见 `looping`)。 |+| `simulationSpeed` | number | `1` | 这个发射器自己的时间流速:`2` 是两倍速,`0` 是停住。发射、寿命和运动都跟着它走。 || `startDelay` | number | `0` | 发射器开始播放后、真正发射之前等待的秒数;`duration` 从延迟结束后开始计时。 || `looping` | boolean | `true` | 到 `duration` 后重新开始,而不是停止。 || `playOnStart` | boolean | `true` | 实体一存在就开始发射。 |diff --git a/docs/astro/src/data/components.generated.json b/docs/astro/src/data/components.generated.jsonindex 8c0c1cad8..234f3ee66 100644--- a/docs/astro/src/data/components.generated.json+++ b/docs/astro/src/data/components.generated.json@@ -3450,6 +3450,13 @@"default": "5","range": "≥ 0"},+ {+ "key": "simulationSpeed",+ "type": "number",+ "default": "1",+ "doc": "How fast this emitter's own time runs: 2 plays it twice as fast, 0.5 at half, 0 holds it. Scales emission, lifetimes and motion alike.",+ "range": "≥ 0"+ },{"key": "startDelay","type": "number",diff --git a/pipeline/src/import/cocos/components.ts b/pipeline/src/import/cocos/components.tsindex 187c590bc..cd971fabd 100644--- a/pipeline/src/import/cocos/components.ts+++ b/pipeline/src/import/cocos/components.ts@@ -141,9 +141,10 @@ function sprite(c: CocosComponent, box: UiBox | null, ctx: ComponentContext, whedata.pivot = { x: box.ax, y: box.ay };}if (!frameUuid) {- ctx.report.component(as, 'partial');+ // No frame draws nothing in Cocos: the sprite is there, off, for a script that sets its frame; a white quad would be wrong.+ ctx.report.component(as, 'mapped');ctx.report.note('sprite-no-frame', where);- return { type: 'Sprite', data };+ return { type: 'Sprite', data: { ...data, enabled: false } };}const entry = ctx.assets.byUuid.get(frameUuid);const sub = entry?.subs.get(frameUuid);@@ -189,7 +190,19 @@ function sprite(c: CocosComponent, box: UiBox | null, ctx: ComponentContext, wheif (rawW > 0 && rawH > 0 && (w !== rawW || h !== rawH || x !== 0 || y !== 0)) {data.uvOffset = { x: x / rawW, y: 1 - (y + h) / rawH };data.uvScale = { x: w / rawW, y: h / rawH };- status = 'partial';+ // Cocos's `trim` (the default) fills the node's rectangle with the frame's trimmed region, which is what the UV window does. With trim+ // off the region keeps the place it had in the full image, scaled with the node: its size is the node's times its share of the image,+ // and its centre sits off the node's centre by how far it sat off the image's.+ if (c.data._isTrimmedMode === false && box && kind !== 1) {+ const sx = box.width / rawW, sy = box.height / rawH;+ const size = { x: w * sx, y: h * sy };+ const centre = {+ x: (0.5 - box.ax) * box.width + (x + w / 2 - rawW / 2) * sx,+ y: (0.5 - box.ay) * box.height - (y + h / 2 - rawH / 2) * sy,+ };+ data.size = size;+ data.pivot = { x: size.x === 0 ? 0.5 : 0.5 - centre.x / size.x, y: size.y === 0 ? 0.5 : 0.5 - centre.y / size.y };+ }ctx.report.note('sprite-trimmed-frame', where);}if (ud.rotated === true) {diff --git a/pipeline/src/import/cocos/particle.ts b/pipeline/src/import/cocos/particle.tsindex 0cf670f6d..e985f66d1 100644--- a/pipeline/src/import/cocos/particle.ts+++ b/pipeline/src/import/cocos/particle.ts@@ -193,7 +193,7 @@ export function particleSystem(c: { enabled: boolean; data: Raw }, ctx: Particlegravity: { x: 0, y: -9.8 * mid(gravity), z: 0 },simulationSpace: num(d._simulationSpace, 1) === 0 ? 1 /* Local */ : 0 /* World */,};- if (num(d.simulationSpeed, 1) !== 1) lose('particle-simulation-speed');+ out.simulationSpeed = Math.max(0, num(d.simulationSpeed, 1));out.startDelay = Math.max(0, mid(curveRange(d.startDelay, 0, 0)));if (mid(curveRange(d.rateOverDistance, 0, 0)) > 0) lose('particle-rate-over-distance');@@ -242,7 +242,11 @@ export function particleSystem(c: { enabled: boolean; data: Raw }, ctx: Particleconst b = bursts[0]!;out.burstCount = Math.round(mid(curveRange(b.count, 0, 0)));out.burstInterval = Math.max(num(b.repeatInterval, 1), 0.01);- if (bursts.length > 1 || num(b._time, 0) > 0) lose('particle-bursts');+ const at = num(b._time, 0);+ // A system that only bursts has nothing to wait for but its burst: the wait is the emitter's start delay. With a steady rate beside it the+ // delay would hold the rate back too, so that burst's time is counted instead.+ if (at > 0 && bursts.length === 1 && mid(rate) === 0) out.startDelay = Number(out.startDelay ?? 0) + at;+ else if (bursts.length > 1 || at > 0) lose('particle-bursts');}// a sheet of frames played over a life@@ -295,11 +299,27 @@ export function particleSystem(c: { enabled: boolean; data: Raw }, ctx: Particle}}- for (const [module, code] of [- ['_noiseModule', 'particle-noise'], ['_trailModule', 'particle-trail'],- ] as const) {- const m = d[module];- if (isObj(m) && m._enable === true) lose(code);+ // turbulence: a flow the particles are pushed along, as strong and as fine as the module says+ const noise = enabledModule(d._noiseModule);+ if (noise) {+ const strength = (num(noise._strengthX, 0) + num(noise._strengthY, 0)) / 2;+ out.noiseStrength = strength;+ out.noiseFrequency = Math.max(num(noise._noiseFrequency, 1), 0.0001);+ out.noiseScrollSpeed = (num(noise._noiseSpeedX, 0) + num(noise._noiseSpeedY, 0)) / 2;+ out.noiseOctaves = Math.min(8, Math.max(1, Math.trunc(num(noise._octaves, 1))));+ }++ // a ribbon behind each particle: how long it lives sets how many points it keeps, and the width is the ratio read at the head+ const trail = enabledModule(d._trailModule);+ if (trail) {+ const life = mid(curveRange(trail.lifeTime, 0, 0.3));+ const ratio = mid(curveRange(trail.widthRatio, 0, 1));+ out.trailEnabled = true;+ out.trailPoints = Math.min(12, Math.max(2, Math.round(life / 0.05)));+ out.trailMinDistance = Math.max(0, num(trail._minParticleDistance, 0.1));+ out.trailWidth = trail.widthFromParticle === true ? mid(size) * ratio : ratio;+ if (isObj(trail.colorOverTrail) && num(trail.colorOverTrail._mode, 0) !== 0) lose('particle-trail-colour');+ if (num(trail._space, 0) !== 0) lose('particle-trail-space');}const renderer = isObj(d.renderer) ? d.renderer : null;const renderMode = renderer ? num(renderer._renderMode, 0) : 0;diff --git a/pipeline/tests/cocos-particle.test.ts b/pipeline/tests/cocos-particle.test.tsindex db18005cc..529a7f824 100644--- a/pipeline/tests/cocos-particle.test.ts+++ b/pipeline/tests/cocos-particle.test.ts@@ -144,10 +144,30 @@ describe('a particle system', () => {expect(axes.report.notes['particle-limit-per-axis']?.count).toBe(1);});- it('counts the modules the emitter has no field for', () => {- const { report } = convert({ _noiseModule: { _enable: true }, _trailModule: { _enable: true } });- expect(report.notes['particle-noise']?.count).toBe(1);- expect(report.notes['particle-trail']?.count).toBe(1);+ it('maps simulation speed, turbulence and a trail, and the burst time of a burst-only system as its start delay', () => {+ const { out, report } = convert({+ simulationSpeed: 2,+ bursts: [{ _time: 0.4, count: constant(5), repeatInterval: 1 }],+ _noiseModule: { _enable: true, _strengthX: 0.8, _strengthY: 0.4, _noiseFrequency: 0.5, _noiseSpeedX: 1, _noiseSpeedY: 3, _octaves: 2 },+ _trailModule: { _enable: true, lifeTime: constant(0.35), _minParticleDistance: 0.1, widthFromParticle: false, widthRatio: constant(0.8), colorOverTrail: { _mode: 0 } },+ });+ const d = out.data as Record<string, any>;+ expect(d.simulationSpeed).toBe(2);+ expect(d.startDelay).toBeCloseTo(0.4, 5);+ expect([d.noiseStrength, d.noiseFrequency, d.noiseScrollSpeed, d.noiseOctaves]).toEqual([0.6000000000000001, 0.5, 2, 2]);+ expect([d.trailEnabled, d.trailPoints, d.trailWidth, d.trailMinDistance]).toEqual([true, 7, 0.8, 0.1]);+ expect(report.components['cc.ParticleSystem']).toEqual({ mapped: 1, partial: 0, unmapped: 0 });+ const def = registry.ParticleEmitter!;+ expect(validate('ParticleEmitter', def._default, d, def.assetFields)).toEqual([]);+ });++ it('counts what the emitter has no field for: several bursts, a trail coloured along its length', () => {+ const { report } = convert({+ bursts: [{ _time: 0, count: constant(5), repeatInterval: 1 }, { _time: 1, count: constant(5), repeatInterval: 1 }],+ _trailModule: { _enable: true, lifeTime: constant(0.3), widthRatio: constant(1), colorOverTrail: { _mode: 1 } },+ });+ expect(report.notes['particle-bursts']?.count).toBe(1);+ expect(report.notes['particle-trail-colour']?.count).toBe(1);});it('is fully mapped when nothing was left out', () => {diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.mdindex 6292e0710..29c9be289 100644--- a/sdk/etc/index.api.md+++ b/sdk/etc/index.api.md@@ -5,7 +5,7 @@ Symbols: 115 public · 161 beta · 1966 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```-"097d3c7989a498a1"+"63a00195ad788bd8"```## ANCHOR_AXES — const @experimental@@ -6517,6 +6517,7 @@ shapeAngle: numbershapeRadius: numbershapeSize: Vec3simulationSpace: SimulationSpace+simulationSpeed: numbersizeCurve: { keys: { t: number; v: number; }[]; }sizeEasing: ParticleEasingspeedLimit: numberdiff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.mdindex 840de784d..a5f94f087 100644--- a/sdk/etc/index.native.api.md+++ b/sdk/etc/index.native.api.md@@ -5,7 +5,7 @@ Symbols: 115 public · 166 beta · 1985 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```-"097d3c7989a498a1"+"63a00195ad788bd8"```## ANCHOR_AXES — const @experimental@@ -6720,6 +6720,7 @@ shapeAngle: numbershapeRadius: numbershapeSize: Vec3simulationSpace: SimulationSpace+simulationSpeed: numbersizeCurve: { keys: { t: number; v: number; }[]; }sizeEasing: ParticleEasingspeedLimit: numberdiff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.mdindex 373af80c8..39b35ff64 100644--- a/sdk/etc/index.node.api.md+++ b/sdk/etc/index.node.api.md@@ -6512,6 +6512,7 @@ shapeAngle: numbershapeRadius: numbershapeSize: Vec3simulationSpace: SimulationSpace+simulationSpeed: numbersizeCurve: { keys: { t: number; v: number; }[]; }sizeEasing: ParticleEasingspeedLimit: numberdiff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.mdindex 64673f518..d5e84ae17 100644--- a/sdk/etc/minigame.api.md+++ b/sdk/etc/minigame.api.md@@ -6807,6 +6807,7 @@ shapeAngle: numbershapeRadius: numbershapeSize: Vec3simulationSpace: SimulationSpace+simulationSpeed: numbersizeCurve: { keys: { t: number; v: number; }[]; }sizeEasing: ParticleEasingspeedLimit: numberdiff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.mdindex d2efb26c0..4ba4aa21b 100644--- a/sdk/etc/wechat.api.md+++ b/sdk/etc/wechat.api.md@@ -6519,6 +6519,7 @@ shapeAngle: numbershapeRadius: numbershapeSize: Vec3simulationSpace: SimulationSpace+simulationSpeed: numbersizeCurve: { keys: { t: number; v: number; }[]; }sizeEasing: ParticleEasingspeedLimit: numberdiff --git a/sdk/src/ecs/bridge/ptrAccessors.generated.ts b/sdk/src/ecs/bridge/ptrAccessors.generated.tsindex 54fbb6920..fd8b4c561 100644--- a/sdk/src/ecs/bridge/ptrAccessors.generated.ts+++ b/sdk/src/ecs/bridge/ptrAccessors.generated.ts@@ -1226,6 +1226,7 @@ export interface ParticleEmitterPtrData {burstCount: number;burstInterval: number;duration: number;+ simulationSpeed: number;startDelay: number;looping: boolean;playOnStart: boolean;@@ -1306,76 +1307,77 @@ export function fillParticleEmitter(out.burstCount = u32[(ptr + 4) >> 2] | 0;out.burstInterval = f32[(ptr + 8) >> 2];out.duration = f32[(ptr + 12) >> 2];- out.startDelay = f32[(ptr + 16) >> 2];- out.looping = u8[ptr + 20] !== 0;- out.playOnStart = u8[ptr + 21] !== 0;- out.maxParticles = u32[(ptr + 24) >> 2] | 0;- out.gpuSimulation = u8[ptr + 28] !== 0;- out.lifetimeMin = f32[(ptr + 32) >> 2];- out.lifetimeMax = f32[(ptr + 36) >> 2];- out.shape = u32[(ptr + 40) >> 2] | 0;- out.shapeRadius = f32[(ptr + 44) >> 2];- const shapeSize_ = out.shapeSize; shapeSize_.x = f32[(ptr + 48) >> 2]; shapeSize_.y = f32[((ptr + 48) >> 2) + 1]; shapeSize_.z = f32[((ptr + 48) >> 2) + 2];- out.shapeAngle = f32[(ptr + 60) >> 2];- out.speedMin = f32[(ptr + 64) >> 2];- out.speedMax = f32[(ptr + 68) >> 2];- out.angleSpreadMin = f32[(ptr + 72) >> 2];- out.angleSpreadMax = f32[(ptr + 76) >> 2];- out.startSizeMin = f32[(ptr + 80) >> 2];- out.startSizeMax = f32[(ptr + 84) >> 2];- out.endSizeMin = f32[(ptr + 88) >> 2];- out.endSizeMax = f32[(ptr + 92) >> 2];- out.sizeEasing = u32[(ptr + 96) >> 2] | 0;- const startColor_ = out.startColor; startColor_.r = f32[(ptr + 100) >> 2]; startColor_.g = f32[((ptr + 100) >> 2) + 1]; startColor_.b = f32[((ptr + 100) >> 2) + 2]; startColor_.a = f32[((ptr + 100) >> 2) + 3];- const endColor_ = out.endColor; endColor_.r = f32[(ptr + 116) >> 2]; endColor_.g = f32[((ptr + 116) >> 2) + 1]; endColor_.b = f32[((ptr + 116) >> 2) + 2]; endColor_.a = f32[((ptr + 116) >> 2) + 3];- out.colorEasing = u32[(ptr + 132) >> 2] | 0;- out.rotationMin = f32[(ptr + 136) >> 2];- out.rotationMax = f32[(ptr + 140) >> 2];- out.angularVelocityMin = f32[(ptr + 144) >> 2];- out.angularVelocityMax = f32[(ptr + 148) >> 2];- const gravity_ = out.gravity; gravity_.x = f32[(ptr + 152) >> 2]; gravity_.y = f32[((ptr + 152) >> 2) + 1]; gravity_.z = f32[((ptr + 152) >> 2) + 2];- out.damping = f32[(ptr + 164) >> 2];- const addedVelocityMin_ = out.addedVelocityMin; addedVelocityMin_.x = f32[(ptr + 168) >> 2]; addedVelocityMin_.y = f32[((ptr + 168) >> 2) + 1]; addedVelocityMin_.z = f32[((ptr + 168) >> 2) + 2];- const addedVelocityMax_ = out.addedVelocityMax; addedVelocityMax_.x = f32[(ptr + 180) >> 2]; addedVelocityMax_.y = f32[((ptr + 180) >> 2) + 1]; addedVelocityMax_.z = f32[((ptr + 180) >> 2) + 2];- out.speedLimit = f32[(ptr + 192) >> 2];- out.limitDampen = f32[(ptr + 196) >> 2];- out.noiseStrength = f32[(ptr + 200) >> 2];- out.noiseFrequency = f32[(ptr + 204) >> 2];- out.noiseScrollSpeed = f32[(ptr + 208) >> 2];- out.noiseOctaves = u32[(ptr + 212) >> 2] | 0;- out.texture = u32[(ptr + 216) >> 2];- out.spriteColumns = u32[(ptr + 220) >> 2] | 0;- out.spriteRows = u32[(ptr + 224) >> 2] | 0;- out.spriteFPS = f32[(ptr + 228) >> 2];- out.spriteLoop = u8[ptr + 232] !== 0;- out.blendMode = u32[(ptr + 236) >> 2] | 0;- out.layer = u32[(ptr + 240) >> 2] | 0;- out.material = u32[(ptr + 244) >> 2];- out.simulationSpace = u32[(ptr + 248) >> 2] | 0;- out.renderMode = u32[(ptr + 252) >> 2] | 0;- out.velocityScale = f32[(ptr + 256) >> 2];- out.lengthScale = f32[(ptr + 260) >> 2];- out.enabled = u8[ptr + 264] !== 0;- out.subEmitterTrigger = u32[(ptr + 268) >> 2] | 0;- out.subEmitterChance = f32[(ptr + 272) >> 2];- out.subEmitterInheritVelocity = f32[(ptr + 276) >> 2];- out.subEmitter = u32[(ptr + 280) >> 2];- out.trailEnabled = u8[ptr + 284] !== 0;- out.trailWidth = f32[(ptr + 288) >> 2];- out.trailPoints = u32[(ptr + 292) >> 2] | 0;- out.trailMinDistance = f32[(ptr + 296) >> 2];- out.collisionEnabled = u8[ptr + 300] !== 0;- out.collisionFloor = f32[(ptr + 304) >> 2];- out.collisionMode = u32[(ptr + 308) >> 2] | 0;- out.collisionMask = u32[(ptr + 312) >> 2];- out.collisionQueryBudget = u32[(ptr + 316) >> 2] | 0;- out.collisionMaxDistance = f32[(ptr + 320) >> 2];- out.collisionFallback = u32[(ptr + 324) >> 2] | 0;- out.collisionEvents = u8[ptr + 328] !== 0;- out.collisionEventBudget = u32[(ptr + 332) >> 2] | 0;- out.collisionBounce = f32[(ptr + 336) >> 2];- out.collisionFriction = f32[(ptr + 340) >> 2];- out.collisionLifetimeLoss = f32[(ptr + 344) >> 2];+ out.simulationSpeed = f32[(ptr + 16) >> 2];+ out.startDelay = f32[(ptr + 20) >> 2];+ out.looping = u8[ptr + 24] !== 0;+ out.playOnStart = u8[ptr + 25] !== 0;+ out.maxParticles = u32[(ptr + 28) >> 2] | 0;+ out.gpuSimulation = u8[ptr + 32] !== 0;+ out.lifetimeMin = f32[(ptr + 36) >> 2];+ out.lifetimeMax = f32[(ptr + 40) >> 2];+ out.shape = u32[(ptr + 44) >> 2] | 0;+ out.shapeRadius = f32[(ptr + 48) >> 2];+ const shapeSize_ = out.shapeSize; shapeSize_.x = f32[(ptr + 52) >> 2]; shapeSize_.y = f32[((ptr + 52) >> 2) + 1]; shapeSize_.z = f32[((ptr + 52) >> 2) + 2];+ out.shapeAngle = f32[(ptr + 64) >> 2];+ out.speedMin = f32[(ptr + 68) >> 2];+ out.speedMax = f32[(ptr + 72) >> 2];+ out.angleSpreadMin = f32[(ptr + 76) >> 2];+ out.angleSpreadMax = f32[(ptr + 80) >> 2];+ out.startSizeMin = f32[(ptr + 84) >> 2];+ out.startSizeMax = f32[(ptr + 88) >> 2];+ out.endSizeMin = f32[(ptr + 92) >> 2];+ out.endSizeMax = f32[(ptr + 96) >> 2];+ out.sizeEasing = u32[(ptr + 100) >> 2] | 0;+ const startColor_ = out.startColor; startColor_.r = f32[(ptr + 104) >> 2]; startColor_.g = f32[((ptr + 104) >> 2) + 1]; startColor_.b = f32[((ptr + 104) >> 2) + 2]; startColor_.a = f32[((ptr + 104) >> 2) + 3];+ const endColor_ = out.endColor; endColor_.r = f32[(ptr + 120) >> 2]; endColor_.g = f32[((ptr + 120) >> 2) + 1]; endColor_.b = f32[((ptr + 120) >> 2) + 2]; endColor_.a = f32[((ptr + 120) >> 2) + 3];+ out.colorEasing = u32[(ptr + 136) >> 2] | 0;+ out.rotationMin = f32[(ptr + 140) >> 2];+ out.rotationMax = f32[(ptr + 144) >> 2];+ out.angularVelocityMin = f32[(ptr + 148) >> 2];+ out.angularVelocityMax = f32[(ptr + 152) >> 2];+ const gravity_ = out.gravity; gravity_.x = f32[(ptr + 156) >> 2]; gravity_.y = f32[((ptr + 156) >> 2) + 1]; gravity_.z = f32[((ptr + 156) >> 2) + 2];+ out.damping = f32[(ptr + 168) >> 2];+ const addedVelocityMin_ = out.addedVelocityMin; addedVelocityMin_.x = f32[(ptr + 172) >> 2]; addedVelocityMin_.y = f32[((ptr + 172) >> 2) + 1]; addedVelocityMin_.z = f32[((ptr + 172) >> 2) + 2];+ const addedVelocityMax_ = out.addedVelocityMax; addedVelocityMax_.x = f32[(ptr + 184) >> 2]; addedVelocityMax_.y = f32[((ptr + 184) >> 2) + 1]; addedVelocityMax_.z = f32[((ptr + 184) >> 2) + 2];+ out.speedLimit = f32[(ptr + 196) >> 2];+ out.limitDampen = f32[(ptr + 200) >> 2];+ out.noiseStrength = f32[(ptr + 204) >> 2];+ out.noiseFrequency = f32[(ptr + 208) >> 2];+ out.noiseScrollSpeed = f32[(ptr + 212) >> 2];+ out.noiseOctaves = u32[(ptr + 216) >> 2] | 0;+ out.texture = u32[(ptr + 220) >> 2];+ out.spriteColumns = u32[(ptr + 224) >> 2] | 0;+ out.spriteRows = u32[(ptr + 228) >> 2] | 0;+ out.spriteFPS = f32[(ptr + 232) >> 2];+ out.spriteLoop = u8[ptr + 236] !== 0;+ out.blendMode = u32[(ptr + 240) >> 2] | 0;+ out.layer = u32[(ptr + 244) >> 2] | 0;+ out.material = u32[(ptr + 248) >> 2];+ out.simulationSpace = u32[(ptr + 252) >> 2] | 0;+ out.renderMode = u32[(ptr + 256) >> 2] | 0;+ out.velocityScale = f32[(ptr + 260) >> 2];+ out.lengthScale = f32[(ptr + 264) >> 2];+ out.enabled = u8[ptr + 268] !== 0;+ out.subEmitterTrigger = u32[(ptr + 272) >> 2] | 0;+ out.subEmitterChance = f32[(ptr + 276) >> 2];+ out.subEmitterInheritVelocity = f32[(ptr + 280) >> 2];+ out.subEmitter = u32[(ptr + 284) >> 2];+ out.trailEnabled = u8[ptr + 288] !== 0;+ out.trailWidth = f32[(ptr + 292) >> 2];+ out.trailPoints = u32[(ptr + 296) >> 2] | 0;+ out.trailMinDistance = f32[(ptr + 300) >> 2];+ out.collisionEnabled = u8[ptr + 304] !== 0;+ out.collisionFloor = f32[(ptr + 308) >> 2];+ out.collisionMode = u32[(ptr + 312) >> 2] | 0;+ out.collisionMask = u32[(ptr + 316) >> 2];+ out.collisionQueryBudget = u32[(ptr + 320) >> 2] | 0;+ out.collisionMaxDistance = f32[(ptr + 324) >> 2];+ out.collisionFallback = u32[(ptr + 328) >> 2] | 0;+ out.collisionEvents = u8[ptr + 332] !== 0;+ out.collisionEventBudget = u32[(ptr + 336) >> 2] | 0;+ out.collisionBounce = f32[(ptr + 340) >> 2];+ out.collisionFriction = f32[(ptr + 344) >> 2];+ out.collisionLifetimeLoss = f32[(ptr + 348) >> 2];}export function writeParticleEmitter(@@ -1386,76 +1388,77 @@ export function writeParticleEmitter(u32[(ptr + 4) >> 2] = data.burstCount | 0;f32[(ptr + 8) >> 2] = data.burstInterval;f32[(ptr + 12) >> 2] = data.duration;- f32[(ptr + 16) >> 2] = data.startDelay;- u8[ptr + 20] = data.looping ? 1 : 0;- u8[ptr + 21] = data.playOnStart ? 1 : 0;- u32[(ptr + 24) >> 2] = data.maxParticles | 0;- u8[ptr + 28] = data.gpuSimulation ? 1 : 0;- f32[(ptr + 32) >> 2] = data.lifetimeMin;- f32[(ptr + 36) >> 2] = data.lifetimeMax;- u32[(ptr + 40) >> 2] = data.shape | 0;- f32[(ptr + 44) >> 2] = data.shapeRadius;- f32[(ptr + 48) >> 2] = data.shapeSize.x; f32[((ptr + 48) >> 2) + 1] = data.shapeSize.y; f32[((ptr + 48) >> 2) + 2] = data.shapeSize.z;- f32[(ptr + 60) >> 2] = data.shapeAngle;- f32[(ptr + 64) >> 2] = data.speedMin;- f32[(ptr + 68) >> 2] = data.speedMax;- f32[(ptr + 72) >> 2] = data.angleSpreadMin;- f32[(ptr + 76) >> 2] = data.angleSpreadMax;- f32[(ptr + 80) >> 2] = data.startSizeMin;- f32[(ptr + 84) >> 2] = data.startSizeMax;- f32[(ptr + 88) >> 2] = data.endSizeMin;- f32[(ptr + 92) >> 2] = data.endSizeMax;- u32[(ptr + 96) >> 2] = data.sizeEasing | 0;- f32[(ptr + 100) >> 2] = data.startColor.r; f32[((ptr + 100) >> 2) + 1] = data.startColor.g; f32[((ptr + 100) >> 2) + 2] = data.startColor.b; f32[((ptr + 100) >> 2) + 3] = data.startColor.a;- f32[(ptr + 116) >> 2] = data.endColor.r; f32[((ptr + 116) >> 2) + 1] = data.endColor.g; f32[((ptr + 116) >> 2) + 2] = data.endColor.b; f32[((ptr + 116) >> 2) + 3] = data.endColor.a;- u32[(ptr + 132) >> 2] = data.colorEasing | 0;- f32[(ptr + 136) >> 2] = data.rotationMin;- f32[(ptr + 140) >> 2] = data.rotationMax;- f32[(ptr + 144) >> 2] = data.angularVelocityMin;- f32[(ptr + 148) >> 2] = data.angularVelocityMax;- f32[(ptr + 152) >> 2] = data.gravity.x; f32[((ptr + 152) >> 2) + 1] = data.gravity.y; f32[((ptr + 152) >> 2) + 2] = data.gravity.z;- f32[(ptr + 164) >> 2] = data.damping;- f32[(ptr + 168) >> 2] = data.addedVelocityMin.x; f32[((ptr + 168) >> 2) + 1] = data.addedVelocityMin.y; f32[((ptr + 168) >> 2) + 2] = data.addedVelocityMin.z;- f32[(ptr + 180) >> 2] = data.addedVelocityMax.x; f32[((ptr + 180) >> 2) + 1] = data.addedVelocityMax.y; f32[((ptr + 180) >> 2) + 2] = data.addedVelocityMax.z;- f32[(ptr + 192) >> 2] = data.speedLimit;- f32[(ptr + 196) >> 2] = data.limitDampen;- f32[(ptr + 200) >> 2] = data.noiseStrength;- f32[(ptr + 204) >> 2] = data.noiseFrequency;- f32[(ptr + 208) >> 2] = data.noiseScrollSpeed;- u32[(ptr + 212) >> 2] = data.noiseOctaves | 0;- u32[(ptr + 216) >> 2] = data.texture;- u32[(ptr + 220) >> 2] = data.spriteColumns | 0;- u32[(ptr + 224) >> 2] = data.spriteRows | 0;- f32[(ptr + 228) >> 2] = data.spriteFPS;- u8[ptr + 232] = data.spriteLoop ? 1 : 0;- u32[(ptr + 236) >> 2] = data.blendMode | 0;- u32[(ptr + 240) >> 2] = data.layer | 0;- u32[(ptr + 244) >> 2] = data.material;- u32[(ptr + 248) >> 2] = data.simulationSpace | 0;- u32[(ptr + 252) >> 2] = data.renderMode | 0;- f32[(ptr + 256) >> 2] = data.velocityScale;- f32[(ptr + 260) >> 2] = data.lengthScale;- u8[ptr + 264] = data.enabled ? 1 : 0;- u32[(ptr + 268) >> 2] = data.subEmitterTrigger | 0;- f32[(ptr + 272) >> 2] = data.subEmitterChance;- f32[(ptr + 276) >> 2] = data.subEmitterInheritVelocity;- u32[(ptr + 280) >> 2] = data.subEmitter;- u8[ptr + 284] = data.trailEnabled ? 1 : 0;- f32[(ptr + 288) >> 2] = data.trailWidth;- u32[(ptr + 292) >> 2] = data.trailPoints | 0;- f32[(ptr + 296) >> 2] = data.trailMinDistance;- u8[ptr + 300] = data.collisionEnabled ? 1 : 0;- f32[(ptr + 304) >> 2] = data.collisionFloor;- u32[(ptr + 308) >> 2] = data.collisionMode | 0;- u32[(ptr + 312) >> 2] = data.collisionMask;- u32[(ptr + 316) >> 2] = data.collisionQueryBudget | 0;- f32[(ptr + 320) >> 2] = data.collisionMaxDistance;- u32[(ptr + 324) >> 2] = data.collisionFallback | 0;- u8[ptr + 328] = data.collisionEvents ? 1 : 0;- u32[(ptr + 332) >> 2] = data.collisionEventBudget | 0;- f32[(ptr + 336) >> 2] = data.collisionBounce;- f32[(ptr + 340) >> 2] = data.collisionFriction;- f32[(ptr + 344) >> 2] = data.collisionLifetimeLoss;+ f32[(ptr + 16) >> 2] = data.simulationSpeed;+ f32[(ptr + 20) >> 2] = data.startDelay;+ u8[ptr + 24] = data.looping ? 1 : 0;+ u8[ptr + 25] = data.playOnStart ? 1 : 0;+ u32[(ptr + 28) >> 2] = data.maxParticles | 0;+ u8[ptr + 32] = data.gpuSimulation ? 1 : 0;+ f32[(ptr + 36) >> 2] = data.lifetimeMin;+ f32[(ptr + 40) >> 2] = data.lifetimeMax;+ u32[(ptr + 44) >> 2] = data.shape | 0;+ f32[(ptr + 48) >> 2] = data.shapeRadius;+ f32[(ptr + 52) >> 2] = data.shapeSize.x; f32[((ptr + 52) >> 2) + 1] = data.shapeSize.y; f32[((ptr + 52) >> 2) + 2] = data.shapeSize.z;+ f32[(ptr + 64) >> 2] = data.shapeAngle;+ f32[(ptr + 68) >> 2] = data.speedMin;+ f32[(ptr + 72) >> 2] = data.speedMax;+ f32[(ptr + 76) >> 2] = data.angleSpreadMin;+ f32[(ptr + 80) >> 2] = data.angleSpreadMax;+ f32[(ptr + 84) >> 2] = data.startSizeMin;+ f32[(ptr + 88) >> 2] = data.startSizeMax;+ f32[(ptr + 92) >> 2] = data.endSizeMin;+ f32[(ptr + 96) >> 2] = data.endSizeMax;+ u32[(ptr + 100) >> 2] = data.sizeEasing | 0;+ f32[(ptr + 104) >> 2] = data.startColor.r; f32[((ptr + 104) >> 2) + 1] = data.startColor.g; f32[((ptr + 104) >> 2) + 2] = data.startColor.b; f32[((ptr + 104) >> 2) + 3] = data.startColor.a;+ f32[(ptr + 120) >> 2] = data.endColor.r; f32[((ptr + 120) >> 2) + 1] = data.endColor.g; f32[((ptr + 120) >> 2) + 2] = data.endColor.b; f32[((ptr + 120) >> 2) + 3] = data.endColor.a;+ u32[(ptr + 136) >> 2] = data.colorEasing | 0;+ f32[(ptr + 140) >> 2] = data.rotationMin;+ f32[(ptr + 144) >> 2] = data.rotationMax;+ f32[(ptr + 148) >> 2] = data.angularVelocityMin;+ f32[(ptr + 152) >> 2] = data.angularVelocityMax;+ f32[(ptr + 156) >> 2] = data.gravity.x; f32[((ptr + 156) >> 2) + 1] = data.gravity.y; f32[((ptr + 156) >> 2) + 2] = data.gravity.z;+ f32[(ptr + 168) >> 2] = data.damping;+ f32[(ptr + 172) >> 2] = data.addedVelocityMin.x; f32[((ptr + 172) >> 2) + 1] = data.addedVelocityMin.y; f32[((ptr + 172) >> 2) + 2] = data.addedVelocityMin.z;+ f32[(ptr + 184) >> 2] = data.addedVelocityMax.x; f32[((ptr + 184) >> 2) + 1] = data.addedVelocityMax.y; f32[((ptr + 184) >> 2) + 2] = data.addedVelocityMax.z;+ f32[(ptr + 196) >> 2] = data.speedLimit;+ f32[(ptr + 200) >> 2] = data.limitDampen;+ f32[(ptr + 204) >> 2] = data.noiseStrength;+ f32[(ptr + 208) >> 2] = data.noiseFrequency;+ f32[(ptr + 212) >> 2] = data.noiseScrollSpeed;+ u32[(ptr + 216) >> 2] = data.noiseOctaves | 0;+ u32[(ptr + 220) >> 2] = data.texture;+ u32[(ptr + 224) >> 2] = data.spriteColumns | 0;+ u32[(ptr + 228) >> 2] = data.spriteRows | 0;+ f32[(ptr + 232) >> 2] = data.spriteFPS;+ u8[ptr + 236] = data.spriteLoop ? 1 : 0;+ u32[(ptr + 240) >> 2] = data.blendMode | 0;+ u32[(ptr + 244) >> 2] = data.layer | 0;+ u32[(ptr + 248) >> 2] = data.material;+ u32[(ptr + 252) >> 2] = data.simulationSpace | 0;+ u32[(ptr + 256) >> 2] = data.renderMode | 0;+ f32[(ptr + 260) >> 2] = data.velocityScale;+ f32[(ptr + 264) >> 2] = data.lengthScale;+ u8[ptr + 268] = data.enabled ? 1 : 0;+ u32[(ptr + 272) >> 2] = data.subEmitterTrigger | 0;+ f32[(ptr + 276) >> 2] = data.subEmitterChance;+ f32[(ptr + 280) >> 2] = data.subEmitterInheritVelocity;+ u32[(ptr + 284) >> 2] = data.subEmitter;+ u8[ptr + 288] = data.trailEnabled ? 1 : 0;+ f32[(ptr + 292) >> 2] = data.trailWidth;+ u32[(ptr + 296) >> 2] = data.trailPoints | 0;+ f32[(ptr + 300) >> 2] = data.trailMinDistance;+ u8[ptr + 304] = data.collisionEnabled ? 1 : 0;+ f32[(ptr + 308) >> 2] = data.collisionFloor;+ u32[(ptr + 312) >> 2] = data.collisionMode | 0;+ u32[(ptr + 316) >> 2] = data.collisionMask;+ u32[(ptr + 320) >> 2] = data.collisionQueryBudget | 0;+ f32[(ptr + 324) >> 2] = data.collisionMaxDistance;+ u32[(ptr + 328) >> 2] = data.collisionFallback | 0;+ u8[ptr + 332] = data.collisionEvents ? 1 : 0;+ u32[(ptr + 336) >> 2] = data.collisionEventBudget | 0;+ f32[(ptr + 340) >> 2] = data.collisionBounce;+ f32[(ptr + 344) >> 2] = data.collisionFriction;+ f32[(ptr + 348) >> 2] = data.collisionLifetimeLoss;}export function createParticleEmitterData(): ParticleEmitterPtrData {@@ -1464,6 +1467,7 @@ export function createParticleEmitterData(): ParticleEmitterPtrData {burstCount: 0,burstInterval: 0,duration: 0,+ simulationSpeed: 0,startDelay: 0,looping: false,playOnStart: false,diff --git a/sdk/src/ecs/component.generated.ts b/sdk/src/ecs/component.generated.tsindex e1ab67f35..d67ed7780 100644--- a/sdk/src/ecs/component.generated.ts+++ b/sdk/src/ecs/component.generated.ts@@ -15,7 +15,7 @@ import type { AlignContent, AlignItems, AlignSelf, BodyType, CanvasScaleMode, Cl* getAbiLayoutHash(); BuiltinBridge.connect() compares them and refuses to* run on mismatch, because mismatched offsets read the wrong heap bytes.*/-export const ABI_LAYOUT_HASH = '097d3c7989a498a1';+export const ABI_LAYOUT_HASH = '63a00195ad788bd8';/*** One asset-valued field of a component: which field, and what kind of@@ -704,6 +704,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {burstCount: 0,burstInterval: 1,duration: 5,+ simulationSpeed: 1,startDelay: 0,looping: true,playOnStart: true,@@ -785,6 +786,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {burstCount: { min: 0, step: 1, category: "Emission" },burstInterval: { min: 0, category: "Emission" },duration: { min: 0, category: "Emission" },+ simulationSpeed: { min: 0, tooltip: "How fast this emitter's own time runs: 2 plays it twice as fast, 0.5 at half, 0 holds it. Scales emission, lifetimes and motion alike.", category: "Emission" },startDelay: { min: 0, tooltip: "Seconds after the emitter starts playing before it emits anything. The duration counts from the end of the delay.", category: "Emission" },looping: { category: "Emission" },playOnStart: { category: "Emission" },@@ -1741,6 +1743,7 @@ export interface ParticleEmitterData {burstCount: number;burstInterval: number;duration: number;+ simulationSpeed: number;startDelay: number;looping: boolean;playOnStart: boolean;diff --git a/sdk/src/wasm/ptrLayouts.generated.ts b/sdk/src/wasm/ptrLayouts.generated.tsindex 009213ee4..219297d10 100644--- a/sdk/src/wasm/ptrLayouts.generated.ts+++ b/sdk/src/wasm/ptrLayouts.generated.ts@@ -337,76 +337,77 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'burstCount', type: 'i32', offset: 4 },{ name: 'burstInterval', type: 'f32', offset: 8 },{ name: 'duration', type: 'f32', offset: 12 },- { name: 'startDelay', type: 'f32', offset: 16 },- { name: 'looping', type: 'bool', offset: 20 },- { name: 'playOnStart', type: 'bool', offset: 21 },- { name: 'maxParticles', type: 'i32', offset: 24 },- { name: 'gpuSimulation', type: 'bool', offset: 28 },- { name: 'lifetimeMin', type: 'f32', offset: 32 },- { name: 'lifetimeMax', type: 'f32', offset: 36 },- { name: 'shape', type: 'i32', offset: 40 },- { name: 'shapeRadius', type: 'f32', offset: 44 },- { name: 'shapeSize', type: 'vec3', offset: 48 },- { name: 'shapeAngle', type: 'f32', offset: 60 },- { name: 'speedMin', type: 'f32', offset: 64 },- { name: 'speedMax', type: 'f32', offset: 68 },- { name: 'angleSpreadMin', type: 'f32', offset: 72 },- { name: 'angleSpreadMax', type: 'f32', offset: 76 },- { name: 'startSizeMin', type: 'f32', offset: 80 },- { name: 'startSizeMax', type: 'f32', offset: 84 },- { name: 'endSizeMin', type: 'f32', offset: 88 },- { name: 'endSizeMax', type: 'f32', offset: 92 },- { name: 'sizeEasing', type: 'i32', offset: 96 },- { name: 'startColor', type: 'color', offset: 100 },- { name: 'endColor', type: 'color', offset: 116 },- { name: 'colorEasing', type: 'i32', offset: 132 },- { name: 'rotationMin', type: 'f32', offset: 136 },- { name: 'rotationMax', type: 'f32', offset: 140 },- { name: 'angularVelocityMin', type: 'f32', offset: 144 },- { name: 'angularVelocityMax', type: 'f32', offset: 148 },- { name: 'gravity', type: 'vec3', offset: 152 },- { name: 'damping', type: 'f32', offset: 164 },- { name: 'addedVelocityMin', type: 'vec3', offset: 168 },- { name: 'addedVelocityMax', type: 'vec3', offset: 180 },- { name: 'speedLimit', type: 'f32', offset: 192 },- { name: 'limitDampen', type: 'f32', offset: 196 },- { name: 'noiseStrength', type: 'f32', offset: 200 },- { name: 'noiseFrequency', type: 'f32', offset: 204 },- { name: 'noiseScrollSpeed', type: 'f32', offset: 208 },- { name: 'noiseOctaves', type: 'i32', offset: 212 },- { name: 'texture', type: 'u32', offset: 216 },- { name: 'spriteColumns', type: 'i32', offset: 220 },- { name: 'spriteRows', type: 'i32', offset: 224 },- { name: 'spriteFPS', type: 'f32', offset: 228 },- { name: 'spriteLoop', type: 'bool', offset: 232 },- { name: 'blendMode', type: 'i32', offset: 236 },- { name: 'layer', type: 'i32', offset: 240 },- { name: 'material', type: 'u32', offset: 244 },- { name: 'simulationSpace', type: 'i32', offset: 248 },- { name: 'renderMode', type: 'i32', offset: 252 },- { name: 'velocityScale', type: 'f32', offset: 256 },- { name: 'lengthScale', type: 'f32', offset: 260 },- { name: 'enabled', type: 'bool', offset: 264 },- { name: 'subEmitterTrigger', type: 'i32', offset: 268 },- { name: 'subEmitterChance', type: 'f32', offset: 272 },- { name: 'subEmitterInheritVelocity', type: 'f32', offset: 276 },- { name: 'subEmitter', type: 'u32', offset: 280 },- { name: 'trailEnabled', type: 'bool', offset: 284 },- { name: 'trailWidth', type: 'f32', offset: 288 },- { name: 'trailPoints', type: 'i32', offset: 292 },- { name: 'trailMinDistance', type: 'f32', offset: 296 },- { name: 'collisionEnabled', type: 'bool', offset: 300 },- { name: 'collisionFloor', type: 'f32', offset: 304 },- { name: 'collisionMode', type: 'i32', offset: 308 },- { name: 'collisionMask', type: 'u32', offset: 312 },- { name: 'collisionQueryBudget', type: 'i32', offset: 316 },- { name: 'collisionMaxDistance', type: 'f32', offset: 320 },- { name: 'collisionFallback', type: 'i32', offset: 324 },- { name: 'collisionEvents', type: 'bool', offset: 328 },- { name: 'collisionEventBudget', type: 'i32', offset: 332 },- { name: 'collisionBounce', type: 'f32', offset: 336 },- { name: 'collisionFriction', type: 'f32', offset: 340 },- { name: 'collisionLifetimeLoss', type: 'f32', offset: 344 },+ { name: 'simulationSpeed', type: 'f32', offset: 16 },+ { name: 'startDelay', type: 'f32', offset: 20 },+ { name: 'looping', type: 'bool', offset: 24 },+ { name: 'playOnStart', type: 'bool', offset: 25 },+ { name: 'maxParticles', type: 'i32', offset: 28 },+ { name: 'gpuSimulation', type: 'bool', offset: 32 },+ { name: 'lifetimeMin', type: 'f32', offset: 36 },+ { name: 'lifetimeMax', type: 'f32', offset: 40 },+ { name: 'shape', type: 'i32', offset: 44 },+ { name: 'shapeRadius', type: 'f32', offset: 48 },+ { name: 'shapeSize', type: 'vec3', offset: 52 },+ { name: 'shapeAngle', type: 'f32', offset: 64 },+ { name: 'speedMin', type: 'f32', offset: 68 },+ { name: 'speedMax', type: 'f32', offset: 72 },+ { name: 'angleSpreadMin', type: 'f32', offset: 76 },+ { name: 'angleSpreadMax', type: 'f32', offset: 80 },+ { name: 'startSizeMin', type: 'f32', offset: 84 },+ { name: 'startSizeMax', type: 'f32', offset: 88 },+ { name: 'endSizeMin', type: 'f32', offset: 92 },+ { name: 'endSizeMax', type: 'f32', offset: 96 },+ { name: 'sizeEasing', type: 'i32', offset: 100 },+ { name: 'startColor', type: 'color', offset: 104 },+ { name: 'endColor', type: 'color', offset: 120 },+ { name: 'colorEasing', type: 'i32', offset: 136 },+ { name: 'rotationMin', type: 'f32', offset: 140 },+ { name: 'rotationMax', type: 'f32', offset: 144 },+ { name: 'angularVelocityMin', type: 'f32', offset: 148 },+ { name: 'angularVelocityMax', type: 'f32', offset: 152 },+ { name: 'gravity', type: 'vec3', offset: 156 },+ { name: 'damping', type: 'f32', offset: 168 },+ { name: 'addedVelocityMin', type: 'vec3', offset: 172 },+ { name: 'addedVelocityMax', type: 'vec3', offset: 184 },+ { name: 'speedLimit', type: 'f32', offset: 196 },+ { name: 'limitDampen', type: 'f32', offset: 200 },+ { name: 'noiseStrength', type: 'f32', offset: 204 },+ { name: 'noiseFrequency', type: 'f32', offset: 208 },+ { name: 'noiseScrollSpeed', type: 'f32', offset: 212 },+ { name: 'noiseOctaves', type: 'i32', offset: 216 },+ { name: 'texture', type: 'u32', offset: 220 },+ { name: 'spriteColumns', type: 'i32', offset: 224 },+ { name: 'spriteRows', type: 'i32', offset: 228 },+ { name: 'spriteFPS', type: 'f32', offset: 232 },+ { name: 'spriteLoop', type: 'bool', offset: 236 },+ { name: 'blendMode', type: 'i32', offset: 240 },+ { name: 'layer', type: 'i32', offset: 244 },+ { name: 'material', type: 'u32', offset: 248 },+ { name: 'simulationSpace', type: 'i32', offset: 252 },+ { name: 'renderMode', type: 'i32', offset: 256 },+ { name: 'velocityScale', type: 'f32', offset: 260 },+ { name: 'lengthScale', type: 'f32', offset: 264 },+ { name: 'enabled', type: 'bool', offset: 268 },+ { name: 'subEmitterTrigger', type: 'i32', offset: 272 },+ { name: 'subEmitterChance', type: 'f32', offset: 276 },+ { name: 'subEmitterInheritVelocity', type: 'f32', offset: 280 },+ { name: 'subEmitter', type: 'u32', offset: 284 },+ { name: 'trailEnabled', type: 'bool', offset: 288 },+ { name: 'trailWidth', type: 'f32', offset: 292 },+ { name: 'trailPoints', type: 'i32', offset: 296 },+ { name: 'trailMinDistance', type: 'f32', offset: 300 },+ { name: 'collisionEnabled', type: 'bool', offset: 304 },+ { name: 'collisionFloor', type: 'f32', offset: 308 },+ { name: 'collisionMode', type: 'i32', offset: 312 },+ { name: 'collisionMask', type: 'u32', offset: 316 },+ { name: 'collisionQueryBudget', type: 'i32', offset: 320 },+ { name: 'collisionMaxDistance', type: 'f32', offset: 324 },+ { name: 'collisionFallback', type: 'i32', offset: 328 },+ { name: 'collisionEvents', type: 'bool', offset: 332 },+ { name: 'collisionEventBudget', type: 'i32', offset: 336 },+ { name: 'collisionBounce', type: 'f32', offset: 340 },+ { name: 'collisionFriction', type: 'f32', offset: 344 },+ { name: 'collisionLifetimeLoss', type: 'f32', offset: 348 },],},ParticleForceField: {diff --git a/sdk/src/wasm/wasm.generated.ts b/sdk/src/wasm/wasm.generated.tsindex 4bf56f6ff..ac971e6ca 100644--- a/sdk/src/wasm/wasm.generated.ts+++ b/sdk/src/wasm/wasm.generated.ts@@ -738,6 +738,7 @@ export interface ParticleEmitter {burstCount: number;burstInterval: number;duration: number;+ simulationSpeed: number;startDelay: number;looping: boolean;playOnStart: boolean;diff --git a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snapindex 30dfcc141..d02e4f09e 100644--- a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap+++ b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap@@ -1016,6 +1016,11 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho},],},+ "simulationSpeed": {+ "category": "Emission",+ "min": 0,+ "tooltip": "How fast this emitter's own time runs: 2 plays it twice as fast, 0.5 at half, 0 holds it. Scales emission, lifetimes and motion alike.",+ },"sizeCurve": {"category": "Size","curve": true,diff --git a/src/esengine/aot/EngineDigest.generated.h b/src/esengine/aot/EngineDigest.generated.hindex 3c4aac95b..c336d15da 100644--- a/src/esengine/aot/EngineDigest.generated.h+++ b/src/esengine/aot/EngineDigest.generated.h@@ -6,7 +6,7 @@/* One per address width, because the width is IN the digest: a host thattook the other one would refuse every module built for it. */-#define ES_ENGINE_ABI_DIGEST_32 0xf8803b93f89c650eULL-#define ES_ENGINE_ABI_DIGEST_64 0x2125285699976f62ULL+#define ES_ENGINE_ABI_DIGEST_32 0x105073109860f394ULL+#define ES_ENGINE_ABI_DIGEST_64 0xb71d1ed9cc346220ULL#define ES_ENGINE_ABI_DIGEST \(sizeof(es_addr_t) == 8 ? ES_ENGINE_ABI_DIGEST_64 : ES_ENGINE_ABI_DIGEST_32)diff --git a/src/esengine/bindings/EditorAPI.generated.cpp b/src/esengine/bindings/EditorAPI.generated.cppindex ad5079f34..2c63239d5 100644--- a/src/esengine/bindings/EditorAPI.generated.cpp+++ b/src/esengine/bindings/EditorAPI.generated.cpp@@ -2,10 +2,10 @@* @file EditorAPI.generated.cpp* @brief Auto-generated editor API with string-dispatched component access* @details Generated by EHT - DO NOT EDIT- * @schema_hash 3f55d2569faef078+ * @schema_hash 9262d1e85b95eb6a*/-#define ES_EDITOR_API_SCHEMA_HASH "3f55d2569faef078"+#define ES_EDITOR_API_SCHEMA_HASH "9262d1e85b95eb6a"#include <emscripten/bind.h>#include <string>@@ -462,6 +462,7 @@ std::string editor_getComponentSchema(const std::string& name) {{"key":"burstCount","type":"int","group":"ParticleEmitter"},{"key":"burstInterval","type":"float","group":"ParticleEmitter"},{"key":"duration","type":"float","group":"ParticleEmitter"},+ {"key":"simulationSpeed","type":"float","group":"ParticleEmitter"},{"key":"startDelay","type":"float","group":"ParticleEmitter"},{"key":"looping","type":"bool","group":"ParticleEmitter"},{"key":"playOnStart","type":"bool","group":"ParticleEmitter"},@@ -1568,6 +1569,7 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::sif (field == "rate") { c.rate = value; }else if (field == "burstInterval") { c.burstInterval = value; }else if (field == "duration") { c.duration = value; }+ else if (field == "simulationSpeed") { c.simulationSpeed = value; }else if (field == "startDelay") { c.startDelay = value; }else if (field == "lifetimeMin") { c.lifetimeMin = value; }else if (field == "lifetimeMax") { c.lifetimeMax = value; }@@ -2148,6 +2150,7 @@ f32 editor_getFloat(Registry& reg, u32 e, const std::string& comp, const std::stif (field == "rate") { return c.rate; }else if (field == "burstInterval") { return c.burstInterval; }else if (field == "duration") { return c.duration; }+ else if (field == "simulationSpeed") { return c.simulationSpeed; }else if (field == "startDelay") { return c.startDelay; }else if (field == "lifetimeMin") { return c.lifetimeMin; }else if (field == "lifetimeMax") { return c.lifetimeMax; }diff --git a/src/esengine/bindings/WebBindings.generated.cpp b/src/esengine/bindings/WebBindings.generated.cppindex 5366fbbff..987132316 100644--- a/src/esengine/bindings/WebBindings.generated.cpp+++ b/src/esengine/bindings/WebBindings.generated.cpp@@ -942,6 +942,7 @@ struct ParticleEmitterJS {i32 burstCount;f32 burstInterval;f32 duration;+ f32 simulationSpeed;f32 startDelay;bool looping;bool playOnStart;@@ -1019,6 +1020,7 @@ void particleemitterApplyJS(esengine::ecs::ParticleEmitter& c, const ParticleEmic.burstCount = js.burstCount;c.burstInterval = js.burstInterval;c.duration = js.duration;+ c.simulationSpeed = js.simulationSpeed;c.startDelay = js.startDelay;c.looping = js.looping;c.playOnStart = js.playOnStart;@@ -1103,6 +1105,7 @@ ParticleEmitterJS particleemitterToJS(const esengine::ecs::ParticleEmitter& c) {js.burstCount = c.burstCount;js.burstInterval = c.burstInterval;js.duration = c.duration;+ js.simulationSpeed = c.simulationSpeed;js.startDelay = c.startDelay;js.looping = c.looping;js.playOnStart = c.playOnStart;@@ -2085,6 +2088,7 @@ EMSCRIPTEN_BINDINGS(esengine_components) {.field("burstCount", &ParticleEmitterJS::burstCount).field("burstInterval", &ParticleEmitterJS::burstInterval).field("duration", &ParticleEmitterJS::duration)+ .field("simulationSpeed", &ParticleEmitterJS::simulationSpeed).field("startDelay", &ParticleEmitterJS::startDelay).field("looping", &ParticleEmitterJS::looping).field("playOnStart", &ParticleEmitterJS::playOnStart)@@ -4023,76 +4027,77 @@ static_assert(offsetof(esengine::ecs::ParticleEmitter, rate) == 0, "ABI offset dstatic_assert(offsetof(esengine::ecs::ParticleEmitter, burstCount) == 4, "ABI offset drift: esengine::ecs::ParticleEmitter.burstCount (EHT expected 4)");static_assert(offsetof(esengine::ecs::ParticleEmitter, burstInterval) == 8, "ABI offset drift: esengine::ecs::ParticleEmitter.burstInterval (EHT expected 8)");static_assert(offsetof(esengine::ecs::ParticleEmitter, duration) == 12, "ABI offset drift: esengine::ecs::ParticleEmitter.duration (EHT expected 12)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, startDelay) == 16, "ABI offset drift: esengine::ecs::ParticleEmitter.startDelay (EHT expected 16)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, looping) == 20, "ABI offset drift: esengine::ecs::ParticleEmitter.looping (EHT expected 20)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, playOnStart) == 21, "ABI offset drift: esengine::ecs::ParticleEmitter.playOnStart (EHT expected 21)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, maxParticles) == 24, "ABI offset drift: esengine::ecs::ParticleEmitter.maxParticles (EHT expected 24)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, gpuSimulation) == 28, "ABI offset drift: esengine::ecs::ParticleEmitter.gpuSimulation (EHT expected 28)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, lifetimeMin) == 32, "ABI offset drift: esengine::ecs::ParticleEmitter.lifetimeMin (EHT expected 32)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, lifetimeMax) == 36, "ABI offset drift: esengine::ecs::ParticleEmitter.lifetimeMax (EHT expected 36)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, shape) == 40, "ABI offset drift: esengine::ecs::ParticleEmitter.shape (EHT expected 40)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeRadius) == 44, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeRadius (EHT expected 44)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeSize) == 48, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeSize (EHT expected 48)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeAngle) == 60, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeAngle (EHT expected 60)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, speedMin) == 64, "ABI offset drift: esengine::ecs::ParticleEmitter.speedMin (EHT expected 64)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, speedMax) == 68, "ABI offset drift: esengine::ecs::ParticleEmitter.speedMax (EHT expected 68)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, angleSpreadMin) == 72, "ABI offset drift: esengine::ecs::ParticleEmitter.angleSpreadMin (EHT expected 72)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, angleSpreadMax) == 76, "ABI offset drift: esengine::ecs::ParticleEmitter.angleSpreadMax (EHT expected 76)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, startSizeMin) == 80, "ABI offset drift: esengine::ecs::ParticleEmitter.startSizeMin (EHT expected 80)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, startSizeMax) == 84, "ABI offset drift: esengine::ecs::ParticleEmitter.startSizeMax (EHT expected 84)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, endSizeMin) == 88, "ABI offset drift: esengine::ecs::ParticleEmitter.endSizeMin (EHT expected 88)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, endSizeMax) == 92, "ABI offset drift: esengine::ecs::ParticleEmitter.endSizeMax (EHT expected 92)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, sizeEasing) == 96, "ABI offset drift: esengine::ecs::ParticleEmitter.sizeEasing (EHT expected 96)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, startColor) == 100, "ABI offset drift: esengine::ecs::ParticleEmitter.startColor (EHT expected 100)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, endColor) == 116, "ABI offset drift: esengine::ecs::ParticleEmitter.endColor (EHT expected 116)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, colorEasing) == 132, "ABI offset drift: esengine::ecs::ParticleEmitter.colorEasing (EHT expected 132)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, rotationMin) == 136, "ABI offset drift: esengine::ecs::ParticleEmitter.rotationMin (EHT expected 136)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, rotationMax) == 140, "ABI offset drift: esengine::ecs::ParticleEmitter.rotationMax (EHT expected 140)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, angularVelocityMin) == 144, "ABI offset drift: esengine::ecs::ParticleEmitter.angularVelocityMin (EHT expected 144)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, angularVelocityMax) == 148, "ABI offset drift: esengine::ecs::ParticleEmitter.angularVelocityMax (EHT expected 148)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, gravity) == 152, "ABI offset drift: esengine::ecs::ParticleEmitter.gravity (EHT expected 152)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, damping) == 164, "ABI offset drift: esengine::ecs::ParticleEmitter.damping (EHT expected 164)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, addedVelocityMin) == 168, "ABI offset drift: esengine::ecs::ParticleEmitter.addedVelocityMin (EHT expected 168)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, addedVelocityMax) == 180, "ABI offset drift: esengine::ecs::ParticleEmitter.addedVelocityMax (EHT expected 180)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, speedLimit) == 192, "ABI offset drift: esengine::ecs::ParticleEmitter.speedLimit (EHT expected 192)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, limitDampen) == 196, "ABI offset drift: esengine::ecs::ParticleEmitter.limitDampen (EHT expected 196)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseStrength) == 200, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseStrength (EHT expected 200)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseFrequency) == 204, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseFrequency (EHT expected 204)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseScrollSpeed) == 208, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseScrollSpeed (EHT expected 208)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseOctaves) == 212, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseOctaves (EHT expected 212)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, texture) == 216, "ABI offset drift: esengine::ecs::ParticleEmitter.texture (EHT expected 216)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteColumns) == 220, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteColumns (EHT expected 220)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteRows) == 224, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteRows (EHT expected 224)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteFPS) == 228, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteFPS (EHT expected 228)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteLoop) == 232, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteLoop (EHT expected 232)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, blendMode) == 236, "ABI offset drift: esengine::ecs::ParticleEmitter.blendMode (EHT expected 236)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, layer) == 240, "ABI offset drift: esengine::ecs::ParticleEmitter.layer (EHT expected 240)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, material) == 244, "ABI offset drift: esengine::ecs::ParticleEmitter.material (EHT expected 244)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, simulationSpace) == 248, "ABI offset drift: esengine::ecs::ParticleEmitter.simulationSpace (EHT expected 248)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, renderMode) == 252, "ABI offset drift: esengine::ecs::ParticleEmitter.renderMode (EHT expected 252)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, velocityScale) == 256, "ABI offset drift: esengine::ecs::ParticleEmitter.velocityScale (EHT expected 256)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, lengthScale) == 260, "ABI offset drift: esengine::ecs::ParticleEmitter.lengthScale (EHT expected 260)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, enabled) == 264, "ABI offset drift: esengine::ecs::ParticleEmitter.enabled (EHT expected 264)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterTrigger) == 268, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterTrigger (EHT expected 268)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterChance) == 272, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterChance (EHT expected 272)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterInheritVelocity) == 276, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterInheritVelocity (EHT expected 276)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitter) == 280, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitter (EHT expected 280)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, trailEnabled) == 284, "ABI offset drift: esengine::ecs::ParticleEmitter.trailEnabled (EHT expected 284)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, trailWidth) == 288, "ABI offset drift: esengine::ecs::ParticleEmitter.trailWidth (EHT expected 288)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, trailPoints) == 292, "ABI offset drift: esengine::ecs::ParticleEmitter.trailPoints (EHT expected 292)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, trailMinDistance) == 296, "ABI offset drift: esengine::ecs::ParticleEmitter.trailMinDistance (EHT expected 296)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEnabled) == 300, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEnabled (EHT expected 300)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFloor) == 304, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFloor (EHT expected 304)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMode) == 308, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMode (EHT expected 308)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMask) == 312, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMask (EHT expected 312)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionQueryBudget) == 316, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionQueryBudget (EHT expected 316)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMaxDistance) == 320, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMaxDistance (EHT expected 320)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFallback) == 324, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFallback (EHT expected 324)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEvents) == 328, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEvents (EHT expected 328)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEventBudget) == 332, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEventBudget (EHT expected 332)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionBounce) == 336, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionBounce (EHT expected 336)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFriction) == 340, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFriction (EHT expected 340)");-static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionLifetimeLoss) == 344, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionLifetimeLoss (EHT expected 344)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, simulationSpeed) == 16, "ABI offset drift: esengine::ecs::ParticleEmitter.simulationSpeed (EHT expected 16)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, startDelay) == 20, "ABI offset drift: esengine::ecs::ParticleEmitter.startDelay (EHT expected 20)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, looping) == 24, "ABI offset drift: esengine::ecs::ParticleEmitter.looping (EHT expected 24)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, playOnStart) == 25, "ABI offset drift: esengine::ecs::ParticleEmitter.playOnStart (EHT expected 25)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, maxParticles) == 28, "ABI offset drift: esengine::ecs::ParticleEmitter.maxParticles (EHT expected 28)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, gpuSimulation) == 32, "ABI offset drift: esengine::ecs::ParticleEmitter.gpuSimulation (EHT expected 32)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, lifetimeMin) == 36, "ABI offset drift: esengine::ecs::ParticleEmitter.lifetimeMin (EHT expected 36)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, lifetimeMax) == 40, "ABI offset drift: esengine::ecs::ParticleEmitter.lifetimeMax (EHT expected 40)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, shape) == 44, "ABI offset drift: esengine::ecs::ParticleEmitter.shape (EHT expected 44)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeRadius) == 48, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeRadius (EHT expected 48)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeSize) == 52, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeSize (EHT expected 52)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, shapeAngle) == 64, "ABI offset drift: esengine::ecs::ParticleEmitter.shapeAngle (EHT expected 64)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, speedMin) == 68, "ABI offset drift: esengine::ecs::ParticleEmitter.speedMin (EHT expected 68)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, speedMax) == 72, "ABI offset drift: esengine::ecs::ParticleEmitter.speedMax (EHT expected 72)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, angleSpreadMin) == 76, "ABI offset drift: esengine::ecs::ParticleEmitter.angleSpreadMin (EHT expected 76)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, angleSpreadMax) == 80, "ABI offset drift: esengine::ecs::ParticleEmitter.angleSpreadMax (EHT expected 80)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, startSizeMin) == 84, "ABI offset drift: esengine::ecs::ParticleEmitter.startSizeMin (EHT expected 84)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, startSizeMax) == 88, "ABI offset drift: esengine::ecs::ParticleEmitter.startSizeMax (EHT expected 88)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, endSizeMin) == 92, "ABI offset drift: esengine::ecs::ParticleEmitter.endSizeMin (EHT expected 92)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, endSizeMax) == 96, "ABI offset drift: esengine::ecs::ParticleEmitter.endSizeMax (EHT expected 96)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, sizeEasing) == 100, "ABI offset drift: esengine::ecs::ParticleEmitter.sizeEasing (EHT expected 100)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, startColor) == 104, "ABI offset drift: esengine::ecs::ParticleEmitter.startColor (EHT expected 104)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, endColor) == 120, "ABI offset drift: esengine::ecs::ParticleEmitter.endColor (EHT expected 120)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, colorEasing) == 136, "ABI offset drift: esengine::ecs::ParticleEmitter.colorEasing (EHT expected 136)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, rotationMin) == 140, "ABI offset drift: esengine::ecs::ParticleEmitter.rotationMin (EHT expected 140)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, rotationMax) == 144, "ABI offset drift: esengine::ecs::ParticleEmitter.rotationMax (EHT expected 144)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, angularVelocityMin) == 148, "ABI offset drift: esengine::ecs::ParticleEmitter.angularVelocityMin (EHT expected 148)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, angularVelocityMax) == 152, "ABI offset drift: esengine::ecs::ParticleEmitter.angularVelocityMax (EHT expected 152)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, gravity) == 156, "ABI offset drift: esengine::ecs::ParticleEmitter.gravity (EHT expected 156)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, damping) == 168, "ABI offset drift: esengine::ecs::ParticleEmitter.damping (EHT expected 168)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, addedVelocityMin) == 172, "ABI offset drift: esengine::ecs::ParticleEmitter.addedVelocityMin (EHT expected 172)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, addedVelocityMax) == 184, "ABI offset drift: esengine::ecs::ParticleEmitter.addedVelocityMax (EHT expected 184)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, speedLimit) == 196, "ABI offset drift: esengine::ecs::ParticleEmitter.speedLimit (EHT expected 196)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, limitDampen) == 200, "ABI offset drift: esengine::ecs::ParticleEmitter.limitDampen (EHT expected 200)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseStrength) == 204, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseStrength (EHT expected 204)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseFrequency) == 208, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseFrequency (EHT expected 208)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseScrollSpeed) == 212, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseScrollSpeed (EHT expected 212)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, noiseOctaves) == 216, "ABI offset drift: esengine::ecs::ParticleEmitter.noiseOctaves (EHT expected 216)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, texture) == 220, "ABI offset drift: esengine::ecs::ParticleEmitter.texture (EHT expected 220)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteColumns) == 224, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteColumns (EHT expected 224)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteRows) == 228, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteRows (EHT expected 228)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteFPS) == 232, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteFPS (EHT expected 232)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, spriteLoop) == 236, "ABI offset drift: esengine::ecs::ParticleEmitter.spriteLoop (EHT expected 236)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, blendMode) == 240, "ABI offset drift: esengine::ecs::ParticleEmitter.blendMode (EHT expected 240)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, layer) == 244, "ABI offset drift: esengine::ecs::ParticleEmitter.layer (EHT expected 244)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, material) == 248, "ABI offset drift: esengine::ecs::ParticleEmitter.material (EHT expected 248)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, simulationSpace) == 252, "ABI offset drift: esengine::ecs::ParticleEmitter.simulationSpace (EHT expected 252)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, renderMode) == 256, "ABI offset drift: esengine::ecs::ParticleEmitter.renderMode (EHT expected 256)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, velocityScale) == 260, "ABI offset drift: esengine::ecs::ParticleEmitter.velocityScale (EHT expected 260)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, lengthScale) == 264, "ABI offset drift: esengine::ecs::ParticleEmitter.lengthScale (EHT expected 264)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, enabled) == 268, "ABI offset drift: esengine::ecs::ParticleEmitter.enabled (EHT expected 268)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterTrigger) == 272, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterTrigger (EHT expected 272)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterChance) == 276, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterChance (EHT expected 276)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitterInheritVelocity) == 280, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitterInheritVelocity (EHT expected 280)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, subEmitter) == 284, "ABI offset drift: esengine::ecs::ParticleEmitter.subEmitter (EHT expected 284)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, trailEnabled) == 288, "ABI offset drift: esengine::ecs::ParticleEmitter.trailEnabled (EHT expected 288)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, trailWidth) == 292, "ABI offset drift: esengine::ecs::ParticleEmitter.trailWidth (EHT expected 292)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, trailPoints) == 296, "ABI offset drift: esengine::ecs::ParticleEmitter.trailPoints (EHT expected 296)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, trailMinDistance) == 300, "ABI offset drift: esengine::ecs::ParticleEmitter.trailMinDistance (EHT expected 300)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEnabled) == 304, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEnabled (EHT expected 304)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFloor) == 308, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFloor (EHT expected 308)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMode) == 312, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMode (EHT expected 312)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMask) == 316, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMask (EHT expected 316)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionQueryBudget) == 320, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionQueryBudget (EHT expected 320)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionMaxDistance) == 324, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionMaxDistance (EHT expected 324)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFallback) == 328, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFallback (EHT expected 328)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEvents) == 332, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEvents (EHT expected 332)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionEventBudget) == 336, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionEventBudget (EHT expected 336)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionBounce) == 340, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionBounce (EHT expected 340)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionFriction) == 344, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionFriction (EHT expected 344)");+static_assert(offsetof(esengine::ecs::ParticleEmitter, collisionLifetimeLoss) == 348, "ABI offset drift: esengine::ecs::ParticleEmitter.collisionLifetimeLoss (EHT expected 348)");static_assert(offsetof(esengine::ecs::ParticleForceField, type) == 0, "ABI offset drift: esengine::ecs::ParticleForceField.type (EHT expected 0)");static_assert(offsetof(esengine::ecs::ParticleForceField, strength) == 4, "ABI offset drift: esengine::ecs::ParticleForceField.strength (EHT expected 4)");static_assert(offsetof(esengine::ecs::ParticleForceField, radius) == 8, "ABI offset drift: esengine::ecs::ParticleForceField.radius (EHT expected 8)");@@ -4290,7 +4295,7 @@ static_assert(offsetof(esengine::ecs::Velocity, angular) == 12, "ABI offset drif// ABI Hash -- runtime handshake against the SDK bundle// =============================================================================-static const char* kEsAbiLayoutHash = "097d3c7989a498a1";+static const char* kEsAbiLayoutHash = "63a00195ad788bd8";std::string esengineGetAbiLayoutHash() {return std::string(kEsAbiLayoutHash);diff --git a/src/esengine/ecs/components/ParticleEmitter.hpp b/src/esengine/ecs/components/ParticleEmitter.hppindex 3d7d034d2..70efc5179 100644--- a/src/esengine/ecs/components/ParticleEmitter.hpp+++ b/src/esengine/ecs/components/ParticleEmitter.hpp@@ -83,6 +83,9 @@ struct ParticleEmitter {ES_PROPERTY(min=0, category=Emission)f32 duration{5.0f};+ ES_PROPERTY(min=0, category=Emission, tooltip="How fast this emitter's own time runs: 2 plays it twice as fast, 0.5 at half, 0 holds it. Scales emission, lifetimes and motion alike.")+ f32 simulationSpeed{1.0f};+ES_PROPERTY(min=0, category=Emission, tooltip="Seconds after the emitter starts playing before it emits anything. The duration counts from the end of the delay.")f32 startDelay{0.0f};diff --git a/src/esengine/particle/ParticleSystem.cpp b/src/esengine/particle/ParticleSystem.cppindex e87078a6b..b899233dc 100644--- a/src/esengine/particle/ParticleSystem.cpp+++ b/src/esengine/particle/ParticleSystem.cpp@@ -20,11 +20,11 @@ void ParticleSystem::reseedFrom(const esengine::RandomSource& source) {rng_ = source.stream(kRandomStream);}-void ParticleSystem::update(ecs::Registry& registry, f32 dt) {+void ParticleSystem::update(ecs::Registry& registry, f32 frameDt) {collision_queries_.clear(); collision_pending_.clear(); collision_events_.clear();collision_stats_.clear(); collision_cameras_.clear();event_attempts_ = 0; collision_child_bursts_ = 0;- if (!std::isfinite(dt) || dt < 0) return;+ if (!std::isfinite(frameDt) || frameDt < 0) return;auto cameras = registry.activeView<ecs::Camera, ecs::Transform>();for (auto entity : cameras) {if (!cameras.get<ecs::Camera>(entity).isActive) continue;@@ -86,6 +86,8 @@ void ParticleSystem::update(ecs::Registry& registry, f32 dt) {if (!emitter.enabled) {continue;}+ // The emitter's own time: it runs at its simulation speed, so everything below (emission, ageing, motion) follows it.+ const f32 dt = frameDt * std::max(emitter.simulationSpeed, 0.0f);// A GPU emitter keeps no pool: its particles live in a GPU ring. Where the device cannot compute it// is an ordinary emitter, capped so a million-particle setup cannot take the CPU down with it.diff --git a/tests/aot/generated/conformance/handshake.h b/tests/aot/generated/conformance/handshake.hindex 2e3e845f1..73a9240cb 100644--- a/tests/aot/generated/conformance/handshake.h+++ b/tests/aot/generated/conformance/handshake.h@@ -1,5 +1,5 @@/* GENERATED by sdk/tests/aot-conformance.test.ts — do not edit. *//* The contract half of the handshake. The width half is the harness. */-#define ES_CONF_EXPECTED_CONTRACT_HASH 0x2125285699976f62ULL+#define ES_CONF_EXPECTED_CONTRACT_HASH 0xb71d1ed9cc346220ULL/* And which BUILD the artifact beside this one is. */#define ES_CONF_EXPECTED_MODULE_CONTRACT 0xc3d0e057d5701a2eULLdiff --git a/tests/aot/generated/conformance/systems_decl.c b/tests/aot/generated/conformance/systems_decl.cindex d8784a64f..6ae19b4e7 100644--- a/tests/aot/generated/conformance/systems_decl.c+++ b/tests/aot/generated/conformance/systems_decl.c@@ -10,7 +10,7 @@answer, it is a read of a different field. The address width belongsto the MACHINE, so it mixes in here rather than in the compiler and a32-bit artifact cannot load into a 64-bit host. */-#define ES_ABI_ENGINE_DIGEST 0x2125285699976f62ULL+#define ES_ABI_ENGINE_DIGEST 0xb71d1ed9cc346220ULLES_EXPORT const uint64_t es_abi_hash =ES_ABI_ENGINE_DIGEST ^ (0x9e3779b97f4a7c15ULL * (uint64_t)sizeof(es_addr_t));diff --git a/tests/aot/generated/move_system_decl.c b/tests/aot/generated/move_system_decl.cindex ea8691dd5..281467dd0 100644--- a/tests/aot/generated/move_system_decl.c+++ b/tests/aot/generated/move_system_decl.c@@ -10,7 +10,7 @@answer, it is a read of a different field. The address width belongsto the MACHINE, so it mixes in here rather than in the compiler and a32-bit artifact cannot load into a 64-bit host. */-#define ES_ABI_ENGINE_DIGEST 0x2125285699976f62ULL+#define ES_ABI_ENGINE_DIGEST 0xb71d1ed9cc346220ULLES_EXPORT const uint64_t es_abi_hash =ES_ABI_ENGINE_DIGEST ^ (0x9e3779b97f4a7c15ULL * (uint64_t)sizeof(es_addr_t));diff --git a/tests/aot/generated/move_system_hash.h b/tests/aot/generated/move_system_hash.hindex fef966e24..87a43d58f 100644--- a/tests/aot/generated/move_system_hash.h+++ b/tests/aot/generated/move_system_hash.h@@ -1,6 +1,6 @@/* GENERATED by @estella/compiler — do not edit. *//* The contract half of the handshake. The width half is the harness. */-#define ES_EXPECTED_CONTRACT_HASH 0x2125285699976f62ULL+#define ES_EXPECTED_CONTRACT_HASH 0xb71d1ed9cc346220ULL/* And which BUILD the artifact beside this one is, which the sidecarwritten with it has to carry too. */#define ES_EXPECTED_MODULE_CONTRACT 0x10bf77bb714ea1e3ULLdiff --git a/tests/particle/test_particle.cpp b/tests/particle/test_particle.cppindex 06b8937bf..464983ce9 100644--- a/tests/particle/test_particle.cpp+++ b/tests/particle/test_particle.cpp@@ -379,6 +379,31 @@ TEST_CASE("system_speed_limit_holds_a_fast_particle_to_the_limit") {CHECK(speed == doctest::Approx(10.0f).epsilon(0.01));}+TEST_CASE("system_simulation_speed_runs_the_emitters_own_time") {+ auto spawned = [](f32 speed) {+ ecs::Registry registry;+ ParticleSystem system;+ Entity e = registry.create();+ registry.emplace<ecs::Transform>(e);+ auto& emitter = registry.emplace<ecs::ParticleEmitter>(e);+ emitter.rate = 100.0f;+ emitter.lifetimeMin = 100.0f;+ emitter.lifetimeMax = 100.0f;+ emitter.maxParticles = 10000;+ emitter.simulationSpeed = speed;+ emitter.enabled = true;+ emitter.playOnStart = true;+ system.update(registry, 0.5f);+ system.update(registry, 0.5f);+ return system.totalAliveParticles();+ };+ const u32 normal = spawned(1.0f);+ CHECK(normal > 0u);+ CHECK_EQ(spawned(2.0f), normal * 2);+ CHECK(spawned(0.5f) <= normal / 2 + 1);+ CHECK_EQ(spawned(0.0f), 0u);+}+TEST_CASE("system_disabled_emitter_no_spawn") {ecs::Registry registry;ParticleSystem system;diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex cb902d833..d78926788 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -28,6 +28,8 @@ export const NOTES_FLOOR = 'v0.65.0';* the reader recognises anyway.*/export const NOTED = {+ 'feat(particle): an emitter has its own simulation speed, and the Cocos simulation speed, noise, trail and burst time map onto the emitter':+ {"note":"An emitter runs on its own clock."},'feat(cocos): PageView, PageViewIndicator, ScrollBar, SafeArea and WebView components, and the importer maps SpriteRenderer, Spine skeletons, ParticleSystem2D, Terrain and the players and animators whose clip or graph is missing':{"internal":"The Cocos Creator compatibility layer and importer have not shipped; nothing a creator reaches without opting in."},'feat(cocos): BoxCollider maps to the engine box collider with a static body, Line is a component over the engine vector path, Graphics builds its mesh with it (polygon fills, joins and caps), and a sprite whose frame is missing stays, switched off':