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.

fix(sdk): the 3D solver's resource is reachable from the main entry, like the other three

esenginef10b44c1a8c2
diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.md
index 0e31f5f4c..f7fe252ba 100644
--- a/sdk/etc/index.api.md
+++ b/sdk/etc/index.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1647 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1650 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
@@ -5804,6 +5804,11 @@ restitutionThreshold: number | undefined
subStepCount: number | undefined
```
+## Physics3D — const @experimental
+```
+ResourceDef<Physics3DQueries | null>
+```
+
## Physics3DDebugDraw — const @experimental
```
ResourceDef<Physics3DDebugDrawConfig>
@@ -5816,6 +5821,20 @@ showColliders: boolean
showContacts: boolean
```
+## Physics3DEvents — const @experimental
+```
+ResourceDef<Physics3DEventsData>
+```
+
+## Physics3DPlugin — class @experimental
+```
+build: (app: App) => void
+cleanup: () => void
+name: string
+static new (wasmUrl: string, config?: Partial<Physics3DConfig>, factory?: Physics3DModuleFactory): Physics3DPlugin
+static prototype: Physics3DPlugin
+```
+
## PhysicsModuleFactory — type @experimental
```
(config?: Record<string, unknown>) => Promise<PhysicsWasmModule>
diff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.md
index f6e0b455a..a692db767 100644
--- a/sdk/etc/index.native.api.md
+++ b/sdk/etc/index.native.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.native
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 89 beta · 1666 experimental · 3 deprecated
+Symbols: 113 public · 89 beta · 1669 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
@@ -5987,6 +5987,11 @@ restitutionThreshold: number | undefined
subStepCount: number | undefined
```
+## Physics3D — const @experimental
+```
+ResourceDef<Physics3DQueries | null>
+```
+
## Physics3DDebugDraw — const @experimental
```
ResourceDef<Physics3DDebugDrawConfig>
@@ -5999,6 +6004,20 @@ showColliders: boolean
showContacts: boolean
```
+## Physics3DEvents — const @experimental
+```
+ResourceDef<Physics3DEventsData>
+```
+
+## Physics3DPlugin — class @experimental
+```
+build: (app: App) => void
+cleanup: () => void
+name: string
+static new (wasmUrl: string, config?: Partial<Physics3DConfig>, factory?: Physics3DModuleFactory): Physics3DPlugin
+static prototype: Physics3DPlugin
+```
+
## PhysicsModuleFactory — type @experimental
```
(config?: Record<string, unknown>) => Promise<PhysicsWasmModule>
diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.md
index f83a87df6..36d054728 100644
--- a/sdk/etc/index.node.api.md
+++ b/sdk/etc/index.node.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.node
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 86 beta · 1646 experimental · 3 deprecated
+Symbols: 113 public · 86 beta · 1649 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -5799,6 +5799,11 @@ restitutionThreshold: number | undefined
subStepCount: number | undefined
```
+## Physics3D — const @experimental
+```
+ResourceDef<Physics3DQueries | null>
+```
+
## Physics3DDebugDraw — const @experimental
```
ResourceDef<Physics3DDebugDrawConfig>
@@ -5811,6 +5816,20 @@ showColliders: boolean
showContacts: boolean
```
+## Physics3DEvents — const @experimental
+```
+ResourceDef<Physics3DEventsData>
+```
+
+## Physics3DPlugin — class @experimental
+```
+build: (app: App) => void
+cleanup: () => void
+name: string
+static new (wasmUrl: string, config?: Partial<Physics3DConfig>, factory?: Physics3DModuleFactory): Physics3DPlugin
+static prototype: Physics3DPlugin
+```
+
## PhysicsModuleFactory — type @experimental
```
(config?: Record<string, unknown>) => Promise<PhysicsWasmModule>
diff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.md
index 1d36d294c..35482e1b6 100644
--- a/sdk/etc/minigame.api.md
+++ b/sdk/etc/minigame.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/minigame
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1668 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1671 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -6045,6 +6045,11 @@ restitutionThreshold: number | undefined
subStepCount: number | undefined
```
+## Physics3D — const @experimental
+```
+ResourceDef<Physics3DQueries | null>
+```
+
## Physics3DDebugDraw — const @experimental
```
ResourceDef<Physics3DDebugDrawConfig>
@@ -6057,6 +6062,20 @@ showColliders: boolean
showContacts: boolean
```
+## Physics3DEvents — const @experimental
+```
+ResourceDef<Physics3DEventsData>
+```
+
+## Physics3DPlugin — class @experimental
+```
+build: (app: App) => void
+cleanup: () => void
+name: string
+static new (wasmUrl: string, config?: Partial<Physics3DConfig>, factory?: Physics3DModuleFactory): Physics3DPlugin
+static prototype: Physics3DPlugin
+```
+
## PhysicsModuleFactory — type @experimental
```
(config?: Record<string, unknown>) => Promise<PhysicsWasmModule>
diff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.md
index 397fc98f6..60e7e9fc1 100644
--- a/sdk/etc/wechat.api.md
+++ b/sdk/etc/wechat.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/wechat
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1658 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1661 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -5806,6 +5806,11 @@ restitutionThreshold: number | undefined
subStepCount: number | undefined
```
+## Physics3D — const @experimental
+```
+ResourceDef<Physics3DQueries | null>
+```
+
## Physics3DDebugDraw — const @experimental
```
ResourceDef<Physics3DDebugDrawConfig>
@@ -5818,6 +5823,20 @@ showColliders: boolean
showContacts: boolean
```
+## Physics3DEvents — const @experimental
+```
+ResourceDef<Physics3DEventsData>
+```
+
+## Physics3DPlugin — class @experimental
+```
+build: (app: App) => void
+cleanup: () => void
+name: string
+static new (wasmUrl: string, config?: Partial<Physics3DConfig>, factory?: Physics3DModuleFactory): Physics3DPlugin
+static prototype: Physics3DPlugin
+```
+
## PhysicsModuleFactory — type @experimental
```
(config?: Record<string, unknown>) => Promise<PhysicsWasmModule>
diff --git a/sdk/src/core-plugins.ts b/sdk/src/core-plugins.ts
index 2ba57f315..9943acf96 100644
--- a/sdk/src/core-plugins.ts
+++ b/sdk/src/core-plugins.ts
@@ -37,6 +37,10 @@ export { Physics2DPlugin, Physics2DEvents, Physics2D, loadPhysicsModule } from '
// game code) must be able to spell `trigger_enter` without importing the side
// module, since the wire is authored whether or not physics is loaded.
export { Physics2DEventType, type Physics2DContactEventData } from './physics';
+// Beside the 2D solver's and for its reason: the native host maps every
+// `esengine/*` import onto ONE global, so a symbol the main entry does not carry
+// reaches a game that imports the subpath as `undefined`.
+export { Physics3DPlugin, Physics3DEvents, Physics3D } from './physics3d';
export { SpinePlugin, SpineEvents, Spine } from './spine';
// DragonBones beside it, and in the barrel for the same reason: the native entry
// collapses every `esengine*` import onto ONE global, so a game reaching