mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
feat(director): add bounded scene data packs and placement
This commit is contained in:
1 parent
4436d7f18e
commit
92526e9a92
27 files changed
+1720
-28
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { createDataPackSession } from '../../director/packs/session.js';
|
||||
import { createPackPresentations } from './presentation.js';
|
||||
|
||||
/** Bind selected shot packs to one viewer and expose copied lifecycle diagnostics. */
|
||||
export function createSceneDataPacks(viewer, { sources = {} } = {}) {
|
||||
const session = createDataPackSession({
|
||||
sources,
|
||||
adapters: createPackPresentations(viewer),
|
||||
});
|
||||
return {
|
||||
...session,
|
||||
apply(scene, shot, token) {
|
||||
const wanted = new Set(shot.dataPackIds || []);
|
||||
return session.load(
|
||||
(scene.dataPacks || []).filter((pack) => wanted.has(pack.id)),
|
||||
{ anchors: scene.anchors, signal: token?.signal },
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user