@forgeax/engine-fbx 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,21 +19,20 @@ FBX bytes -> ufbx (wasm) -> JSON POD -> parse-*.ts -> meta.json
19
19
  ## AI user consumption path
20
20
 
21
21
  The importer key `'fbx'` is unchanged from the SDK era -- zero migration for
22
- existing `.fbx.meta.json` sidecars. The host installs the Scene owner decoder
23
- and loads the published payload by its typed kind:
22
+ existing `.fbx.meta.json` sidecars. The engine resolves the importer
23
+ automatically via `loadByGuid`:
24
24
 
25
25
  ```ts
26
- import { sceneAssetKind } from '@forgeax/engine-scene';
26
+ // 1) Point the asset registry at the pack index
27
+ assets.configurePackIndex('/pack-index.json');
27
28
 
28
- // 1) load the Pack payload through the typed Scene owner
29
- const res = await assets.load(guid, sceneAssetKind);
29
+ // 2) loadByGuid dispatches on meta.importer: 'fbx' automatically
30
+ const res = await assets.loadByGuid<SceneAsset>(guid);
30
31
  if (!res.ok) {
31
32
  console.error(res.error.code, res.error.hint);
32
33
  return;
33
34
  }
34
- // 2) World owns the shared ref and performs the scene instantiation
35
- const scene = world.internSharedRef('SceneAsset', res.value);
36
- const root = world.instantiateScene(scene);
35
+ const scene = res.value; // SceneAsset -- ready for instantiate()
37
36
  ```
38
37
 
39
38
  Under the hood, `vite-plugin-pack` calls `fbxImporter.import(ctx)` which
@@ -97,18 +96,11 @@ Do not copy-paste the member list; inspect the source for the current union.
97
96
 
98
97
  ## Contributor toolchain
99
98
 
100
- > [!NOTE]
101
- > A source tree containing `.forgeax-public-distribution` is the public SDK
102
- > source mode. It already carries the checked `pkg/` closure, so ordinary SDK
103
- > install/build work does not need `fetch-wasm`, emcc, or a network connection.
104
- > Rebuild the bundle only when the FBX WASM source or toolchain changes. The
105
- > fetch/build paths below describe a contributor checkout.
106
-
107
99
  <details>
108
100
  <summary>Getting pre-built WASM (fetch-wasm)</summary>
109
101
 
110
- In a contributor checkout, the `pkg/` directory is **not committed to git**
111
- (zero-binary invariant). A workspace `pnpm install` or `bun install` runs a package-local, best-effort
102
+ The `pkg/` directory is **not committed to git** (zero-binary invariant). A
103
+ workspace `pnpm install` or `bun install` runs a package-local, best-effort
112
104
  postinstall hook that fetches the matching bundle when it is absent. The hook
113
105
  is idempotent and non-fatal: it skips a complete `pkg/`, and an unavailable
114
106
  release leaves installation successful with the explicit recovery command