@rydr/game-sdk 1.9.0 → 1.13.0
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 +25 -4
- package/dist/client/HardwareStore.d.ts +48 -2
- package/dist/client/HardwareStore.d.ts.map +1 -1
- package/dist/client/HardwareStore.js +51 -1
- package/dist/client/HardwareStore.js.map +1 -1
- package/dist/client/PlatformClient.d.ts +70 -5
- package/dist/client/PlatformClient.d.ts.map +1 -1
- package/dist/client/PlatformClient.js +55 -3
- package/dist/client/PlatformClient.js.map +1 -1
- package/dist/host/PlatformHost.d.ts +34 -3
- package/dist/host/PlatformHost.d.ts.map +1 -1
- package/dist/host/PlatformHost.js +29 -0
- package/dist/host/PlatformHost.js.map +1 -1
- package/dist/protocol/guards.d.ts.map +1 -1
- package/dist/protocol/guards.js +2 -0
- package/dist/protocol/guards.js.map +1 -1
- package/dist/protocol/messages.d.ts +71 -5
- package/dist/protocol/messages.d.ts.map +1 -1
- package/dist/protocol/version.d.ts +2 -2
- package/dist/protocol/version.d.ts.map +1 -1
- package/dist/protocol/version.js +4 -2
- package/dist/protocol/version.js.map +1 -1
- package/dist/protocol/worlds.d.ts +2 -2
- package/dist/protocol/worlds.d.ts.map +1 -1
- package/dist/protocol/worlds.js +1 -1
- package/dist/three/index.d.ts +9 -0
- package/dist/three/index.d.ts.map +1 -0
- package/dist/three/index.js +9 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/world-loader.d.ts +53 -0
- package/dist/three/world-loader.d.ts.map +1 -0
- package/dist/three/world-loader.js +110 -0
- package/dist/three/world-loader.js.map +1 -0
- package/dist/world-runtime.d.ts +3 -3
- package/dist/world-runtime.d.ts.map +1 -1
- package/dist/world-runtime.js.map +1 -1
- package/package.json +15 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* world-loader — opinionated three.js helper for loading a platform {@link CoreWorld} into a scene.
|
|
3
|
+
*
|
|
4
|
+
* The SDK core ({@link applyWorld}) is deliberately renderer-agnostic: it walks a `CoreWorld` and calls
|
|
5
|
+
* back a `loadGlb(url)` you provide, never touching `three`. This module is the **three-aware layer on
|
|
6
|
+
* top** — it owns a `GLTFLoader` + DRACO decoder and the caching every game was otherwise copy-pasting,
|
|
7
|
+
* so it lives behind the optional `@rydr/game-sdk/three` entry point (with `three` as a peer
|
|
8
|
+
* dependency) and never burdens games that don't render 3D.
|
|
9
|
+
*
|
|
10
|
+
* Two caches make repeated loads cheap:
|
|
11
|
+
* - **Per-URL GLB dedup** ({@link createGlbLoader}): each glb is fetched + DRACO-decoded once per
|
|
12
|
+
* assembly; repeated placements of the same prop get a `.clone()` (shared geometry/material). This
|
|
13
|
+
* also keeps `applyWorld`'s "add each object to the group" correct — the same Object3D instance
|
|
14
|
+
* can't be added to a parent twice.
|
|
15
|
+
* - **Per-world assembled-group cache** ({@link loadWorldGroup}, keyed by {@link CoreWorld.id}): a
|
|
16
|
+
* platform world is a static environment, so once built it is reused across game/runtime instances
|
|
17
|
+
* (replays, level restarts, missions sharing a world) instead of being re-fetched, re-decoded,
|
|
18
|
+
* re-uploaded to the GPU and re-shader-compiled every time. Callers detach the group from their
|
|
19
|
+
* scene on teardown but must **not** dispose its geometry/materials — the cache owns them. Use
|
|
20
|
+
* {@link clearWorldCache} to release them when cycling through many large worlds.
|
|
21
|
+
*/
|
|
22
|
+
import * as THREE from "three";
|
|
23
|
+
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
|
24
|
+
import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
|
|
25
|
+
import { applyWorld } from "../world-runtime.js";
|
|
26
|
+
/** DRACO decoder — pinned to the same version the platform world editor uses. */
|
|
27
|
+
export const DRACO_DECODER_PATH = "https://www.gstatic.com/draco/versioned/decoders/1.5.6/";
|
|
28
|
+
/**
|
|
29
|
+
* A `loadGlb` callback for {@link applyWorld}: fetches a glb by URL and resolves to its root scene.
|
|
30
|
+
*
|
|
31
|
+
* The returned closure shares one `GLTFLoader` + DRACO decoder across all URLs and fetches +
|
|
32
|
+
* DRACO-decodes each URL **once** — repeated URLs resolve to a lightweight `.clone()` (shared
|
|
33
|
+
* geometry/material) rather than re-downloading and re-decoding. Cloning is also required for
|
|
34
|
+
* correctness: `applyWorld` adds every returned object to the group, and a single Object3D can't be
|
|
35
|
+
* parented twice.
|
|
36
|
+
*/
|
|
37
|
+
export function createGlbLoader(opts = {}) {
|
|
38
|
+
const loader = new GLTFLoader();
|
|
39
|
+
const draco = new DRACOLoader();
|
|
40
|
+
draco.setDecoderPath(opts.dracoDecoderPath ?? DRACO_DECODER_PATH);
|
|
41
|
+
loader.setDRACOLoader(draco);
|
|
42
|
+
const decoded = new Map();
|
|
43
|
+
return (url) => {
|
|
44
|
+
let p = decoded.get(url);
|
|
45
|
+
if (!p) {
|
|
46
|
+
p = loader.loadAsync(url).then((g) => g.scene);
|
|
47
|
+
decoded.set(url, p);
|
|
48
|
+
}
|
|
49
|
+
return p.then((scene) => scene.clone());
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Assembled worlds, keyed by {@link CoreWorld.id}. See the module doc for the lifecycle contract. */
|
|
53
|
+
const worldGroupCache = new Map();
|
|
54
|
+
/**
|
|
55
|
+
* Load a platform world's meshes into a group at identity, cached by world id. The caller adds the
|
|
56
|
+
* returned group to its scene and detaches it on teardown **without disposing it** (the cache owns the
|
|
57
|
+
* geometry/materials, so the next load reuses them instantly). Throws if any glb fails to load.
|
|
58
|
+
*/
|
|
59
|
+
export function loadWorldGroup(coreWorld, opts = {}) {
|
|
60
|
+
let p = worldGroupCache.get(coreWorld.id);
|
|
61
|
+
if (!p) {
|
|
62
|
+
p = (async () => {
|
|
63
|
+
const group = new THREE.Group();
|
|
64
|
+
group.name = "platform-world";
|
|
65
|
+
await applyWorld(group, coreWorld, { loadGlb: createGlbLoader(opts) });
|
|
66
|
+
return group;
|
|
67
|
+
})();
|
|
68
|
+
// Don't cache a rejected build — let the next attempt retry the fetch.
|
|
69
|
+
p.catch(() => {
|
|
70
|
+
if (worldGroupCache.get(coreWorld.id) === p)
|
|
71
|
+
worldGroupCache.delete(coreWorld.id);
|
|
72
|
+
});
|
|
73
|
+
worldGroupCache.set(coreWorld.id, p);
|
|
74
|
+
}
|
|
75
|
+
return p;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Release cached assembled worlds and dispose their geometry + materials (textures are left alone —
|
|
79
|
+
* they may be shared elsewhere). Pass an `id` to drop a single world, or omit it to clear everything.
|
|
80
|
+
* Call this when a game cycles through many large worlds and the retain-forever default would grow
|
|
81
|
+
* memory unbounded. Safe to call while a group is still in a scene, but detach it from the scene first.
|
|
82
|
+
*/
|
|
83
|
+
export function clearWorldCache(id) {
|
|
84
|
+
const drop = (key, promise) => {
|
|
85
|
+
worldGroupCache.delete(key);
|
|
86
|
+
void promise.then(disposeGroup).catch(() => { });
|
|
87
|
+
};
|
|
88
|
+
if (id !== undefined) {
|
|
89
|
+
const p = worldGroupCache.get(id);
|
|
90
|
+
if (p)
|
|
91
|
+
drop(id, p);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
for (const [key, p] of worldGroupCache)
|
|
95
|
+
drop(key, p);
|
|
96
|
+
}
|
|
97
|
+
/** Dispose a group's geometry + materials (not textures). */
|
|
98
|
+
function disposeGroup(group) {
|
|
99
|
+
group.parent?.remove(group);
|
|
100
|
+
group.traverse((o) => {
|
|
101
|
+
const mesh = o;
|
|
102
|
+
if (!mesh.isMesh)
|
|
103
|
+
return;
|
|
104
|
+
mesh.geometry?.dispose();
|
|
105
|
+
for (const m of Array.isArray(mesh.material) ? mesh.material : [mesh.material]) {
|
|
106
|
+
m?.dispose();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=world-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-loader.js","sourceRoot":"","sources":["../../src/three/world-loader.ts"],"names":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QACnB,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,eAAe;QAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,6DAA6D;AAC7D,SAAS,YAAY,CAAC,KAAkB;IACtC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,CAAe,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QACzB,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9E,CAAgC,EAAE,OAAO,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/world-runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* applyWorld — render a {@link
|
|
2
|
+
* applyWorld — render a {@link CoreWorld} into a three.js scene (or any compatible object graph).
|
|
3
3
|
*
|
|
4
4
|
* Exported from the SDK's main entry, but with **zero** dependency on `three`: it only *manipulates*
|
|
5
5
|
* objects your `loadGlb` returns (set transforms, add to the target, traverse) — it never constructs
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* const loadGlb = (url) => loader.loadAsync(url).then(g => g.scene);
|
|
12
12
|
* await applyWorld(scene, await session.getWorld(id), { loadGlb });
|
|
13
13
|
*/
|
|
14
|
-
import type {
|
|
14
|
+
import type { CoreWorld } from "./protocol/worlds.js";
|
|
15
15
|
interface Vec3Like {
|
|
16
16
|
fromArray(array: ArrayLike<number>, offset?: number): unknown;
|
|
17
17
|
}
|
|
@@ -31,6 +31,6 @@ export interface ApplyWorldOptions {
|
|
|
31
31
|
loadGlb: (url: string) => Promise<Object3DLike>;
|
|
32
32
|
}
|
|
33
33
|
/** Populate `target` with the world's base map (+ its modifications) and placed objects. */
|
|
34
|
-
export declare function applyWorld(target: Object3DLike, world:
|
|
34
|
+
export declare function applyWorld(target: Object3DLike, world: CoreWorld, opts: ApplyWorldOptions): Promise<void>;
|
|
35
35
|
export {};
|
|
36
36
|
//# sourceMappingURL=world-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world-runtime.d.ts","sourceRoot":"","sources":["../src/world-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"world-runtime.d.ts","sourceRoot":"","sources":["../src/world-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,UAAU,QAAQ;IAChB,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/D;AAED,4FAA4F;AAC5F,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,QAAQ,CAAC;IACrB,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACzD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;CACzD;AAED,MAAM,WAAW,iBAAiB;IAChC,0GAA0G;IAC1G,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACjD;AAED,4FAA4F;AAC5F,wBAAsB,UAAU,CAC9B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world-runtime.js","sourceRoot":"","sources":["../src/world-runtime.ts"],"names":[],"mappings":"AAoCA,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"world-runtime.js","sourceRoot":"","sources":["../src/world-runtime.ts"],"names":[],"mappings":"AAoCA,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAoB,EACpB,KAAgB,EAChB,IAAuB;IAEvB,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAEtB,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QAChB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;YAClB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,CAAC;gBAAE,OAAO;YACf,IAAI,CAAC,CAAC,OAAO;gBAAE,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC;YACjC,IAAI,CAAC,CAAC,QAAQ;gBAAE,CAAC,CA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rydr-game-sdk.git"
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./three": {
|
|
20
|
+
"types": "./dist/three/index.d.ts",
|
|
21
|
+
"import": "./dist/three/index.js"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"main": "./dist/index.js",
|
|
@@ -32,7 +36,17 @@
|
|
|
32
36
|
"version": "node scripts/sync-version.mjs && node scripts/release-changelog.mjs && git add src/protocol/version.ts CHANGELOG.md",
|
|
33
37
|
"postversion": "git push --follow-tags"
|
|
34
38
|
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"three": ">=0.160.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"three": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
35
47
|
"devDependencies": {
|
|
48
|
+
"@types/three": "^0.184.0",
|
|
49
|
+
"three": "^0.184.0",
|
|
36
50
|
"typescript": "^5.5.0"
|
|
37
51
|
}
|
|
38
52
|
}
|