Skip to content

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.

chore(api): refresh the surface snapshots for the composition seam

esengined0b4a321134a
diff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.md
index 50ccf9be1..9552c7358 100644
--- a/sdk/etc/index.native.api.md
+++ b/sdk/etc/index.native.api.md
@@ -6501,7 +6501,7 @@ static prototype: QueryInstance<any>
## REGISTRY_BINDINGS — const @experimental
```
-{ readonly createEntity: "es_createEntity"; readonly destroyEntity: "es_destroyEntity"; readonly setParent: "es_setParent"; readonly hasParent: "es_hasParent"; readonly getParent: "es_getParent"; readonly removeParent: "es_removeParent"; readonly hasChildren: "es_hasChildren"; readonly getChildren: "es_getChildren"; readonly getMeshSkinJoints: "es_getMeshSkinJoints"; readonly setMeshSkinJoints: "es_setMeshSkinJoints"; readonly layoutEpoch: "es_registryLayoutEpoch"; }
+{ readonly createEntity: "es_createEntity"; readonly destroyEntity: "es_destroyEntity"; readonly setParent: "es_setParent"; readonly hasParent: "es_hasParent"; readonly getParent: "es_getParent"; readonly removeParent: "es_removeParent"; readonly hasChildren: "es_hasChildren"; readonly getChildren: "es_getChildren"; readonly getMeshSkinJoints: "es_getMeshSkinJoints"; readonly setMeshSkinJoints: "es_setMeshSkinJoints"; readonly layoutEpoch: "es_registryLayoutEpoch"; readonly transformEpoch: "es_transformEpochBuffer"; readonly ensureComposed: "es_transformEnsureComposed"; }
```
## RENAMED_COMPONENT_TYPES — const @experimental
diff --git a/sdk/etc/wasm.api.md b/sdk/etc/wasm.api.md
index 2bef30215..33bb67279 100644
--- a/sdk/etc/wasm.api.md
+++ b/sdk/etc/wasm.api.md
@@ -423,6 +423,7 @@ tilemap_setTile: ((entity: number, x: number, y: number, tileId: number) => void
tilemap_setTiles: ((entity: number, tilesPtr: number, count: number) => void) | undefined
trail_clear: ((registry: CppRegistry, entity: number) => void) | undefined
trail_update: ((registry: CppRegistry, dt: number) => void) | undefined
+transform_composeCollecting: ((registry: CppRegistry) => { ran: boolean; visited: number; changed: number; ptr: number; }) | undefined
transform_ensureComposed: ((registry: CppRegistry) => void) | undefined
transform_epochAddress: (() => number) | undefined
transform_update: (registry: CppRegistry) => void
diff --git a/sdk/src/physics/PhysicsSystem.ts b/sdk/src/physics/PhysicsSystem.ts
index 46b7de4fc..ee53493c5 100644
--- a/sdk/src/physics/PhysicsSystem.ts
+++ b/sdk/src/physics/PhysicsSystem.ts
@@ -483,17 +483,15 @@ export function applyPhysics2DTransforms(
// paths get from the registry for free: the body may name an entity that
// is gone, or one that never carried a Transform.
if (!app.world.valid(entityId) || !app.world.has(entityId, Transform)) continue;
- // This path REPLACES the whole component, so the composed fields have to
- // be carried across as they stand: a value from this loop would be this
- // path authoring them.
+ // This path REPLACES the whole component, so the composed fields ride
+ // along as they stand rather than being authored here. Copied, because
+ // editing what `get` answered is a write nothing observes.
const current = app.world.get(entityId, Transform) as TransformData;
- current.position.x = localX;
- current.position.y = localY;
- current.rotation.w = cosH;
- current.rotation.x = 0;
- current.rotation.y = 0;
- current.rotation.z = sinH;
- addFn!(entityId, current);
+ addFn!(entityId, {
+ ...current,
+ position: { x: localX, y: localY, z: 0 },
+ rotation: { w: cosH, x: 0, y: 0, z: sinH },
+ });
}
}