@margoengine/xr 0.1.0 → 1.0.0

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.
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { Quaternion as e } from "@margoengine/math/quaternion";
@@ -35,7 +35,7 @@ function n(n, r = {}) {
35
35
  return o.apply(), o;
36
36
  }
37
37
  var r = 0, i = 1, a = 4, o = 9, s = class n {
38
- static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
38
+ static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
39
39
  return new n(e, t);
40
40
  }
41
41
  constructor(n, r) {
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { n as e } from "./errors-XvcwUnU4.js";
@@ -34,7 +34,7 @@ function a(e, a, o, s) {
34
34
  //#endregion
35
35
  //#region src/layers.ts
36
36
  var o = (t) => e("unsupported", `${t} needs the WebXR Layers module; request the session with optionalFeatures: ['layers'] on a browser whose XRGPUBinding creates layers`), s = class t {
37
- static attach(n) {__margoAssertCore(n,__margoCoreRequirement("0.1.0",import.meta.url));
37
+ static attach(n) {__margoAssertCore(n,__margoCoreRequirement("1.0.0",import.meta.url));
38
38
  let r = n.session;
39
39
  if (!r || !n.layerBinding) throw e("state", "XRLayers needs an immersive session; await xr.requestSession(mode, { optionalFeatures: [\"layers\"] }) first");
40
40
  if (r.enabledFeatures && !r.enabledFeatures.includes("layers")) throw o("XRLayers");
@@ -335,7 +335,7 @@ function m(e, t, n = {}, r) {
335
335
  return m;
336
336
  }
337
337
  var h = class t {
338
- static attach(e) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
338
+ static attach(e) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
339
339
  return new t(e);
340
340
  }
341
341
  constructor(e) {
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { n as e } from "./errors-XvcwUnU4.js";
@@ -8,7 +8,7 @@ var n = class n {
8
8
  get comfort() {
9
9
  return this.amount;
10
10
  }
11
- static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
11
+ static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
12
12
  return new n(e, t);
13
13
  }
14
14
  constructor(n, i) {
package/dist/models.js CHANGED
@@ -1,6 +1,6 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
- const i=(engine,version="0.1.0",source=import.meta.url)=>__margoRuntime(engine,version,source);
3
+ const i=(engine,version="1.0.0",source=import.meta.url)=>__margoRuntime(engine,version,source);
4
4
  import { n as e } from "./errors-XvcwUnU4.js";
5
5
  import { n as t, t as n } from "./scene-scope-DufD_3B6.js";
6
6
  import { t as r } from "./scene-owner-BRObO-WJ.js";
@@ -57,7 +57,7 @@ var u = {
57
57
  }
58
58
  return e;
59
59
  })(), f = class e {
60
- static attach(t, n, r = {}) {__margoAssertCore(t,__margoCoreRequirement("0.1.0",import.meta.url));
60
+ static attach(t, n, r = {}) {__margoAssertCore(t,__margoCoreRequirement("1.0.0",import.meta.url));
61
61
  return new e(t, n, r);
62
62
  }
63
63
  constructor(e, a, u) {
package/dist/near.js CHANGED
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { Quaternion as e } from "@margoengine/math/quaternion";
@@ -67,7 +67,7 @@ function l(e, t, n) {
67
67
  return n.set(e.handMatrices[r], e.handMatrices[r + 1], e.handMatrices[r + 2]), !0;
68
68
  }
69
69
  var u = (e) => e.viewer?.transform ?? null, d = class n extends r {
70
- static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
70
+ static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
71
71
  return new n(e, t);
72
72
  }
73
73
  constructor(n, r) {
@@ -121,7 +121,7 @@ var u = (e) => e.viewer?.transform ?? null, d = class n extends r {
121
121
  this.placed = !0, _.position.lerp(this.goal, x), _.orientation.slerp(this.q, x), this.set(!0, m), _.apply?.();
122
122
  }
123
123
  }, f = class n extends r {
124
- static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
124
+ static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
125
125
  return new n(e, t);
126
126
  }
127
127
  constructor(n, r) {
@@ -226,7 +226,7 @@ function g(n) {
226
226
  return h(n.normalAxis ?? "y", n.alignment ?? "normal", o, f) && n.target.orientation.copy(f), n.target.apply?.(), s;
227
227
  }
228
228
  var _ = class n extends r {
229
- static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
229
+ static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
230
230
  return new n(e, t);
231
231
  }
232
232
  constructor(n, r) {
@@ -257,7 +257,7 @@ var _ = class n extends r {
257
257
  this.placed = !0, a.position.lerp(this.goal, i), h(this.o.normalAxis, this.o.alignment, this.n, this.q) && a.orientation.slerp(this.q, i), a.apply?.();
258
258
  }
259
259
  }, v = class n extends r {
260
- static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
260
+ static attach(e, t = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
261
261
  return new n(e, t);
262
262
  }
263
263
  constructor(n, r) {
@@ -507,7 +507,7 @@ var b = class extends r {
507
507
  id: "adjust",
508
508
  label: "Adjust"
509
509
  }], S = class e extends b {
510
- static attach(t, n) {__margoAssertCore(t,__margoCoreRequirement("0.1.0",import.meta.url));
510
+ static attach(t, n) {__margoAssertCore(t,__margoCoreRequirement("1.0.0",import.meta.url));
511
511
  return new e(t, n);
512
512
  }
513
513
  constructor(e, n) {
@@ -537,7 +537,7 @@ var b = class extends r {
537
537
  }, Math.atan2(s.x - n.position.x, s.z - n.position.z)) : this.orientation.copy(n.orientation), this.position.copy(this.p).add(n.position), this.pokeAll(e);
538
538
  }
539
539
  }, C = class e extends b {
540
- static attach(t, n = {}) {__margoAssertCore(t,__margoCoreRequirement("0.1.0",import.meta.url));
540
+ static attach(t, n = {}) {__margoAssertCore(t,__margoCoreRequirement("1.0.0",import.meta.url));
541
541
  return new e(t, n);
542
542
  }
543
543
  constructor(e, t) {
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { n as e } from "./errors-XvcwUnU4.js";
@@ -17,7 +17,7 @@ function t(e = {}, t = {}) {
17
17
  };
18
18
  }
19
19
  var n = class t {
20
- static attach(e, n = {}) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
20
+ static attach(e, n = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
21
21
  return new t(e, n);
22
22
  }
23
23
  constructor(t, n) {
package/dist/pointer.js CHANGED
@@ -1,11 +1,11 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { r as e, t } from "./errors-XvcwUnU4.js";
5
5
  import { meshRuntime as n } from "@margoengine/core/extension";
6
6
  //#region src/pointer.ts
7
7
  var r = 1e3, i = class i {
8
- static attach(e, t, n) {__margoAssertCore(e,__margoCoreRequirement("0.1.0",import.meta.url));
8
+ static attach(e, t, n) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
9
9
  return n.signal?.throwIfAborted(), new i(e, t, n);
10
10
  }
11
11
  constructor(t, n, r) {
@@ -1,11 +1,11 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  //#region src/scene-owner.ts
5
5
  var e = 0;
6
6
  function t(t, n) {
7
7
  let r = `xr-subscription-${e++}`;
8
- return t.use({coreRequirement:/*@__PURE__*/__margoCoreRequirement("0.1.0",import.meta.url),
8
+ return t.use({coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
9
9
  name: r,
10
10
  setup() {},
11
11
  dispose: n
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  //#region ../shared/scene-scope.js
@@ -12,7 +12,7 @@ function n(e) {
12
12
  if (typeof e?.sceneOf == "function") {
13
13
  for (let t of e.plugins?.values() ?? []) if (n = e.sceneOf(t)) break;
14
14
  if (!n) {
15
- let r = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("0.1.0",import.meta.url),
15
+ let r = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
16
16
  name: t(e, "scene-scope:"),
17
17
  setup() {
18
18
  n = e.sceneOf(r);
@@ -28,7 +28,7 @@ function r(e, n) {
28
28
  scene: n,
29
29
  run(r) {
30
30
  if (!n) return r();
31
- let i, a = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("0.1.0",import.meta.url),
31
+ let i, a = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
32
32
  name: t(e, "scene-scope:"),
33
33
  setup() {
34
34
  i = r();
package/dist/session.js CHANGED
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { n as e } from "./errors-XvcwUnU4.js";
@@ -7,7 +7,7 @@ var t = class t {
7
7
  constructor(e, t) {
8
8
  this.host = e, this.session = t, this.visible = /* @__PURE__ */ new Set(), this.resets = /* @__PURE__ */ new Set(), this.stops = [], this.disposed = !1;
9
9
  }
10
- static attach(n, r = {}) {__margoAssertCore(n,__margoCoreRequirement("0.1.0",import.meta.url));
10
+ static attach(n, r = {}) {__margoAssertCore(n,__margoCoreRequirement("1.0.0",import.meta.url));
11
11
  let i = n?.session;
12
12
  if (!i) throw e("state", "XRSessionState needs an active XR session; await xr.requestSession first");
13
13
  let a = new t(n, i), o = () => {
@@ -1,64 +1,64 @@
1
- /** One browser and device route a real run must cover before XR counts as run on hardware. */
2
- export interface XRRunTarget {
3
- /** Stable name of the route. */
4
- readonly id: string;
5
- readonly mode: 'immersive-vr' | 'immersive-ar';
6
- readonly route: 'webgpu' | 'webgl2';
7
- /** What the run needs, in words. */
8
- readonly needs: string;
9
- }
10
- /** What the tester saw, answered by a person after the session. */
11
- export interface XRRunObserved {
12
- /** The scene stood still in the room while the head moved, in the right place for each eye. */
13
- scene: boolean;
14
- /** Moving the head moved the view at once, with no jumps. */
15
- tracking: boolean;
16
- /** A controller, hand or tap was seen and reacted. */
17
- input: boolean;
18
- /** Leaving the session gave the page back. */
19
- exit: boolean;
20
- }
21
- /** What `runDeviceCheck` writes: one session on one device. */
22
- export interface XRRun {
23
- schema: 1;
24
- /** ISO date of the run. */
25
- date: string;
26
- userAgent: string;
27
- /** True when `navigator.xr.requestSession` is the browser's own code. A stand-in written in JavaScript cannot set it. */
28
- native: boolean;
29
- mode: 'inline' | 'immersive-vr' | 'immersive-ar';
30
- route: 'webgpu' | 'webgl2' | 'none';
31
- /** The session's `enabledFeatures`, or empty where the browser does not list them. */
32
- features: string[];
33
- /** Largest number of views in one frame: 2 on a headset, 1 on a phone. */
34
- views: number;
35
- frames: number;
36
- /** Frames with a viewer pose. */
37
- tracked: number;
38
- /** Frames whose viewer pose was estimated, as on a headset with no position tracking. */
39
- emulated: number;
40
- /** Time between frames in milliseconds: the median, the 95th percentile and the longest. */
41
- frameMs: { median: number; p95: number; max: number };
42
- /** Every input source seen in the session. */
43
- inputs: {
44
- handedness: string;
45
- targetRayMode: string;
46
- profiles: string[];
47
- hand: boolean;
48
- buttons: number;
49
- axes: number;
50
- }[];
51
- /** True when the session ended before the check's time was up: the headset came off, or the browser stopped it. */
52
- endedEarly: boolean;
53
- /** Messages of everything that went wrong. */
54
- errors: string[];
55
- observed?: XRRunObserved;
56
- }
57
- /** The routes a real run must cover. */
58
- export const XR_RUN_TARGETS: readonly XRRunTarget[];
59
- /** Shortest run that counts: frames of a session with a viewer pose. */
60
- export const XR_RUN_MIN_FRAMES: number;
61
- /** What is wrong with `run`'s shape: an empty list for a well-formed run. */
62
- export function checkXRRun(run: unknown): string[];
63
- /** Why `run` does not prove `target`: an empty list when it does. */
64
- export function xrRunGaps(run: XRRun, target: XRRunTarget): string[];
1
+ /** One browser and device route a real run must cover before XR counts as run on hardware. */
2
+ export interface XRRunTarget {
3
+ /** Stable name of the route. */
4
+ readonly id: string;
5
+ readonly mode: 'immersive-vr' | 'immersive-ar';
6
+ readonly route: 'webgpu' | 'webgl2';
7
+ /** What the run needs, in words. */
8
+ readonly needs: string;
9
+ }
10
+ /** What the tester saw, answered by a person after the session. */
11
+ export interface XRRunObserved {
12
+ /** The scene stood still in the room while the head moved, in the right place for each eye. */
13
+ scene: boolean;
14
+ /** Moving the head moved the view at once, with no jumps. */
15
+ tracking: boolean;
16
+ /** A controller, hand or tap was seen and reacted. */
17
+ input: boolean;
18
+ /** Leaving the session gave the page back. */
19
+ exit: boolean;
20
+ }
21
+ /** What `runDeviceCheck` writes: one session on one device. */
22
+ export interface XRRun {
23
+ schema: 1;
24
+ /** ISO date of the run. */
25
+ date: string;
26
+ userAgent: string;
27
+ /** True when `navigator.xr.requestSession` is the browser's own code. A stand-in written in JavaScript cannot set it. */
28
+ native: boolean;
29
+ mode: 'inline' | 'immersive-vr' | 'immersive-ar';
30
+ route: 'webgpu' | 'webgl2' | 'none';
31
+ /** The session's `enabledFeatures`, or empty where the browser does not list them. */
32
+ features: string[];
33
+ /** Largest number of views in one frame: 2 on a headset, 1 on a phone. */
34
+ views: number;
35
+ frames: number;
36
+ /** Frames with a viewer pose. */
37
+ tracked: number;
38
+ /** Frames whose viewer pose was estimated, as on a headset with no position tracking. */
39
+ emulated: number;
40
+ /** Time between frames in milliseconds: the median, the 95th percentile and the longest. */
41
+ frameMs: { median: number; p95: number; max: number };
42
+ /** Every input source seen in the session. */
43
+ inputs: {
44
+ handedness: string;
45
+ targetRayMode: string;
46
+ profiles: string[];
47
+ hand: boolean;
48
+ buttons: number;
49
+ axes: number;
50
+ }[];
51
+ /** True when the session ended before the check's time was up: the headset came off, or the browser stopped it. */
52
+ endedEarly: boolean;
53
+ /** Messages of everything that went wrong. */
54
+ errors: string[];
55
+ observed?: XRRunObserved;
56
+ }
57
+ /** The routes a real run must cover. */
58
+ export const XR_RUN_TARGETS: readonly XRRunTarget[];
59
+ /** Shortest run that counts: frames of a session with a viewer pose. */
60
+ export const XR_RUN_MIN_FRAMES: number;
61
+ /** What is wrong with `run`'s shape: an empty list for a well-formed run. */
62
+ export function checkXRRun(run: unknown): string[];
63
+ /** Why `run` does not prove `target`: an empty list when it does. */
64
+ export function xrRunGaps(run: XRRun, target: XRRunTarget): string[];