@tomorrowevening/hermes 0.0.152 → 0.0.154

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/hermes.es.js CHANGED
@@ -220,13 +220,14 @@ function c_(a = !1, e = !1) {
220
220
  height: innerHeight,
221
221
  mobile: s.isMobile !== void 0 ? s.isMobile : !1,
222
222
  supportOffScreenCanvas: i,
223
+ supportWebGPU: !!navigator.gpu,
223
224
  quality: 2,
224
225
  dev: a,
225
226
  editor: e
226
227
  };
227
228
  s.tier === 3 ? o.quality = 0 : s.tier === 2 && (o.quality = 1), l_((l) => {
228
229
  o.fps = l, t(o);
229
- }), t(o);
230
+ });
230
231
  });
231
232
  });
232
233
  }
@@ -789,6 +790,7 @@ class _P extends xu {
789
790
  height: 0,
790
791
  mobile: !1,
791
792
  supportOffScreenCanvas: !1,
793
+ supportWebGPU: !1,
792
794
  quality: sg.Low,
793
795
  dev: !1,
794
796
  editor: !1
@@ -2693,7 +2695,8 @@ function ag(a) {
2693
2695
  if (r !== null) {
2694
2696
  const o = r.getObjectByProperty("uuid", a.child.uuid);
2695
2697
  o !== void 0 && (e.current.style.opacity = o.visible ? "1" : "0.25");
2696
- }
2698
+ } else
2699
+ console.log(`Hermes - Can't find Scene: ${a.child.uuid}`);
2697
2700
  }
2698
2701
  }, [t]), /* @__PURE__ */ C.jsx(C.Fragment, { children: a.child !== void 0 && /* @__PURE__ */ C.jsxs("div", { className: "childObject", children: [
2699
2702
  /* @__PURE__ */ C.jsxs("div", { className: "child", children: [
@@ -2735,8 +2738,10 @@ function ag(a) {
2735
2738
  if (o !== void 0) {
2736
2739
  const l = "visible", c = !o.visible;
2737
2740
  e.current.style.opacity = c ? "1" : "0.25", a.three.updateObject(a.child.uuid, l, c), Xe(o, l, c);
2738
- }
2739
- }
2741
+ } else
2742
+ console.log(`Hermes - Couldn't find object: ${a.child.uuid}`, r);
2743
+ } else
2744
+ console.log(`Hermes - Couldn't find object in scene: ${a.child.uuid}, ${a.child.name}`);
2740
2745
  }
2741
2746
  }
2742
2747
  }
@@ -41667,6 +41672,8 @@ uniform float uDistance;
41667
41672
  uniform float uGridOpacity;
41668
41673
  uniform float uSubgridOpacity;
41669
41674
 
41675
+ #define minAlpha 0.00784313725490196
41676
+
41670
41677
  float getGrid(float gapSize) {
41671
41678
  vec2 worldPositionByDivision = worldPosition.xz / gapSize;
41672
41679
 
@@ -41723,7 +41730,7 @@ void main() {
41723
41730
  // Shade the next grid
41724
41731
  fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
41725
41732
 
41726
- if (fragColor.a <= 0.0) discard;
41733
+ if (fragColor.a <= minAlpha) discard;
41727
41734
  }`;
41728
41735
  class PN extends Zm {
41729
41736
  constructor(e) {
@@ -42409,7 +42416,7 @@ class Pt extends xu {
42409
42416
  let t = this.controls.get(e);
42410
42417
  if (t === void 0) {
42411
42418
  const s = document.querySelector(".clickable");
42412
- t = new BN(this.activeCamera, s), t.getHelper().name = e, t.setSize(0.25), t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
42419
+ t = new BN(this.activeCamera, s), t.getHelper().name = e, t.setSize(0.5), t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
42413
42420
  this.dispatchEvent({ type: Pt.DRAG_START });
42414
42421
  }), t.addEventListener("mouseUp", () => {
42415
42422
  this.dispatchEvent({ type: Pt.DRAG_END });
@@ -43321,7 +43328,7 @@ class ht extends Va {
43321
43328
  const o = new Nh(-100, 100, 100, -100, 0, 3e3);
43322
43329
  return o.name = n, o.position.copy(r), o.lookAt(0, 0, 0), this.cameras.set(n, o), o;
43323
43330
  }, t = 1e3;
43324
- e("Top", new Z(0, t, 0)), e("Bottom", new Z(0, -t, 0)), e("Left", new Z(-t, 0, 0)), e("Right", new Z(t, 0, 0)), e("Front", new Z(0, 0, t)), e("Back", new Z(0, 0, -t)), e("Orthographic", new Z(t, t, t)), e("UI", new Z()), this.debugCamera = new Vd(60, 1, 0.01, 5e3), this.debugCamera.name = "Debug", this.debugCamera.position.set(500, 500, 500), this.debugCamera.lookAt(0, 0, 0), this.cameras.set("Debug", this.debugCamera), this.currentCamera = this.debugCamera;
43331
+ e("Top", new Z(0, t, 0)), e("Bottom", new Z(0, -t, 0)), e("Left", new Z(-t, 0, 0)), e("Right", new Z(t, 0, 0)), e("Front", new Z(0, 0, t)), e("Back", new Z(0, 0, -t)), e("Orthographic", new Z(t, t, t)), e("UI", new Z()), this.debugCamera = new Vd(60, 1, 0.01, 3e3), this.debugCamera.name = "Debug", this.debugCamera.position.set(300, 300, 300), this.debugCamera.lookAt(0, 0, 0), this.cameras.set("Debug", this.debugCamera), this.currentCamera = this.debugCamera;
43325
43332
  const s = localStorage, i = this.props.three.app.appID;
43326
43333
  this.tlCam = this.cameras.get(s.getItem(`${i}_tlCam`)), this.trCam = this.cameras.get(s.getItem(`${i}_trCam`)), this.blCam = this.cameras.get(s.getItem(`${i}_blCam`)), this.brCam = this.cameras.get(s.getItem(`${i}_brCam`)), this.tlCam === void 0 && (this.tlCam = this.cameras.get("Debug")), this.trCam === void 0 && (this.trCam = this.cameras.get("Orthographic")), this.blCam === void 0 && (this.blCam = this.cameras.get("Front")), this.brCam === void 0 && (this.brCam = this.cameras.get("Top"));
43327
43334
  }
@@ -43530,7 +43537,7 @@ class ht extends Va {
43530
43537
  const s = this.controls.get(e.name);
43531
43538
  if (s !== void 0 && s.dispose(), this.controls.delete(e.name), e.name === "UI") return;
43532
43539
  const i = new pN(e, t);
43533
- switch (i.enableDamping = !0, i.dampingFactor = 0.05, e.name) {
43540
+ switch (i.enableDamping = !0, i.dampingFactor = 0.2, e.name) {
43534
43541
  case "Top":
43535
43542
  case "Bottom":
43536
43543
  case "Left":
@@ -44300,16 +44307,31 @@ function RP(a) {
44300
44307
  }), l;
44301
44308
  }
44302
44309
  const t = (o) => {
44303
- const l = o.value, c = e(l), h = c?.getObjectByProperty("uuid", l);
44310
+ const l = o.value, c = e(l);
44311
+ if (!c) {
44312
+ console.log(`Hermes - can't find scene for object: ${l}`, a.three.scenes);
44313
+ return;
44314
+ }
44315
+ const h = c.getObjectByProperty("uuid", l);
44304
44316
  h !== void 0 ? a.three.setObject(h) : console.log(`Hermes - can't find object: ${l}`, c);
44305
44317
  }, s = (o, l, c) => {
44306
- const h = e(o), u = h?.getObjectByProperty("uuid", o);
44318
+ const h = e(o);
44319
+ if (!h) {
44320
+ console.log(`Hermes - can't find scene to set object: ${o}, ${l}`, a.three.scenes);
44321
+ return;
44322
+ }
44323
+ const u = h?.getObjectByProperty("uuid", o);
44307
44324
  u !== void 0 ? Xe(u, l, c) : console.log(`Hermes - can't set object: ${o}`, h);
44308
44325
  }, i = (o) => {
44309
44326
  const l = o.value, { key: c, value: h, uuid: u } = l;
44310
44327
  s(u, c, h);
44311
44328
  }, n = (o) => {
44312
- const l = o.value, h = e(l.uuid)?.getObjectByProperty("uuid", l.uuid);
44329
+ const l = o.value, c = e(l.uuid);
44330
+ if (!c) {
44331
+ console.log(`Hermes - can't create texture, can't find scene: ${l.uuid}`);
44332
+ return;
44333
+ }
44334
+ const h = c?.getObjectByProperty("uuid", l.uuid);
44313
44335
  if (h !== void 0) {
44314
44336
  const u = (d) => {
44315
44337
  const p = l.key.split(".");
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "module": "./dist/hermes.esm.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "type": "module",
10
- "version": "0.0.152",
10
+ "version": "0.0.154",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -10,6 +10,7 @@ export type AppSettings = {
10
10
  height: number;
11
11
  mobile: boolean;
12
12
  supportOffScreenCanvas: boolean;
13
+ supportWebGPU: boolean;
13
14
  quality: QualityType;
14
15
  dev: boolean;
15
16
  editor: boolean;