@bendyline/molen-dioramas 0.0.2 → 0.0.3

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/dist/client.d.mts CHANGED
@@ -39,6 +39,12 @@ interface DioramaVisualOptions {
39
39
  root: THREE.Object3D;
40
40
  camera?: THREE.Camera;
41
41
  assets?: AssetCache;
42
+ /**
43
+ * Light the host scene with the diorama's own point and spot lights (default true). A host that
44
+ * streams a large world turns them off: three builds every lit shader for the lights in the
45
+ * scene, so a light arriving or leaving with a diorama rebuilt every object in view in one frame.
46
+ */
47
+ localLights?: boolean;
42
48
  }
43
49
  /** Lazy-load the scripting runtime only when a placement is admitted by the director. */
44
50
  declare function createDioramaVisual(definition: DioramaDefinition, placement: DioramaPlacement, options: DioramaVisualOptions): Promise<DioramaInstance>;
package/dist/client.mjs CHANGED
@@ -147,6 +147,9 @@ async function createDioramaVisual(definition, placement, options) {
147
147
  if (options.camera) backend.updateLiveAnimations(renderTick, playback.tickRate, options.camera);
148
148
  else backend.setAnimationTick(renderTick, playback.tickRate);
149
149
  backend.prepareFrame();
150
+ if (options.localLights === false) {
151
+ for (const object of root.children) if (object.isLight === true) object.visible = false;
152
+ }
150
153
  };
151
154
  const dispose = () => {
152
155
  root.removeFromParent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/molen-dioramas",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,13 +40,13 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
- "@bendyline/molen-figures": "0.0.9",
44
- "@bendyline/molen-kernel": "0.0.7",
45
- "@bendyline/molen-schema": "0.0.7"
43
+ "@bendyline/molen-figures": "0.0.10",
44
+ "@bendyline/molen-kernel": "0.0.8",
45
+ "@bendyline/molen-schema": "0.0.8"
46
46
  },
47
47
  "peerDependencies": {
48
- "three": ">=0.184.0 <0.187.0",
49
- "@bendyline/molen-client": "0.0.9"
48
+ "@bendyline/molen-client": "0.0.10",
49
+ "three": ">=0.184.0 <0.187.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@bendyline/molen-client": {
@@ -57,14 +57,14 @@
57
57
  }
58
58
  },
59
59
  "devDependencies": {
60
+ "@bendyline/molen-client": "0.0.10",
60
61
  "@biomejs/biome": "^2.5.0",
61
62
  "@types/three": "0.184.0",
62
63
  "fast-check": "^3.23.2",
63
64
  "three": "0.184.0",
64
65
  "tsdown": "^0.22.2",
65
66
  "typescript": "^6.0.3",
66
- "vitest": "^5.0.1",
67
- "@bendyline/molen-client": "0.0.9"
67
+ "vitest": "^5.0.1"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",