@woosh/meep-engine 2.119.60 → 2.119.62

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.60",
8
+ "version": "2.119.62",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -4,6 +4,7 @@
4
4
  * @param {LightProbeVolume} volume
5
5
  * @param {string} [path_key]
6
6
  * @param {number} [placement_surface_offset] How far to place new probes away from the surface
7
+ * @param {number} [probe_size] purely visual, how big is each probe when visualised?
7
8
  */
8
- export function lpv_build_editor({ engine, volume, path_key, placement_surface_offset }: Engine): Promise<void>;
9
+ export function lpv_build_editor({ engine, volume, path_key, placement_surface_offset, probe_size, }: Engine): Promise<void>;
9
10
  //# sourceMappingURL=lpv_build_editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lpv_build_editor.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/lpv_build_editor.js"],"names":[],"mappings":"AAmMA;;;;;;GAMG;AACH,gHA4eC"}
1
+ {"version":3,"file":"lpv_build_editor.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/lpv_build_editor.js"],"names":[],"mappings":"AA4MA;;;;;;;GAOG;AACH,6HAyfC"}
@@ -101,6 +101,15 @@ class EditorState {
101
101
 
102
102
  mesh_needs_rebuilding = false;
103
103
 
104
+ hideProbes(){
105
+ this.probes.forEach(p => p.destroy());
106
+ }
107
+
108
+ showProbes(){
109
+ const ecd = this.ecd;
110
+ this.probes.forEach(p => p.build(ecd));
111
+ }
112
+
104
113
  ensureMesh() {
105
114
  if (this.mesh_needs_rebuilding) {
106
115
  this.volume.build_mesh();
@@ -199,12 +208,14 @@ class EditorState {
199
208
  * @param {LightProbeVolume} volume
200
209
  * @param {string} [path_key]
201
210
  * @param {number} [placement_surface_offset] How far to place new probes away from the surface
211
+ * @param {number} [probe_size] purely visual, how big is each probe when visualised?
202
212
  */
203
213
  export async function lpv_build_editor({
204
214
  engine,
205
215
  volume,
206
216
  path_key = "lpv",
207
- placement_surface_offset = 1
217
+ placement_surface_offset = 1,
218
+ probe_size = 1,
208
219
  }) {
209
220
 
210
221
  engine.assetManager.registerLoader('binary', new ArrayBufferLoader());
@@ -219,7 +230,7 @@ export async function lpv_build_editor({
219
230
  }
220
231
  build_in_progress = true;
221
232
 
222
- ctx.probes.forEach(p => p.destroy());
233
+ ctx.hideProbes();
223
234
 
224
235
  volume.build_mesh();
225
236
 
@@ -229,7 +240,7 @@ export async function lpv_build_editor({
229
240
  ctx.probeCoefficientsFromVolume(i);
230
241
  }
231
242
 
232
- ctx.probes.forEach(p => p.build(ecd));
243
+ ctx.showProbes();
233
244
 
234
245
  update_volume_visual();
235
246
 
@@ -312,7 +323,6 @@ export async function lpv_build_editor({
312
323
  });
313
324
  camera_controller.destroy();
314
325
 
315
- const probe_size = 1;
316
326
 
317
327
  const em = engine.entityManager;
318
328
  const ecd = em.dataset;
@@ -623,6 +633,19 @@ export async function lpv_build_editor({
623
633
  // select all
624
634
  set_selection(ctx.probes.map(e => e.id));
625
635
  }
636
+ }),
637
+ new SignalBinding(keys.h.down,()=>{
638
+
639
+ if(ctx.probes.length === 0){
640
+ return;
641
+ }
642
+
643
+ if(ctx.probes[0].isBuilt){
644
+ ctx.hideProbes();
645
+ }else{
646
+ ctx.showProbes();
647
+ }
648
+
626
649
  })
627
650
  ];
628
651