@needle-tools/engine 4.10.0-beta.2 → 4.10.0-next.2abafea

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.
@@ -38,18 +38,14 @@ const observedAttributes = [
38
38
  "loadstart",
39
39
  "progress",
40
40
  "loadfinished",
41
-
42
41
  "dracoDecoderPath",
43
42
  "dracoDecoderType",
44
43
  "ktx2DecoderPath",
45
-
46
44
  "tone-mapping",
47
45
  "tone-mapping-exposure",
48
46
  "background-blurriness",
49
47
  "background-color",
50
48
  "environment-intensity",
51
-
52
- "focus-rect",
53
49
  ]
54
50
 
55
51
  // https://developers.google.com/web/fundamentals/web-components/customelements
@@ -99,7 +95,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
99
95
  if (value === null) this.removeAttribute("camera-controls");
100
96
  else this.setAttribute("camera-controls", value ? "true" : "false");
101
97
  }
102
-
98
+
103
99
 
104
100
  /**
105
101
  * Get the current context for this web component instance. The context is created when the src attribute is set and the loading has finished.
@@ -335,17 +331,17 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
335
331
  if (debug) console.log("ktx2DecoderPath", newValue);
336
332
  setKtx2TranscoderPath(newValue);
337
333
  break;
338
-
334
+
339
335
  case "tonemapping":
340
336
  case "tone-mapping":
341
337
  case "tone-mapping-exposure":
342
338
  case "background-blurriness":
343
339
  case "background-color":
344
340
  case "environment-intensity":
345
- {
346
- this.applyAttributes();
347
- break;
348
- }
341
+ {
342
+ this.applyAttributes();
343
+ break;
344
+ }
349
345
  case "public-key": {
350
346
  if (newValue != PUBLIC_KEY)
351
347
  this.setPublicKey();
@@ -356,25 +352,6 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
356
352
  this.setVersion();
357
353
  break;
358
354
  }
359
-
360
- case "focus-rect":
361
- {
362
- const focus_rect = this.getAttribute("focus-rect") as HTMLElement | string | null;
363
- if (focus_rect && this._context) {
364
- if (focus_rect === null) {
365
- this._context.setCameraFocusRect(null);
366
- }
367
- else if (typeof focus_rect === "string" && focus_rect.length > 0) {
368
- const element = document.querySelector(focus_rect);
369
- this._context.setCameraFocusRect(element instanceof HTMLElement ? element : null);
370
- }
371
- else if (focus_rect instanceof HTMLElement) {
372
- this._context.setCameraFocusRect(focus_rect);
373
- }
374
-
375
- }
376
- }
377
- break;
378
355
  }
379
356
  }
380
357
 
@@ -594,7 +571,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
594
571
  this.context.scene.background = null;
595
572
  }
596
573
  // HACK: if we set background-color to a color and then back to null we want the background-image attribute to re-apply
597
- else if (this.getAttribute("background-image")) {
574
+ else if(this.getAttribute("background-image")) {
598
575
  this.setAttribute("background-image", this.getAttribute("background-image")!);
599
576
  }
600
577
  }
@@ -435,7 +435,7 @@ export class ScrollFollow extends Behaviour {
435
435
  time += diff * weight;
436
436
  }
437
437
  }
438
- if (debug && this.context.time.frame % 20 === 0) console.log(time.toFixed(3), [...weightsArray])
438
+ if (this.context.time.frame % 20 === 0) console.log(time.toFixed(3), [...weightsArray])
439
439
  if (this.damping <= 0) {
440
440
  director.time = time;
441
441
  }