@skewedaspect/sage 0.9.1 → 0.9.2

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/sage.es.js CHANGED
@@ -1,10 +1,10 @@
1
- import { AbstractMesh as e, ActionManager as t, ArcRotateCamera as n, Color3 as r, Color4 as i, CreateAudioEngineAsync as a, CubeTexture as o, DefaultRenderingPipeline as s, DirectionalLight as c, Engine as l, ExecuteCodeAction as u, FreeCamera as d, HDRCubeTexture as f, HavokPlugin as p, HemisphericLight as m, ImageProcessingConfiguration as h, ImportMeshAsync as g, LoadAssetContainerAsync as _, Mesh as v, MeshBuilder as y, NullEngine as b, PBRMaterial as x, PhysicsAggregate as ee, PhysicsShapeType as S, PointLight as C, Quaternion as te, RectAreaLight as w, SSAO2RenderingPipeline as ne, Scene as re, SelectionOutlineLayer as ie, SoundState as ae, SpotLight as oe, StandardMaterial as se, Texture as ce, TransformNode as le, UniversalCamera as ue, Vector3 as T, WebGPUEngine as de } from "@babylonjs/core";
2
- import { registerBuiltInLoaders as fe } from "@babylonjs/loaders/dynamic";
3
- import { GeospatialCamera as E } from "@babylonjs/core/Cameras/geospatialCamera";
4
- import { ClusteredLightContainer as D } from "@babylonjs/core/Lights/Clustered/clusteredLightContainer";
5
- import pe from "@babylonjs/havok";
1
+ import { AbstractMesh as e, ActionManager as t, ArcRotateCamera as n, Color3 as r, Color4 as i, CreateAudioEngineAsync as a, CubeTexture as o, DefaultRenderingPipeline as s, DirectionalLight as c, Engine as l, ExecuteCodeAction as u, FreeCamera as d, HDRCubeTexture as f, HavokPlugin as p, HemisphericLight as m, ImageProcessingConfiguration as h, ImportMeshAsync as g, LoadAssetContainerAsync as _, Matrix as v, Mesh as y, MeshBuilder as b, NullEngine as x, PBRMaterial as ee, PhysicsAggregate as S, PhysicsShapeType as C, PointLight as te, Quaternion as w, RectAreaLight as T, SSAO2RenderingPipeline as ne, Scene as re, SelectionOutlineLayer as ie, SoundState as E, SpotLight as D, StandardMaterial as O, Texture as ae, TransformNode as k, UniversalCamera as oe, Vector3 as A, WebGPUEngine as se } from "@babylonjs/core";
2
+ import { registerBuiltInLoaders as ce } from "@babylonjs/loaders/dynamic";
3
+ import { GeospatialCamera as le } from "@babylonjs/core/Cameras/geospatialCamera";
4
+ import { ClusteredLightContainer as ue } from "@babylonjs/core/Lights/Clustered/clusteredLightContainer";
5
+ import de from "@babylonjs/havok";
6
6
  //#region src/utils/version.ts
7
- var O = "0.9.1", k = class {
7
+ var j = "0.9.2", fe = class {
8
8
  canvas;
9
9
  renderEngine;
10
10
  physics;
@@ -42,11 +42,11 @@ var O = "0.9.1", k = class {
42
42
  return this.eventBus.subscribe(`action:${e}`, t);
43
43
  }
44
44
  async start() {
45
- this.started ? this._log.warn("Game engine is already started. Skipping start.") : (this._log.info(`Starting SkewedAspect Game Engine (Version: ${O})...`), this._beforeStartHook && (this._log.debug("Executing beforeStart hook..."), await this._beforeStartHook(this)), await this.managers.gameManager.start(), this._log.info("Game engine started successfully"), this._onStartHook && (this._log.debug("Executing onStart hook..."), await this._onStartHook(this)), this.started = !0);
45
+ this.started ? this._log.warn("Game engine is already started. Skipping start.") : (this._log.info(`Starting SkewedAspect Game Engine (Version: ${j})...`), this._beforeStartHook && (this._log.debug("Executing beforeStart hook..."), await this._beforeStartHook(this)), await this.managers.gameManager.start(), this._log.info("Game engine started successfully"), this._onStartHook && (this._log.debug("Executing onStart hook..."), await this._onStartHook(this)), this.started = !0);
46
46
  }
47
47
  async stop() {
48
48
  if (this.started) {
49
- this._log.info(`Stopping SkewedAspect Game Engine (Version: ${O})...`);
49
+ this._log.info(`Stopping SkewedAspect Game Engine (Version: ${j})...`);
50
50
  let e = null;
51
51
  if (this._onTeardownHook) try {
52
52
  this._log.debug("Executing onTeardown hook..."), await this._onTeardownHook(this);
@@ -72,7 +72,7 @@ var O = "0.9.1", k = class {
72
72
  if (this.started = !1, this._log.info("Game engine stopped successfully"), e) throw e;
73
73
  } else this._log.warn("Game engine is not started. Skipping stop.");
74
74
  }
75
- }, A = class {
75
+ }, pe = class {
76
76
  timers;
77
77
  constructor() {
78
78
  this.timers = /* @__PURE__ */ new Map();
@@ -131,7 +131,7 @@ var O = "0.9.1", k = class {
131
131
  console.info(`${a} Timer '${t}' completed in ${i.toFixed(2)}ms`, o, s, c);
132
132
  } else console.warn(`[${e}]: Timer '${t}' does not exist`);
133
133
  }
134
- }, j = class {
134
+ }, me = class {
135
135
  trace(e, t, ...n) {}
136
136
  debug(e, t, ...n) {}
137
137
  info(e, t, ...n) {}
@@ -143,7 +143,7 @@ var O = "0.9.1", k = class {
143
143
  category;
144
144
  backend;
145
145
  minLevel;
146
- constructor(e, t = "none", n = new j()) {
146
+ constructor(e, t = "none", n = new me()) {
147
147
  this.category = e, this.backend = n, this.minLevel = t;
148
148
  }
149
149
  updateSettings(e, t) {
@@ -181,11 +181,11 @@ var O = "0.9.1", k = class {
181
181
  default: return !1;
182
182
  }
183
183
  }
184
- }, N = class {
184
+ }, he = class {
185
185
  backend;
186
186
  level;
187
187
  loggers;
188
- constructor(e = "debug", t = new A()) {
188
+ constructor(e = "debug", t = new pe()) {
189
189
  this.backend = t, this.level = e, this.loggers = /* @__PURE__ */ new Map();
190
190
  }
191
191
  setBackend(e) {
@@ -205,7 +205,7 @@ var O = "0.9.1", k = class {
205
205
  let t = this.loggers.get(e);
206
206
  return t || (t = new M(e, this.level, this.backend), this.loggers.set(e, t)), t;
207
207
  }
208
- }, P = class {
208
+ }, ge = class {
209
209
  directMap = /* @__PURE__ */ new Map();
210
210
  patternSubs = /* @__PURE__ */ new Set();
211
211
  _log;
@@ -255,7 +255,7 @@ var O = "0.9.1", k = class {
255
255
  async $teardown() {
256
256
  this._log.debug("Tearing down EventBus"), this.directMap.clear(), this.patternSubs.clear();
257
257
  }
258
- }, F = class {
258
+ }, N = class {
259
259
  _engine = null;
260
260
  _mainBus = null;
261
261
  _buses = /* @__PURE__ */ new Map();
@@ -299,8 +299,8 @@ var O = "0.9.1", k = class {
299
299
  };
300
300
  //#endregion
301
301
  //#region src/engines/scene.ts
302
- fe();
303
- var I = class {
302
+ ce();
303
+ var P = class {
304
304
  _canvas;
305
305
  _engine;
306
306
  _havok;
@@ -311,14 +311,14 @@ var I = class {
311
311
  createScene() {
312
312
  return new re(this._engine);
313
313
  }
314
- enablePhysics(e, t = new T(0, -9.8, 0), n) {
314
+ enablePhysics(e, t = new A(0, -9.8, 0), n) {
315
315
  this._log.debug(`Enabling physics with gravity (${t.x}, ${t.y}, ${t.z})...`);
316
316
  let r = n === void 0 ? void 0 : { floatingOriginWorldRadius: n }, i = new p(!0, this._havok, r);
317
317
  e.enablePhysics(t, i);
318
318
  }
319
319
  createFreeCamera(e, t, n, r) {
320
320
  let i = new d(e, t, n);
321
- return i.setTarget(T.Zero()), r ??= this._canvas, r && i.attachControl(r, !0), i;
321
+ return i.setTarget(A.Zero()), r ??= this._canvas, r && i.attachControl(r, !0), i;
322
322
  }
323
323
  createHemisphericLight(e, t, n, r = .7) {
324
324
  let i = new m(e, t, n);
@@ -329,32 +329,32 @@ var I = class {
329
329
  return i.intensity = r, i;
330
330
  }
331
331
  createPointLight(e, t, n, r = 1) {
332
- let i = new C(e, t, n);
332
+ let i = new te(e, t, n);
333
333
  return i.intensity = r, i;
334
334
  }
335
335
  createSpotLight(e, t, n, r, i, a, o = 1) {
336
- let s = new oe(e, t, n, r, i, a);
336
+ let s = new D(e, t, n, r, i, a);
337
337
  return s.intensity = o, s;
338
338
  }
339
339
  createRectAreaLight(e, t, n, r, i, a = 1) {
340
- let o = new w(e, t, n, r, i);
340
+ let o = new T(e, t, n, r, i);
341
341
  return o.intensity = a, o;
342
342
  }
343
343
  createSphere(e, t = {}, n) {
344
- return y.CreateSphere(e, {
344
+ return b.CreateSphere(e, {
345
345
  diameter: 1,
346
346
  segments: 32,
347
347
  ...t
348
348
  }, n);
349
349
  }
350
350
  createBox(e, t = {}, n) {
351
- return y.CreateBox(e, {
351
+ return b.CreateBox(e, {
352
352
  size: 1,
353
353
  ...t
354
354
  }, n);
355
355
  }
356
356
  createGround(e, t = {}, n) {
357
- return y.CreateGround(e, {
357
+ return b.CreateGround(e, {
358
358
  width: 6,
359
359
  height: 6,
360
360
  subdivisions: 2,
@@ -362,7 +362,7 @@ var I = class {
362
362
  }, n);
363
363
  }
364
364
  createCylinder(e, t = {}, n) {
365
- return y.CreateCylinder(e, {
365
+ return b.CreateCylinder(e, {
366
366
  height: 2,
367
367
  diameterTop: 1,
368
368
  diameterBottom: 1,
@@ -370,7 +370,7 @@ var I = class {
370
370
  }, n);
371
371
  }
372
372
  addPhysics(e, t, n = {}, r) {
373
- return new ee(e, t, {
373
+ return new S(e, t, {
374
374
  mass: 1,
375
375
  restitution: .75,
376
376
  friction: .5,
@@ -398,7 +398,7 @@ var I = class {
398
398
  async $teardown() {
399
399
  this._log.info("Tearing down SceneEngine"), this._log.info("SceneEngine torn down successfully");
400
400
  }
401
- }, L = class {
401
+ }, F = class {
402
402
  _eventBus;
403
403
  _sceneEngine;
404
404
  _log;
@@ -491,27 +491,27 @@ var I = class {
491
491
  async $teardown() {
492
492
  this.disposeAll();
493
493
  }
494
- }, R = [
494
+ }, I = [
495
495
  "trigger",
496
496
  "toggle",
497
497
  "value"
498
- ], me = [
498
+ ], _e = [
499
499
  "keyboard",
500
500
  "mouse",
501
501
  "gamepad"
502
502
  ];
503
- function z(e) {
503
+ function L(e) {
504
504
  return e.type === "keyboard";
505
505
  }
506
- function B(e) {
506
+ function R(e) {
507
507
  return e.type === "mouse";
508
508
  }
509
- function V(e) {
509
+ function z(e) {
510
510
  return e.type === "gamepad";
511
511
  }
512
512
  //#endregion
513
513
  //#region src/classes/bindings/trigger.ts
514
- var he = class {
514
+ var ve = class {
515
515
  type = "trigger";
516
516
  action;
517
517
  context;
@@ -582,7 +582,7 @@ var he = class {
582
582
  options: this.options
583
583
  };
584
584
  }
585
- }, ge = class {
585
+ }, ye = class {
586
586
  type = "toggle";
587
587
  action;
588
588
  context;
@@ -656,7 +656,7 @@ var he = class {
656
656
  options: this.options
657
657
  };
658
658
  }
659
- }, _e = class {
659
+ }, be = class {
660
660
  type = "value";
661
661
  action;
662
662
  context;
@@ -719,7 +719,7 @@ var he = class {
719
719
  options: this.options
720
720
  };
721
721
  }
722
- }, ve = class e {
722
+ }, xe = class e {
723
723
  sourceType = "key";
724
724
  sourceKey;
725
725
  useDelta;
@@ -742,7 +742,7 @@ var he = class {
742
742
  options: { useDelta: this.useDelta }
743
743
  };
744
744
  }
745
- }, ye = class e {
745
+ }, Se = class e {
746
746
  sourceType;
747
747
  sourceKey;
748
748
  constructor(e, t) {
@@ -777,7 +777,7 @@ var he = class {
777
777
  sourceKey: this.sourceKey
778
778
  };
779
779
  }
780
- }, be = class e {
780
+ }, Ce = class e {
781
781
  sourceType;
782
782
  sourceKey;
783
783
  useAnalogValue;
@@ -816,7 +816,7 @@ var he = class {
816
816
  }
817
817
  };
818
818
  }
819
- }, xe = .05, Se = .5, Ce = class {
819
+ }, we = .05, Te = .5, Ee = class {
820
820
  _bindings = /* @__PURE__ */ new Map();
821
821
  _actions = /* @__PURE__ */ new Map();
822
822
  _contexts = /* @__PURE__ */ new Map();
@@ -849,22 +849,22 @@ var he = class {
849
849
  return t;
850
850
  }
851
851
  _shouldUpdateActiveDevice(e) {
852
- return B(e) ? Object.values(e.buttons).some((e) => e.pressed) || e.wheel !== void 0 : V(e) ? Object.values(e.buttons).some((e) => e.pressed) || Object.values(e.axes).some((e) => Math.abs(e) > xe) : !0;
852
+ return R(e) ? Object.values(e.buttons).some((e) => e.pressed) || e.wheel !== void 0 : z(e) ? Object.values(e.buttons).some((e) => e.pressed) || Object.values(e.axes).some((e) => Math.abs(e) > we) : !0;
853
853
  }
854
854
  _createBindingFromDefinition(e) {
855
855
  let t = this._actions.get(e.action);
856
856
  if (!t) return this._log.warn(`Cannot create binding: Action "${e.action}" not found.`), null;
857
857
  let { deviceID: n, ...r } = e.input;
858
858
  switch (e.type) {
859
- case "trigger": return new he(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
859
+ case "trigger": return new ve(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
860
860
  ...e.options || {},
861
861
  context: e.context
862
862
  });
863
- case "toggle": return new ge(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
863
+ case "toggle": return new ye(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
864
864
  ...e.options || {},
865
865
  context: e.context
866
866
  });
867
- case "value": return new _e(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
867
+ case "value": return new be(t, n, e.input.type, this._createInputSourceFromDefinition(r), {
868
868
  ...e.options || {},
869
869
  context: e.context
870
870
  });
@@ -873,16 +873,16 @@ var he = class {
873
873
  }
874
874
  _createInputSourceFromDefinition(e) {
875
875
  switch (e.type) {
876
- case "keyboard": return new ve(e.sourceKey, e.options);
876
+ case "keyboard": return new xe(e.sourceKey, e.options);
877
877
  case "mouse": {
878
878
  let t = e.sourceType;
879
879
  if (!(t === "button" || t === "position" || t === "wheel")) throw Error(`Invalid mouse source type: ${t}`);
880
- return new ye(t, e.sourceKey);
880
+ return new Se(t, e.sourceKey);
881
881
  }
882
882
  case "gamepad": {
883
883
  let t = e.sourceType;
884
884
  if (!(t === "button" || t === "axis")) throw Error(`Invalid gamepad source type: ${t}`);
885
- return new be(t, e.sourceKey, e.options);
885
+ return new Ce(t, e.sourceKey, e.options);
886
886
  }
887
887
  default: throw Error(`Unsupported input source type: ${e.type}`);
888
888
  }
@@ -893,7 +893,7 @@ var he = class {
893
893
  let { options: r } = n;
894
894
  if (!r.deviceTypes.includes(e.type)) return;
895
895
  let i = null;
896
- if (z(t)) {
896
+ if (L(t)) {
897
897
  if (t.event?.repeat === !0) return;
898
898
  for (let n of Object.keys(t.delta)) if (t.delta[n] === !0) {
899
899
  i = {
@@ -904,7 +904,7 @@ var he = class {
904
904
  };
905
905
  break;
906
906
  }
907
- } else if (B(t)) {
907
+ } else if (R(t)) {
908
908
  for (let n of Object.keys(t.buttons)) if (t.buttons[n].pressed) {
909
909
  i = {
910
910
  type: "mouse",
@@ -914,7 +914,7 @@ var he = class {
914
914
  };
915
915
  break;
916
916
  }
917
- } else if (V(t)) {
917
+ } else if (z(t)) {
918
918
  for (let n of Object.keys(t.buttons)) if (t.buttons[n].pressed) {
919
919
  i = {
920
920
  type: "gamepad",
@@ -925,7 +925,7 @@ var he = class {
925
925
  break;
926
926
  }
927
927
  if (!i) {
928
- for (let n of Object.keys(t.axes)) if (Math.abs(t.axes[n]) > Se) {
928
+ for (let n of Object.keys(t.axes)) if (Math.abs(t.axes[n]) > Te) {
929
929
  i = {
930
930
  type: "gamepad",
931
931
  sourceType: "axis",
@@ -1040,7 +1040,7 @@ var he = class {
1040
1040
  return this._contexts.get(e) || null;
1041
1041
  }
1042
1042
  $registerBinding(e) {
1043
- if (!R.includes(e.type)) throw Error(`Invalid binding type: ${e.type}`);
1043
+ if (!I.includes(e.type)) throw Error(`Invalid binding type: ${e.type}`);
1044
1044
  e.context && !this._contexts.has(e.context) && this.registerContext(e.context), this._bindings.has(e.deviceID) || this._bindings.set(e.deviceID, []), this._bindings.get(e.deviceID)?.push(e), this._log.debug(`Registered ${e.type} binding for "${e.action.name}" in context "${e.context || null}"`);
1045
1045
  }
1046
1046
  registerBinding(e) {
@@ -1110,15 +1110,15 @@ var he = class {
1110
1110
  };
1111
1111
  //#endregion
1112
1112
  //#region src/utils/capabilities.ts
1113
- function H() {
1113
+ function B() {
1114
1114
  return typeof window < "u" && window.document !== void 0;
1115
1115
  }
1116
- function U() {
1117
- return H() && !!window.navigator.gpu;
1116
+ function V() {
1117
+ return B() && !!window.navigator.gpu;
1118
1118
  }
1119
1119
  //#endregion
1120
1120
  //#region node_modules/hexoid/dist/index.mjs
1121
- for (var we = class {
1121
+ for (var De = class {
1122
1122
  _engine;
1123
1123
  _eventBus;
1124
1124
  _entityManager;
@@ -1132,7 +1132,7 @@ for (var we = class {
1132
1132
  _paused = !1;
1133
1133
  started = !1;
1134
1134
  constructor(e, t, n, r, i, a) {
1135
- this._engine = e, this._eventBus = t, this._entityManager = n, this._inputManager = r, this._levelManager = i, this._log = a?.getLogger("GameManager") || new M("GameManager"), this._boundRenderLoop = this._renderLoop.bind(this), this._boundResizeHandler = this._resizeHandler.bind(this), H() && window.addEventListener("resize", this._boundResizeHandler);
1135
+ this._engine = e, this._eventBus = t, this._entityManager = n, this._inputManager = r, this._levelManager = i, this._log = a?.getLogger("GameManager") || new M("GameManager"), this._boundRenderLoop = this._renderLoop.bind(this), this._boundResizeHandler = this._resizeHandler.bind(this), B() && window.addEventListener("resize", this._boundResizeHandler);
1136
1136
  }
1137
1137
  get currentScene() {
1138
1138
  return this._levelManager.currentLevel?.scene ?? null;
@@ -1192,23 +1192,23 @@ for (var we = class {
1192
1192
  });
1193
1193
  }
1194
1194
  async $teardown() {
1195
- this._log.info("Tearing down GameManager"), this.started && await this.stop(), H() && window.removeEventListener("resize", this._boundResizeHandler), this._frameCallbacks = [], this._log.info("GameManager torn down successfully");
1195
+ this._log.info("Tearing down GameManager"), this.started && await this.stop(), B() && window.removeEventListener("resize", this._boundResizeHandler), this._frameCallbacks = [], this._log.info("GameManager torn down successfully");
1196
1196
  }
1197
- }, W = 256, G = []; W--;) G[W] = (W + 256).toString(16).substring(1);
1198
- function Te(e) {
1197
+ }, H = 256, U = []; H--;) U[H] = (H + 256).toString(16).substring(1);
1198
+ function Oe(e) {
1199
1199
  e ||= 16;
1200
1200
  var t = "", n = 0;
1201
1201
  return function() {
1202
1202
  if (!t || n === 256) {
1203
- for (t = "", n = (1 + e) / 2 | 0; n--;) t += G[256 * Math.random() | 0];
1203
+ for (t = "", n = (1 + e) / 2 | 0; n--;) t += U[256 * Math.random() | 0];
1204
1204
  t = t.substring(n = 0, e - 2);
1205
1205
  }
1206
- return t + G[n++];
1206
+ return t + U[n++];
1207
1207
  };
1208
1208
  }
1209
1209
  //#endregion
1210
1210
  //#region src/utils/id.ts
1211
- var Ee = Te(16), K = class {
1211
+ var W = Oe(16), G = class {
1212
1212
  entity = null;
1213
1213
  $emit(e) {
1214
1214
  if (!this.entity) throw Error("Entity is not set for this behavior.");
@@ -1229,7 +1229,7 @@ var Ee = Te(16), K = class {
1229
1229
  $setEntity(e) {
1230
1230
  this.entity = e;
1231
1231
  }
1232
- }, De = class {
1232
+ }, K = class {
1233
1233
  id;
1234
1234
  type;
1235
1235
  name;
@@ -1244,7 +1244,7 @@ var Ee = Te(16), K = class {
1244
1244
  _tags = /* @__PURE__ */ new Set();
1245
1245
  subscriptions = /* @__PURE__ */ new Map();
1246
1246
  constructor(e, t, n, r, i) {
1247
- this.id = Ee(), this.type = e, this.name = i, this.state = n, this.eventBus = t;
1247
+ this.id = W(), this.type = e, this.name = i, this.state = n, this.eventBus = t;
1248
1248
  for (let e of r) this.attachBehavior(new e());
1249
1249
  }
1250
1250
  get tags() {
@@ -1413,7 +1413,7 @@ var Ee = Te(16), K = class {
1413
1413
  }
1414
1414
  return this.behaviors.splice(t, 1), n.$setEntity(null), !0;
1415
1415
  }
1416
- }, Oe = class {
1416
+ }, ke = class {
1417
1417
  eventBus;
1418
1418
  entities = /* @__PURE__ */ new Map();
1419
1419
  entityDefinitions = /* @__PURE__ */ new Map();
@@ -1537,7 +1537,7 @@ var Ee = Te(16), K = class {
1537
1537
  let t = await n.onBeforeCreate(r);
1538
1538
  t !== void 0 && (r = t);
1539
1539
  }
1540
- let i = t.name ?? n.name, a = new De(n.type, this.eventBus, r, n.behaviors, i);
1540
+ let i = t.name ?? n.name, a = new K(n.type, this.eventBus, r, n.behaviors, i);
1541
1541
  if (a.$setEntityManager(this), t.node && a.$attachToNode(t.node, this._engine), n.tags) for (let e of n.tags) a.$addTag(e);
1542
1542
  if (t.tags) for (let e of t.tags) a.$addTag(e);
1543
1543
  if (this.entities.set(a.id, a), this._indexEntity(a), this._log.debug(`Entity created with ID: ${a.id}${i ? ` (name: ${i})` : ""}`), n.onCreate) {
@@ -1707,18 +1707,18 @@ var Ee = Te(16), K = class {
1707
1707
  }
1708
1708
  this.entityDefinitions.clear(), this._entitiesByName.clear(), this._entitiesByType.clear(), this._entitiesByTag.clear(), this._entitiesByNode.clear(), this._log.info("EntityManager torn down successfully");
1709
1709
  }
1710
- }, ke = {
1710
+ }, Ae = {
1711
1711
  hable: h.TONEMAPPING_STANDARD,
1712
1712
  reinhard: h.TONEMAPPING_STANDARD,
1713
1713
  hejidawson: h.TONEMAPPING_STANDARD,
1714
1714
  photographic: h.TONEMAPPING_STANDARD,
1715
1715
  aces: h.TONEMAPPING_ACES
1716
1716
  };
1717
- function Ae(e, t) {
1717
+ function je(e, t) {
1718
1718
  if (!e.activeCamera) return;
1719
1719
  t.volumetric && console.warn("[SAGE] Volumetric lighting requires renderer: \"frameGraph\". Ignored in pipeline mode.");
1720
1720
  let n = new s("sage-default", !0, e, e.cameras);
1721
- if (t.bloom && (n.bloomEnabled = !0, t.bloom.weight !== void 0 && (n.bloomWeight = t.bloom.weight), t.bloom.threshold !== void 0 && (n.bloomThreshold = t.bloom.threshold), t.bloom.scale !== void 0 && (n.bloomScale = t.bloom.scale), t.bloom.kernel !== void 0 && (n.bloomKernel = t.bloom.kernel)), t.tonemap && (n.imageProcessingEnabled = !0, n.imageProcessing.toneMappingEnabled = !0, t.tonemap.operator && (n.imageProcessing.toneMappingType = ke[t.tonemap.operator] ?? h.TONEMAPPING_STANDARD)), t.grain && (n.grainEnabled = !0, t.grain.intensity !== void 0 && (n.grain.intensity = t.grain.intensity), t.grain.animated !== void 0 && (n.grain.animated = t.grain.animated)), t.vignette && (n.imageProcessingEnabled = !0, n.imageProcessing.vignetteEnabled = !0, t.vignette.weight !== void 0 && (n.imageProcessing.vignetteWeight = t.vignette.weight), t.vignette.stretch !== void 0 && (n.imageProcessing.vignetteStretch = t.vignette.stretch), t.vignette.color && (n.imageProcessing.vignetteColor = new i(t.vignette.color.r, t.vignette.color.g, t.vignette.color.b, 1))), t.sharpen && (n.sharpenEnabled = !0, t.sharpen.edge !== void 0 && (n.sharpen.edgeAmount = t.sharpen.edge), t.sharpen.color !== void 0 && (n.sharpen.colorAmount = t.sharpen.color)), t.chromaticAberration && (n.chromaticAberrationEnabled = !0, t.chromaticAberration.amount !== void 0 && (n.chromaticAberration.aberrationAmount = t.chromaticAberration.amount)), t.ssao) {
1721
+ if (t.bloom && (n.bloomEnabled = !0, t.bloom.weight !== void 0 && (n.bloomWeight = t.bloom.weight), t.bloom.threshold !== void 0 && (n.bloomThreshold = t.bloom.threshold), t.bloom.scale !== void 0 && (n.bloomScale = t.bloom.scale), t.bloom.kernel !== void 0 && (n.bloomKernel = t.bloom.kernel)), t.tonemap && (n.imageProcessingEnabled = !0, n.imageProcessing.toneMappingEnabled = !0, t.tonemap.operator && (n.imageProcessing.toneMappingType = Ae[t.tonemap.operator] ?? h.TONEMAPPING_STANDARD)), t.grain && (n.grainEnabled = !0, t.grain.intensity !== void 0 && (n.grain.intensity = t.grain.intensity), t.grain.animated !== void 0 && (n.grain.animated = t.grain.animated)), t.vignette && (n.imageProcessingEnabled = !0, n.imageProcessing.vignetteEnabled = !0, t.vignette.weight !== void 0 && (n.imageProcessing.vignetteWeight = t.vignette.weight), t.vignette.stretch !== void 0 && (n.imageProcessing.vignetteStretch = t.vignette.stretch), t.vignette.color && (n.imageProcessing.vignetteColor = new i(t.vignette.color.r, t.vignette.color.g, t.vignette.color.b, 1))), t.sharpen && (n.sharpenEnabled = !0, t.sharpen.edge !== void 0 && (n.sharpen.edgeAmount = t.sharpen.edge), t.sharpen.color !== void 0 && (n.sharpen.colorAmount = t.sharpen.color)), t.chromaticAberration && (n.chromaticAberrationEnabled = !0, t.chromaticAberration.amount !== void 0 && (n.chromaticAberration.aberrationAmount = t.chromaticAberration.amount)), t.ssao) {
1722
1722
  let n = new ne("sage-ssao", e, {
1723
1723
  ssaoRatio: .5,
1724
1724
  blurRatio: 1
@@ -1728,11 +1728,11 @@ function Ae(e, t) {
1728
1728
  }
1729
1729
  //#endregion
1730
1730
  //#region src/handlers/postProcessing.ts
1731
- async function je(e, t) {
1731
+ async function Me(e, t) {
1732
1732
  if (t.renderer === "frameGraph") {
1733
1733
  let { applyFrameGraphPostProcessing: n } = await import("./postProcessingFrameGraph-CaMgQzR-.js");
1734
1734
  await n(e, t);
1735
- } else Ae(e, t);
1735
+ } else je(e, t);
1736
1736
  }
1737
1737
  //#endregion
1738
1738
  //#region src/utils/vectors.ts
@@ -1744,9 +1744,9 @@ function q(e) {
1744
1744
  };
1745
1745
  }
1746
1746
  function J(e) {
1747
- return new T(e.x, e.y, e.z);
1747
+ return new A(e.x, e.y, e.z);
1748
1748
  }
1749
- function Me(e) {
1749
+ function Ne(e) {
1750
1750
  return {
1751
1751
  x: e.x,
1752
1752
  y: e.y,
@@ -1754,12 +1754,30 @@ function Me(e) {
1754
1754
  w: e.w
1755
1755
  };
1756
1756
  }
1757
- function Ne(e) {
1758
- return new te(e.x, e.y, e.z, e.w);
1757
+ function Pe(e) {
1758
+ return new w(e.x, e.y, e.z, e.w);
1759
+ }
1760
+ function Fe(e) {
1761
+ return v.Compose(e.scaling, e.rotationQuaternion ?? w.FromEulerVector(e.rotation), e.position);
1762
+ }
1763
+ function Ie(e) {
1764
+ e.computeWorldMatrix(!0);
1765
+ let t = Fe(e), n = e.parent;
1766
+ for (; n;) {
1767
+ n.computeWorldMatrix(!0);
1768
+ let e = Fe(n);
1769
+ e.determinant() >= 0 && (t = t.multiply(e)), n = n.parent;
1770
+ }
1771
+ let r = new A(), i = new w(), a = new A();
1772
+ return t.decompose(a, i, r), {
1773
+ position: r,
1774
+ rotation: i,
1775
+ scaling: a
1776
+ };
1759
1777
  }
1760
1778
  //#endregion
1761
1779
  //#region src/classes/level.ts
1762
- var Pe = class {
1780
+ var Le = class {
1763
1781
  name;
1764
1782
  _log;
1765
1783
  _context;
@@ -1822,7 +1840,7 @@ var Pe = class {
1822
1840
  this.outlines &&= (this.outlines.dispose(), null), this.clusteredLights &&= (this.clusteredLights.dispose(), null), this._scene.dispose(), this._scene = null;
1823
1841
  }
1824
1842
  }
1825
- }, Fe = class {
1843
+ }, Re = class {
1826
1844
  _scene;
1827
1845
  _layers = /* @__PURE__ */ new Map();
1828
1846
  constructor(e, t) {
@@ -1866,7 +1884,7 @@ var Pe = class {
1866
1884
  n.length > 0 && e.layer.addSelection(n);
1867
1885
  }
1868
1886
  }
1869
- }, Ie = class extends Pe {
1887
+ }, ze = class extends Le {
1870
1888
  _config;
1871
1889
  _spawnPoints = [];
1872
1890
  _entityNodes = [];
@@ -1888,9 +1906,9 @@ var Pe = class {
1888
1906
  let n = e.createScene();
1889
1907
  if (this._scene = n, this._config.physics && (this.$emitProgress(5, "Initializing physics..."), await this._enablePhysics(n)), this._config.scene && (this.$emitProgress(10, "Loading scene file..."), await this._loadSceneFile(n)), this._config.environment && (this.$emitProgress(15, "Setting up environment..."), this._processEnvironment(n)), this._processCameras(n), this._processLights(n), this._setupClustering(n), this._config.postProcessing) {
1890
1908
  let e = this._config.postProcessing.renderer ?? "pipeline";
1891
- this._log.info(`Applying post-processing with ${e} renderer`), await je(n, this._config.postProcessing);
1909
+ this._log.info(`Applying post-processing with ${e} renderer`), await Me(n, this._config.postProcessing);
1892
1910
  }
1893
- return this.outlines = new Fe(n, this._config.outlines), this.$emitProgress(50, "Processing scene properties..."), await this._processNodeProperties(n), this.$emitProgress(70, "Spawning entities..."), await this._processSpawnPoints(), this.$emitProgress(85, "Configuring entities..."), await this._processEntityNodes(), this._config.sounds && (this.$emitProgress(95, "Loading sounds..."), await this._processLevelSounds()), n;
1911
+ return this.outlines = new Re(n, this._config.outlines), this.$emitProgress(50, "Processing scene properties..."), await this._processNodeProperties(n), this.$emitProgress(70, "Spawning entities..."), await this._processSpawnPoints(), this.$emitProgress(85, "Configuring entities..."), await this._processEntityNodes(), this._config.sounds && (this.$emitProgress(95, "Loading sounds..."), await this._processLevelSounds()), n;
1894
1912
  }
1895
1913
  async _loadSceneFile(e) {
1896
1914
  let t = this._getScenePath();
@@ -1921,11 +1939,11 @@ var Pe = class {
1921
1939
  }
1922
1940
  e.environmentTexture && e.createDefaultSkybox(e.environmentTexture, !0, t.skyboxSize ?? 1e3, 0, !1);
1923
1941
  } else {
1924
- let n = t.skyboxSize ?? 1e3, r = y.CreateSphere("skybox", {
1942
+ let n = t.skyboxSize ?? 1e3, r = b.CreateSphere("skybox", {
1925
1943
  diameter: n,
1926
1944
  segments: 32
1927
- }, e), i = new se("skybox-mat", e);
1928
- i.backFaceCulling = !1, i.disableLighting = !0, i.emissiveTexture = new ce(t.skybox, e), r.material = i, r.infiniteDistance = !0;
1945
+ }, e), i = new O("skybox-mat", e);
1946
+ i.backFaceCulling = !1, i.disableLighting = !0, i.emissiveTexture = new ae(t.skybox, e), r.material = i, r.infiniteDistance = !0;
1929
1947
  }
1930
1948
  this._log.debug(`Skybox set from: ${t.skybox}`);
1931
1949
  }
@@ -1961,19 +1979,19 @@ var Pe = class {
1961
1979
  }
1962
1980
  }
1963
1981
  _createCamera(e, t, r) {
1964
- let i = t.position ? J(t.position) : T.Zero(), a;
1982
+ let i = t.position ? J(t.position) : A.Zero(), a;
1965
1983
  switch (t.type) {
1966
1984
  case "arcRotate": {
1967
- let i = t.target ? J(t.target) : T.Zero();
1985
+ let i = t.target ? J(t.target) : A.Zero();
1968
1986
  a = new n(e, t.alpha ?? Math.PI / 2, t.beta ?? Math.PI / 3, t.radius ?? 10, i, r);
1969
1987
  break;
1970
1988
  }
1971
1989
  case "universal":
1972
- a = new ue(e, i, r);
1990
+ a = new oe(e, i, r);
1973
1991
  break;
1974
1992
  case "geospatial": {
1975
- if (!t.planetRadius) return this._log.warn(`Geospatial camera "${e}" requires planetRadius -- skipping`), new d(e, T.Zero(), r);
1976
- let n = new E(e, r, { planetRadius: t.planetRadius });
1993
+ if (!t.planetRadius) return this._log.warn(`Geospatial camera "${e}" requires planetRadius -- skipping`), new d(e, A.Zero(), r);
1994
+ let n = new le(e, r, { planetRadius: t.planetRadius });
1977
1995
  t.center && (n.center = J(t.center)), t.yaw !== void 0 && (n.yaw = t.yaw), t.pitch !== void 0 && (n.pitch = t.pitch), t.radius !== void 0 && (n.radius = t.radius), t.checkCollisions !== void 0 && (n.checkCollisions = t.checkCollisions), t.radiusMin !== void 0 && (n.limits.radiusMin = t.radiusMin), t.radiusMax !== void 0 && (n.limits.radiusMax = t.radiusMax), t.pitchMin !== void 0 && (n.limits.pitchMin = t.pitchMin), t.pitchMax !== void 0 && (n.limits.pitchMax = t.pitchMax), t.yawMin !== void 0 && (n.limits.yawMin = t.yawMin), t.yawMax !== void 0 && (n.limits.yawMax = t.yawMax), a = n;
1978
1996
  break;
1979
1997
  }
@@ -1984,7 +2002,7 @@ var Pe = class {
1984
2002
  return this._applyCameraConfig(a, t), a;
1985
2003
  }
1986
2004
  _applyCameraConfig(e, t) {
1987
- t.fov !== void 0 && (e.fov = t.fov), t.position && (e.position = J(t.position)), t.minZ !== void 0 && (e.minZ = t.minZ), t.maxZ !== void 0 && (e.maxZ = t.maxZ), e instanceof d && (t.speed !== void 0 && (e.speed = t.speed), t.rotation && (e.rotation = J(t.rotation))), e instanceof n && (t.target && e.setTarget(J(t.target)), t.lowerRadiusLimit !== void 0 && (e.lowerRadiusLimit = t.lowerRadiusLimit), t.upperRadiusLimit !== void 0 && (e.upperRadiusLimit = t.upperRadiusLimit), t.lowerBetaLimit !== void 0 && (e.lowerBetaLimit = t.lowerBetaLimit), t.upperBetaLimit !== void 0 && (e.upperBetaLimit = t.upperBetaLimit), t.wheelPrecision !== void 0 && (e.wheelPrecision = t.wheelPrecision)), e instanceof E && (t.yaw !== void 0 && (e.yaw = t.yaw), t.pitch !== void 0 && (e.pitch = t.pitch), t.radius !== void 0 && (e.radius = t.radius), t.center && (e.center = J(t.center)), t.checkCollisions !== void 0 && (e.checkCollisions = t.checkCollisions), t.radiusMin !== void 0 && (e.limits.radiusMin = t.radiusMin), t.radiusMax !== void 0 && (e.limits.radiusMax = t.radiusMax), t.pitchMin !== void 0 && (e.limits.pitchMin = t.pitchMin), t.pitchMax !== void 0 && (e.limits.pitchMax = t.pitchMax));
2005
+ t.fov !== void 0 && (e.fov = t.fov), t.position && (e.position = J(t.position)), t.minZ !== void 0 && (e.minZ = t.minZ), t.maxZ !== void 0 && (e.maxZ = t.maxZ), e instanceof d && (t.speed !== void 0 && (e.speed = t.speed), t.rotation && (e.rotation = J(t.rotation))), e instanceof n && (t.target && e.setTarget(J(t.target)), t.lowerRadiusLimit !== void 0 && (e.lowerRadiusLimit = t.lowerRadiusLimit), t.upperRadiusLimit !== void 0 && (e.upperRadiusLimit = t.upperRadiusLimit), t.lowerBetaLimit !== void 0 && (e.lowerBetaLimit = t.lowerBetaLimit), t.upperBetaLimit !== void 0 && (e.upperBetaLimit = t.upperBetaLimit), t.wheelPrecision !== void 0 && (e.wheelPrecision = t.wheelPrecision)), e instanceof le && (t.yaw !== void 0 && (e.yaw = t.yaw), t.pitch !== void 0 && (e.pitch = t.pitch), t.radius !== void 0 && (e.radius = t.radius), t.center && (e.center = J(t.center)), t.checkCollisions !== void 0 && (e.checkCollisions = t.checkCollisions), t.radiusMin !== void 0 && (e.limits.radiusMin = t.radiusMin), t.radiusMax !== void 0 && (e.limits.radiusMax = t.radiusMax), t.pitchMin !== void 0 && (e.limits.pitchMin = t.pitchMin), t.pitchMax !== void 0 && (e.limits.pitchMax = t.pitchMax));
1988
2006
  }
1989
2007
  _processLights(e) {
1990
2008
  let t = this._config.lights;
@@ -1994,7 +2012,7 @@ var Pe = class {
1994
2012
  }
1995
2013
  }
1996
2014
  _createLight(e, t, n) {
1997
- let r = t.direction ? J(t.direction) : new T(0, -1, 0), i = t.position ? J(t.position) : T.Zero();
2015
+ let r = t.direction ? J(t.direction) : new A(0, -1, 0), i = t.position ? J(t.position) : A.Zero();
1998
2016
  switch (t.type) {
1999
2017
  case "hemispheric": {
2000
2018
  let i = new m(e, r, n);
@@ -2007,20 +2025,20 @@ var Pe = class {
2007
2025
  break;
2008
2026
  }
2009
2027
  case "point": {
2010
- let r = new C(e, i, n);
2028
+ let r = new te(e, i, n);
2011
2029
  this._applyLightConfig(r, t);
2012
2030
  break;
2013
2031
  }
2014
2032
  case "spot": {
2015
- let a = new oe(e, i, r, t.angle ?? Math.PI / 3, t.exponent ?? 2, n);
2033
+ let a = new D(e, i, r, t.angle ?? Math.PI / 3, t.exponent ?? 2, n);
2016
2034
  this._applyLightConfig(a, t);
2017
2035
  break;
2018
2036
  }
2019
2037
  case "rectarea": {
2020
- let a = new w(e, i, t.width ?? 1, t.height ?? 1, n);
2038
+ let a = new T(e, i, t.width ?? 1, t.height ?? 1, n);
2021
2039
  if (this._applyLightConfig(a, t), t.direction) {
2022
- let t = new le(`${e}_pivot`, n);
2023
- t.position = a.position.clone(), a.position = T.Zero(), a.parent = t, t.lookAt(t.position.subtract(r));
2040
+ let t = new k(`${e}_pivot`, n);
2041
+ t.position = a.position.clone(), a.position = A.Zero(), a.parent = t, t.lookAt(t.position.subtract(r));
2024
2042
  }
2025
2043
  break;
2026
2044
  }
@@ -2032,22 +2050,22 @@ var Pe = class {
2032
2050
  _setupClustering(e) {
2033
2051
  let t = this._config.clustering;
2034
2052
  if (!t?.enabled) return;
2035
- let n = e.lights.filter((e) => D.IsLightSupported(e));
2053
+ let n = e.lights.filter((e) => ue.IsLightSupported(e));
2036
2054
  if (n.length === 0) {
2037
2055
  this._log.debug("Clustering enabled but no eligible lights found");
2038
2056
  return;
2039
2057
  }
2040
2058
  for (let t of n) e.removeLight(t);
2041
- let r = new D("sage-clustered", n, e);
2059
+ let r = new ue("sage-clustered", n, e);
2042
2060
  t.horizontalTiles !== void 0 && (r.horizontalTiles = t.horizontalTiles), t.verticalTiles !== void 0 && (r.verticalTiles = t.verticalTiles), t.depthSlices !== void 0 && (r.depthSlices = t.depthSlices), t.maxRange !== void 0 && (r.maxRange = t.maxRange), this.clusteredLights = r, this._log.debug(`Clustered lighting enabled: ${n.length} lights, ${r.horizontalTiles}x${r.verticalTiles} tiles, ${r.depthSlices} depth slices`);
2043
- for (let t of e.materials) t instanceof x && (t.useGLTFLightFalloff = !0);
2061
+ for (let t of e.materials) t instanceof ee && (t.useGLTFLightFalloff = !0);
2044
2062
  }
2045
2063
  _toColor3(e) {
2046
2064
  return new r(e.r, e.g, e.b);
2047
2065
  }
2048
2066
  async _enablePhysics(e) {
2049
- let t = this._config.physics, n = new T(0, -9.81, 0);
2050
- typeof t == "object" && t.gravity && (n = new T(t.gravity.x, t.gravity.y, t.gravity.z));
2067
+ let t = this._config.physics, n = new A(0, -9.81, 0);
2068
+ typeof t == "object" && t.gravity && (n = new A(t.gravity.x, t.gravity.y, t.gravity.z));
2051
2069
  let r = this.gameEngine.largeWorldRendering ? 1e5 : void 0;
2052
2070
  this._log.debug(`Enabling physics with gravity: ${n.toString()}`), await this.gameEngine.engines.sceneEngine.enablePhysics(e, n, r);
2053
2071
  }
@@ -2068,13 +2086,17 @@ var Pe = class {
2068
2086
  return t ? { ...t } : e.metadata;
2069
2087
  }
2070
2088
  async _processNodeMetadata(e) {
2071
- "spawn" in e.metadata && this._spawnPoints.push({
2072
- name: e.metadata.spawn,
2073
- position: e.getAbsolutePosition(),
2074
- rotation: e.absoluteRotationQuaternion.clone(),
2075
- scaling: e.scaling.clone(),
2076
- node: e
2077
- }), "entity" in e.metadata && this._entityNodes.push({
2089
+ if ("spawn" in e.metadata) {
2090
+ let { position: t, rotation: n, scaling: r } = Ie(e);
2091
+ this._spawnPoints.push({
2092
+ name: e.metadata.spawn,
2093
+ position: t,
2094
+ rotation: n,
2095
+ scaling: r,
2096
+ node: e
2097
+ });
2098
+ }
2099
+ "entity" in e.metadata && this._entityNodes.push({
2078
2100
  type: e.metadata.entity,
2079
2101
  node: e
2080
2102
  }), await this._runPropertyHandlers(e);
@@ -2104,7 +2126,7 @@ var Pe = class {
2104
2126
  let n = {
2105
2127
  ...e.config,
2106
2128
  position: q(t.position),
2107
- rotation: Me(t.rotation),
2129
+ rotation: Ne(t.rotation),
2108
2130
  scaling: q(t.scaling)
2109
2131
  }, r = await this.gameEngine.managers.entityManager.createEntity(e.entity, {
2110
2132
  name: e.name,
@@ -2117,12 +2139,10 @@ var Pe = class {
2117
2139
  if (!this._scene) return;
2118
2140
  let n = this.gameEngine.managers.entityManager.getDefinition(e.type);
2119
2141
  if (!n?.mesh) return;
2120
- let r = n.mesh, i = this._scene, a = new le(`entity-${e.id}`, i);
2121
- a.position.copyFrom(t.position), a.rotationQuaternion = t.rotation.clone(), a.scaling.copyFrom(t.scaling);
2122
- let o;
2142
+ let r = n.mesh, i = this._scene, a = new k(`entity-${e.id}`, i), o;
2123
2143
  switch (r.source) {
2124
2144
  case "box":
2125
- o = [y.CreateBox(`${e.type}-mesh`, {
2145
+ o = [b.CreateBox(`${e.type}-mesh`, {
2126
2146
  size: r.params?.size ?? 1,
2127
2147
  width: r.params?.width,
2128
2148
  height: r.params?.height,
@@ -2130,19 +2150,19 @@ var Pe = class {
2130
2150
  }, i)];
2131
2151
  break;
2132
2152
  case "sphere":
2133
- o = [y.CreateSphere(`${e.type}-mesh`, {
2153
+ o = [b.CreateSphere(`${e.type}-mesh`, {
2134
2154
  diameter: r.params?.diameter ?? 1,
2135
2155
  segments: r.params?.segments ?? 16
2136
2156
  }, i)];
2137
2157
  break;
2138
2158
  case "capsule":
2139
- o = [y.CreateCapsule(`${e.type}-mesh`, {
2159
+ o = [b.CreateCapsule(`${e.type}-mesh`, {
2140
2160
  height: r.params?.height ?? 1.8,
2141
2161
  radius: r.params?.radius ?? .4
2142
2162
  }, i)];
2143
2163
  break;
2144
2164
  case "cylinder":
2145
- o = [y.CreateCylinder(`${e.type}-mesh`, {
2165
+ o = [b.CreateCylinder(`${e.type}-mesh`, {
2146
2166
  height: r.params?.height ?? 1,
2147
2167
  diameter: r.params?.diameter ?? 1
2148
2168
  }, i)];
@@ -2159,21 +2179,21 @@ var Pe = class {
2159
2179
  }
2160
2180
  }
2161
2181
  for (let e of o) e.parent ||= a;
2162
- r.scale && (typeof r.scale == "number" ? a.scaling.setAll(r.scale) : a.scaling.set(r.scale.x, r.scale.y, r.scale.z));
2182
+ a.position.copyFrom(t.position), a.rotationQuaternion = t.rotation.clone(), a.scaling.copyFrom(t.scaling), r.scale && (typeof r.scale == "number" ? a.scaling.setAll(r.scale) : a.scaling.set(r.scale.x, r.scale.y, r.scale.z));
2163
2183
  let s = r.material;
2164
2184
  if (s?.color) {
2165
2185
  let t = s.color;
2166
2186
  if (s.type === "pbr") {
2167
- let n = new x(`${e.type}-material`, i);
2187
+ let n = new ee(`${e.type}-material`, i);
2168
2188
  n.albedoColor = this._toColor3(t), s.emissive && (n.emissiveColor = this._toColor3(s.emissive)), n.metallic = s.metallic ?? 0, n.roughness = s.roughness ?? 1;
2169
2189
  for (let e of o) e.material = n;
2170
2190
  } else {
2171
- let n = new se(`${e.type}-material`, i);
2191
+ let n = new O(`${e.type}-material`, i);
2172
2192
  n.diffuseColor = this._toColor3(t), s.emissive && (n.emissiveColor = this._toColor3(s.emissive));
2173
2193
  for (let e of o) e.material = n;
2174
2194
  }
2175
2195
  }
2176
- let c = [...o, ...a.getChildren()];
2196
+ let c = a.getDescendants(!1).filter((e) => e instanceof k);
2177
2197
  for (let e of c) {
2178
2198
  let t = this._getNormalizedMetadata(e);
2179
2199
  t && Object.keys(t).length > 0 && (e.metadata = {
@@ -2222,7 +2242,7 @@ var Pe = class {
2222
2242
  }
2223
2243
  }
2224
2244
  async onDeactivate() {
2225
- for (let [e, t] of this._levelSounds) t.state === ae.Started && (this._playingSoundsBeforeDeactivate.add(e), t.pause());
2245
+ for (let [e, t] of this._levelSounds) t.state === E.Started && (this._playingSoundsBeforeDeactivate.add(e), t.pause());
2226
2246
  }
2227
2247
  async onActivate() {
2228
2248
  for (let e of this._playingSoundsBeforeDeactivate) {
@@ -2243,7 +2263,7 @@ var Pe = class {
2243
2263
  for (let e of this._levelSounds.values()) e.dispose();
2244
2264
  this._levelSounds.clear(), this._playingSoundsBeforeDeactivate.clear(), await super.$dispose();
2245
2265
  }
2246
- }, Le = class {
2266
+ }, Be = class {
2247
2267
  _eventBus;
2248
2268
  _gameEngine = null;
2249
2269
  _log;
@@ -2296,7 +2316,7 @@ var Pe = class {
2296
2316
  if (!n) throw Error(`Level class '${e.class}' is not registered.`);
2297
2317
  return this._log.debug(`Creating level '${e.name}' using class '${e.class}'`), new n(e, t);
2298
2318
  }
2299
- return this._log.debug(`Creating level '${e.name}' using GameLevel`), new Ie(e, t);
2319
+ return this._log.debug(`Creating level '${e.name}' using GameLevel`), new ze(e, t);
2300
2320
  }
2301
2321
  registerLevelConfig(e) {
2302
2322
  this._levelConfigs.has(e.name) && this._log.warn(`Level config '${e.name}' is already registered. Overwriting.`), this._levelConfigs.set(e.name, e), this._log.info(`Registered level config: ${e.name}`);
@@ -2382,7 +2402,7 @@ var Pe = class {
2382
2402
  for (let e of this._loadedLevels.values()) await e.$dispose();
2383
2403
  this._loadedLevels.clear(), this._levelConfigs.clear(), this._currentLevel = null;
2384
2404
  }
2385
- }, Re = class {
2405
+ }, Ve = class {
2386
2406
  _audioEngine;
2387
2407
  _channels = /* @__PURE__ */ new Map();
2388
2408
  _masterMuted = !1;
@@ -2453,7 +2473,7 @@ var Pe = class {
2453
2473
  getChannels() {
2454
2474
  return Array.from(this._channels.keys());
2455
2475
  }
2456
- }, ze = class {
2476
+ }, He = class {
2457
2477
  _entityManager;
2458
2478
  _levelManager;
2459
2479
  _log;
@@ -2543,7 +2563,7 @@ var Pe = class {
2543
2563
  async $teardown() {
2544
2564
  this._beforeSerializeHooks = [], this._afterDeserializeHooks = [], this._log.info("SaveManager torn down");
2545
2565
  }
2546
- }, Be = class {
2566
+ }, Ue = class {
2547
2567
  _keyboardDevice;
2548
2568
  _keysState = {};
2549
2569
  _onDeviceConnected;
@@ -2608,7 +2628,7 @@ var Pe = class {
2608
2628
  _notifyInputChanged(e) {
2609
2629
  this._onInputChanged && this._onInputChanged(this._keyboardDevice, e);
2610
2630
  }
2611
- }, Ve = class {
2631
+ }, We = class {
2612
2632
  _targetElement;
2613
2633
  _mouseDevice;
2614
2634
  _buttonState = {};
@@ -2727,7 +2747,7 @@ var Pe = class {
2727
2747
  _notifyInputChanged(e) {
2728
2748
  this._onInputChanged && this._onInputChanged(this._mouseDevice, e);
2729
2749
  }
2730
- }, He = class {
2750
+ }, Ge = class {
2731
2751
  _gamepadDevices = {};
2732
2752
  _buttonStates = {};
2733
2753
  _axesStates = {};
@@ -2861,14 +2881,14 @@ var Pe = class {
2861
2881
  _notifyInputChanged(e, t) {
2862
2882
  this._onInputChanged && this._onInputChanged(e, t);
2863
2883
  }
2864
- }, Ue = class {
2884
+ }, Ke = class {
2865
2885
  _eventBus;
2866
2886
  _keyboardRA;
2867
2887
  _mouseRA;
2868
2888
  _gamepadRA;
2869
2889
  _log;
2870
2890
  constructor(e, t, n) {
2871
- this._eventBus = e, this._log = n?.getLogger("UserInputManager") || new M("UserInputManager"), this._log.info("Initializing UserInputManager"), this._log.debug("Initializing input resource access classes"), this._keyboardRA = new Be(), this._mouseRA = new Ve(t), this._gamepadRA = new He(), this._log.debug("Registering input event callbacks"), this._keyboardRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._keyboardRA.onInputChanged(this._publishInputChanged.bind(this)), this._mouseRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._mouseRA.onInputChanged(this._publishInputChanged.bind(this)), this._gamepadRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._gamepadRA.onDeviceDisconnected(this._publishDeviceDisconnected.bind(this)), this._gamepadRA.onInputChanged(this._publishInputChanged.bind(this)), this._log.info("UserInputManager initialized successfully");
2891
+ this._eventBus = e, this._log = n?.getLogger("UserInputManager") || new M("UserInputManager"), this._log.info("Initializing UserInputManager"), this._log.debug("Initializing input resource access classes"), this._keyboardRA = new Ue(), this._mouseRA = new We(t), this._gamepadRA = new Ge(), this._log.debug("Registering input event callbacks"), this._keyboardRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._keyboardRA.onInputChanged(this._publishInputChanged.bind(this)), this._mouseRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._mouseRA.onInputChanged(this._publishInputChanged.bind(this)), this._gamepadRA.onDeviceConnected(this._publishDeviceConnected.bind(this)), this._gamepadRA.onDeviceDisconnected(this._publishDeviceDisconnected.bind(this)), this._gamepadRA.onInputChanged(this._publishInputChanged.bind(this)), this._log.info("UserInputManager initialized successfully");
2872
2892
  }
2873
2893
  _publishDeviceConnected(e) {
2874
2894
  this._log.debug(`Device connected: ${e.id} (${e.name})`), this._eventBus.publish({
@@ -2921,18 +2941,18 @@ var Pe = class {
2921
2941
  };
2922
2942
  //#endregion
2923
2943
  //#region src/utils/graphics.ts
2924
- async function We(e, t) {
2925
- let n = new de(e, t);
2944
+ async function qe(e, t) {
2945
+ let n = new se(e, t);
2926
2946
  return await n.initAsync(), n;
2927
2947
  }
2928
2948
  function Y(e, t) {
2929
2949
  return new l(e, t.antialias, t.options, t.adaptToDeviceRatio);
2930
2950
  }
2931
- function Ge(e) {
2932
- return new b(e);
2951
+ function Je(e) {
2952
+ return new x(e);
2933
2953
  }
2934
- async function Ke(e, t, n = !1) {
2935
- if (e === null) return console.debug("Using Null Engine"), Ge(t);
2954
+ async function Ye(e, t, n = !1) {
2955
+ if (e === null) return console.debug("Using Null Engine"), Je(t);
2936
2956
  if (n) if ("options" in t) {
2937
2957
  let e = t;
2938
2958
  t = {
@@ -2947,15 +2967,15 @@ async function Ke(e, t, n = !1) {
2947
2967
  useLargeWorldRendering: !0
2948
2968
  };
2949
2969
  let r = t.engine || "auto";
2950
- if (r === "webgpu") if (U()) try {
2951
- return console.debug("Using forced WebGPU engine"), await We(e, t);
2970
+ if (r === "webgpu") if (V()) try {
2971
+ return console.debug("Using forced WebGPU engine"), await qe(e, t);
2952
2972
  } catch (e) {
2953
2973
  throw console.error("Forced WebGPU initialization failed:", e), Error("Forced WebGPU failed to initialize. If WebGPU is required, check browser compatibility.", { cause: e });
2954
2974
  }
2955
2975
  else throw Error("WebGPU was forced but is not available in this browser.");
2956
2976
  if (r === "webgl") return console.debug("Using forced WebGL engine"), Y(e, t);
2957
- if (U()) try {
2958
- return console.debug("Using WebGPU"), We(e, t).catch((n) => (console.warn("WebGPU initialization failed, falling back to WebGL:", n), Y(e, t)));
2977
+ if (V()) try {
2978
+ return console.debug("Using WebGPU"), qe(e, t).catch((n) => (console.warn("WebGPU initialization failed, falling back to WebGL:", n), Y(e, t)));
2959
2979
  } catch (e) {
2960
2980
  console.warn("WebGPU initialization failed, falling back to WebGL:", e);
2961
2981
  }
@@ -2964,15 +2984,15 @@ async function Ke(e, t, n = !1) {
2964
2984
  }
2965
2985
  //#endregion
2966
2986
  //#region src/utils/physics.ts
2967
- async function qe() {
2968
- return await pe();
2987
+ async function Xe() {
2988
+ return await de();
2969
2989
  }
2970
- function Je(e) {
2990
+ function Ze(e) {
2971
2991
  return new p(!0, e);
2972
2992
  }
2973
2993
  //#endregion
2974
2994
  //#region src/utils/raycast.ts
2975
- var Ye = class {
2995
+ var Qe = class {
2976
2996
  _entityManager;
2977
2997
  constructor(e) {
2978
2998
  this._entityManager = e;
@@ -3038,7 +3058,7 @@ var Ye = class {
3038
3058
  pickingInfo: e
3039
3059
  };
3040
3060
  }
3041
- }, Xe = class {
3061
+ }, $e = class {
3042
3062
  _nextId = 0;
3043
3063
  _delays = [];
3044
3064
  _intervals = [];
@@ -3093,14 +3113,14 @@ var Ye = class {
3093
3113
  for (let t of this._intervals) for (t.elapsed += e; t.elapsed >= t.periodMs;) t.callback(), t.elapsed -= t.periodMs;
3094
3114
  for (let t of this._cooldowns) t.remaining > 0 && (t.remaining = Math.max(0, t.remaining - e));
3095
3115
  }
3096
- }, Ze = [
3116
+ }, et = [
3097
3117
  "trace",
3098
3118
  "debug",
3099
3119
  "info",
3100
3120
  "warn",
3101
3121
  "error",
3102
3122
  "none"
3103
- ], Qe = class extends K {
3123
+ ], tt = class extends G {
3104
3124
  name = "sound";
3105
3125
  eventSubscriptions = [];
3106
3126
  _sounds = /* @__PURE__ */ new Map();
@@ -3169,7 +3189,7 @@ var Ye = class {
3169
3189
  } else for (let t of this._sounds.values()) t.volume = e;
3170
3190
  }
3171
3191
  isPlaying(e) {
3172
- return this._getSound(e)?.state === ae.Started;
3192
+ return this._getSound(e)?.state === E.Started;
3173
3193
  }
3174
3194
  getSoundNames() {
3175
3195
  return Array.from(this._sounds.keys());
@@ -3245,7 +3265,7 @@ var Ye = class {
3245
3265
  }
3246
3266
  });
3247
3267
  }
3248
- }, $e = class extends K {
3268
+ }, nt = class extends G {
3249
3269
  name = "stateMachine";
3250
3270
  eventSubscriptions = [];
3251
3271
  stateMachine;
@@ -3264,7 +3284,7 @@ var Ye = class {
3264
3284
  }
3265
3285
  static create(e) {
3266
3286
  let { initialState: t, stateKey: n, transitions: r, wildcardTransitions: i } = e;
3267
- class a extends $e {
3287
+ class a extends nt {
3268
3288
  constructor() {
3269
3289
  super(), this.stateKey = n, this.stateMachine = new X(t);
3270
3290
  for (let e of r) this.stateMachine.addTransition(e.from, e.to, e.guard);
@@ -3276,55 +3296,52 @@ var Ye = class {
3276
3296
  }, Z = new M("ColliderHandler");
3277
3297
  function Q(e, t, n) {
3278
3298
  let r = e.getScene();
3279
- new ee(e, t, { mass: n }, r);
3299
+ new S(e, t, { mass: n }, r);
3280
3300
  }
3281
- function et(e, t) {
3301
+ function rt(e, t) {
3282
3302
  let n = e.getChildMeshes().find((e) => e.metadata?.collider_mesh === !0);
3283
- n instanceof v ? (n.isVisible = !1, Q(n, S.MESH, t)) : Q(e, S.MESH, t);
3303
+ n instanceof y ? (n.isVisible = !1, Q(n, C.MESH, t)) : Q(e, C.MESH, t);
3284
3304
  }
3285
- function tt(t) {
3305
+ function it(t) {
3286
3306
  t.registerPropertyHandler("collider", (t, n, r, i) => {
3287
3307
  let a = n;
3288
- if (Z.debug(`Processing collider: ${t.name} -> ${a} (isMesh: ${t instanceof v})`), !r.scene) throw Error("Scene not available for collider handler");
3289
- if (!(t instanceof v) && a === "mesh") {
3308
+ if (Z.debug(`Processing collider: ${t.name} -> ${a} (isMesh: ${t instanceof y})`), !r.scene) throw Error("Scene not available for collider handler");
3309
+ if (!(t instanceof y) && a === "mesh") {
3290
3310
  Z.warn(`Skipping mesh collider for ${t.name}: not a Mesh instance`);
3291
3311
  return;
3292
3312
  }
3293
3313
  let o = t.metadata?.collider_mass ?? 0;
3294
3314
  switch (a) {
3295
3315
  case "box":
3296
- Q(t, S.BOX, o);
3316
+ Q(t, C.BOX, o);
3297
3317
  break;
3298
3318
  case "sphere":
3299
- Q(t, S.SPHERE, o);
3319
+ Q(t, C.SPHERE, o);
3300
3320
  break;
3301
3321
  case "mesh":
3302
- et(t, o);
3322
+ rt(t, o);
3303
3323
  break;
3304
3324
  case "none":
3305
3325
  t instanceof e && (t.checkCollisions = !1);
3306
3326
  break;
3307
3327
  default: Z.warn(`Unknown collider type: ${a}`);
3308
3328
  }
3309
- if (t.metadata?.collider_kinematic) {
3310
- let e = t;
3311
- e.physicsBody && (e.physicsBody.disablePreStep = !1);
3312
- }
3329
+ t.metadata?.collider_kinematic && t instanceof e && t.physicsBody && (t.physicsBody.disablePreStep = !1);
3313
3330
  });
3314
3331
  }
3315
3332
  //#endregion
3316
3333
  //#region src/handlers/lod.ts
3317
- var nt = new M("LodHandler");
3318
- function rt(e) {
3334
+ var at = new M("LodHandler");
3335
+ function ot(e) {
3319
3336
  return e.split(",").map((e) => parseFloat(e.trim())).filter((e) => !isNaN(e));
3320
3337
  }
3321
- function it(e) {
3338
+ function st(e) {
3322
3339
  e.registerPropertyHandler("lod_distances", (e, t, n, r) => {
3323
3340
  let i = t;
3324
- if (!(e instanceof v)) return;
3325
- let a = rt(i);
3341
+ if (!(e instanceof y)) return;
3342
+ let a = ot(i);
3326
3343
  if (a.length === 0) {
3327
- nt.warn(`Invalid lod_distances value: ${i}`);
3344
+ at.warn(`Invalid lod_distances value: ${i}`);
3328
3345
  return;
3329
3346
  }
3330
3347
  let o = e.getChildMeshes(!0), s = Math.min(a.length, o.length);
@@ -3337,12 +3354,12 @@ function it(e) {
3337
3354
  //#region src/handlers/occluder.ts
3338
3355
  function $(e) {
3339
3356
  e.registerPropertyHandler("occluder", (e, t, n, r) => {
3340
- t && e instanceof v && (e.isOccluder = !0, e.isVisible = !1);
3357
+ t && e instanceof y && (e.isOccluder = !0, e.isVisible = !1);
3341
3358
  });
3342
3359
  }
3343
3360
  //#endregion
3344
3361
  //#region src/utils/metadata.ts
3345
- function at(e, t) {
3362
+ function ct(e, t) {
3346
3363
  let n = {}, r = `${t}_`;
3347
3364
  for (let [t, i] of Object.entries(e)) if (t.startsWith(r)) {
3348
3365
  let e = t.slice(r.length);
@@ -3352,14 +3369,14 @@ function at(e, t) {
3352
3369
  }
3353
3370
  //#endregion
3354
3371
  //#region src/handlers/sound.ts
3355
- var ot = new M("SoundHandler");
3356
- function st(e) {
3372
+ var lt = new M("SoundHandler");
3373
+ function ut(e) {
3357
3374
  e.registerPropertyHandler("sound", (e, t, n, r) => {
3358
3375
  let i = t;
3359
3376
  if (!n.scene) throw Error("Scene not available for sound handler");
3360
- let a = at(e.metadata, "sound"), o = a.volume ?? 1, s = a.loop ?? !0, c = a.spatial ?? !0, l = a.distance ?? 100, u = a.autoplay ?? !0, d = a.channel ?? "ambient", f = r.managers.audioManager;
3377
+ let a = ct(e.metadata, "sound"), o = a.volume ?? 1, s = a.loop ?? !0, c = a.spatial ?? !0, l = a.distance ?? 100, u = a.autoplay ?? !0, d = a.channel ?? "ambient", f = r.managers.audioManager;
3361
3378
  if (!f) {
3362
- ot.warn(`No AudioManager available. Sound for "${e.name}" skipped.`);
3379
+ lt.warn(`No AudioManager available. Sound for "${e.name}" skipped.`);
3363
3380
  return;
3364
3381
  }
3365
3382
  f.createSound(`${e.name}_sound`, i, d, {
@@ -3372,13 +3389,13 @@ function st(e) {
3372
3389
  }).then((t) => {
3373
3390
  c && t.spatial.attach(e);
3374
3391
  }).catch((t) => {
3375
- ot.error(`Failed to create sound for node "${e.name}": ${t}`);
3392
+ lt.error(`Failed to create sound for node "${e.name}": ${t}`);
3376
3393
  });
3377
3394
  });
3378
3395
  }
3379
3396
  //#endregion
3380
3397
  //#region src/handlers/trigger.ts
3381
- function ct(e, n, r, i, a) {
3398
+ function dt(e, n, r, i, a) {
3382
3399
  let o = a === "enter" ? t.OnIntersectionEnterTrigger : t.OnIntersectionExitTrigger, s = `trigger:${a}`;
3383
3400
  e.registerAction(new u({
3384
3401
  trigger: o,
@@ -3393,10 +3410,10 @@ function ct(e, n, r, i, a) {
3393
3410
  });
3394
3411
  }));
3395
3412
  }
3396
- function lt(e, t, n, r) {
3397
- ct(e, t, n, r, "enter"), ct(e, t, n, r, "exit");
3413
+ function ft(e, t, n, r) {
3414
+ dt(e, t, n, r, "enter"), dt(e, t, n, r, "exit");
3398
3415
  }
3399
- function ut(n) {
3416
+ function pt(n) {
3400
3417
  n.registerPropertyHandler("trigger", (n, r, i, a) => {
3401
3418
  let o = r, s = i.scene;
3402
3419
  if (!s) throw Error("Scene not available for trigger handler");
@@ -3405,9 +3422,9 @@ function ut(n) {
3405
3422
  n.isVisible = !1, n.checkCollisions = !0;
3406
3423
  let l = n.actionManager ?? new t(s);
3407
3424
  n.actionManager = l;
3408
- for (let e of s.meshes) e !== n && !e.metadata?.trigger && lt(l, o, c, e);
3425
+ for (let e of s.meshes) e !== n && !e.metadata?.trigger && ft(l, o, c, e);
3409
3426
  let u = s.onNewMeshAddedObservable.add((e) => {
3410
- e !== n && !e.metadata?.trigger && lt(l, o, c, e);
3427
+ e !== n && !e.metadata?.trigger && ft(l, o, c, e);
3411
3428
  });
3412
3429
  n.onDisposeObservable.add(() => {
3413
3430
  s.onNewMeshAddedObservable.remove(u);
@@ -3416,7 +3433,7 @@ function ut(n) {
3416
3433
  }
3417
3434
  //#endregion
3418
3435
  //#region src/handlers/visible.ts
3419
- function dt(t) {
3436
+ function mt(t) {
3420
3437
  t.registerPropertyHandler("visible", (t, n, r, i) => {
3421
3438
  if (!(t instanceof e)) return;
3422
3439
  let a = !0;
@@ -3425,37 +3442,37 @@ function dt(t) {
3425
3442
  }
3426
3443
  //#endregion
3427
3444
  //#region src/handlers/index.ts
3428
- function ft(e) {
3429
- tt(e), it(e), $(e), st(e), ut(e), dt(e);
3445
+ function ht(e) {
3446
+ it(e), st(e), $(e), ut(e), pt(e), mt(e);
3430
3447
  }
3431
3448
  //#endregion
3432
3449
  //#region src/sage.ts
3433
- async function pt(e, t, n = {}) {
3434
- let r = new N(n.logLevel || "debug"), i = r.getLogger("SAGE");
3435
- i.info(`Initializing SAGE Game Engine v${O}...`), i.debug("Creating rendering engine...");
3436
- let a = await Ke(e, {
3450
+ async function gt(e, t, n = {}) {
3451
+ let r = new he(n.logLevel || "debug"), i = r.getLogger("SAGE");
3452
+ i.info(`Initializing SAGE Game Engine v${j}...`), i.debug("Creating rendering engine...");
3453
+ let a = await Ye(e, {
3437
3454
  antialias: !0,
3438
3455
  adaptToDeviceRatio: !0,
3439
3456
  ...n.renderOptions
3440
3457
  }, n.largeWorldRendering ?? !1);
3441
3458
  i.debug("Creating physics engine...");
3442
- let o = await qe(), s = Je(o);
3459
+ let o = await Xe(), s = Ze(o);
3443
3460
  i.debug("Creating event bus...");
3444
- let c = new P(r);
3461
+ let c = new ge(r);
3445
3462
  i.debug("Creating scene engine...");
3446
- let l = new I(e, a, o, r);
3463
+ let l = new P(e, a, o, r);
3447
3464
  i.debug("Creating managers...");
3448
- let u = new L(c, l, r), d = new Ue(c, e, r), f = new Ce(c, r), p = new Oe(c, r, f), m = new Le(c, r), h = new ze(p, m, r), g = new we(a, c, p, d, m, r);
3465
+ let u = new F(c, l, r), d = new Ke(c, e, r), f = new Ee(c, r), p = new ke(c, r, f), m = new Be(c, r), h = new He(p, m, r), g = new De(a, c, p, d, m, r);
3449
3466
  i.debug("Creating raycast helper...");
3450
- let _ = new Ye(p);
3467
+ let _ = new Qe(p);
3451
3468
  i.debug("Creating game timer...");
3452
- let v = new Xe();
3469
+ let v = new $e();
3453
3470
  g.registerFrameCallback((e) => v.tick(e * 1e3));
3454
3471
  let y, b;
3455
- n.audioChannels && n.audioChannels.length > 0 && (i.debug("Creating audio engine..."), y = new F(r), await y.initialize(), i.debug("Creating audio manager..."), b = new Re(y, r), await b.initialize(n.audioChannels)), i.info(`SAGE Game Engine v${O} initialized successfully.`), i.debug("Loading entities...");
3472
+ n.audioChannels && n.audioChannels.length > 0 && (i.debug("Creating audio engine..."), y = new N(r), await y.initialize(), i.debug("Creating audio manager..."), b = new Ve(y, r), await b.initialize(n.audioChannels)), i.info(`SAGE Game Engine v${j} initialized successfully.`), i.debug("Loading entities...");
3456
3473
  for (let e of t) p.registerEntityDefinition(e);
3457
3474
  if (i.debug("Registering default input bindings..."), n.bindings) for (let e of n.bindings) f.registerBinding(e);
3458
- let x = new k(e, a, s, c, r, _, v, {
3475
+ let x = new fe(e, a, s, c, r, _, v, {
3459
3476
  sceneEngine: l,
3460
3477
  audioEngine: y
3461
3478
  }, {
@@ -3471,6 +3488,6 @@ async function pt(e, t, n = {}) {
3471
3488
  return p.$setGameEngine(x), m.$setGameEngine(x), x;
3472
3489
  }
3473
3490
  //#endregion
3474
- export { L as AssetManager, F as AudioEngine, Re as AudioManager, A as ConsoleBackend, k as GameEngine, De as GameEntity, K as GameEntityBehavior, P as GameEventBus, Ie as GameLevel, Xe as GameTimer, Pe as Level, Ze as LogLevels, N as LoggingUtility, j as NullBackend, Fe as OutlineManager, Ye as RaycastHelper, M as SAGELogger, ze as SaveManager, I as SceneEngine, Qe as SoundBehavior, X as StateMachine, $e as StateMachineBehavior, O as VERSION, je as applyPostProcessing, R as bindingTypes, at as collectPrefixedProperties, pt as createGameEngine, Ee as generateId, V as isGamepadState, z as isKeyboardState, B as isMouseState, ft as registerAllPropertyHandlers, tt as registerColliderHandler, it as registerLodHandler, $ as registerOccluderHandler, st as registerSoundHandler, ut as registerTriggerHandler, dt as registerVisibleHandler, Me as toQuatObject, Ne as toQuaternion, q as toVec3Object, J as toVector3, me as validDeviceTypes };
3491
+ export { F as AssetManager, N as AudioEngine, Ve as AudioManager, pe as ConsoleBackend, fe as GameEngine, K as GameEntity, G as GameEntityBehavior, ge as GameEventBus, ze as GameLevel, $e as GameTimer, Le as Level, et as LogLevels, he as LoggingUtility, me as NullBackend, Re as OutlineManager, Qe as RaycastHelper, M as SAGELogger, He as SaveManager, P as SceneEngine, tt as SoundBehavior, X as StateMachine, nt as StateMachineBehavior, j as VERSION, Me as applyPostProcessing, I as bindingTypes, ct as collectPrefixedProperties, gt as createGameEngine, W as generateId, Ie as getCanonicalTransform, z as isGamepadState, L as isKeyboardState, R as isMouseState, ht as registerAllPropertyHandlers, it as registerColliderHandler, st as registerLodHandler, $ as registerOccluderHandler, ut as registerSoundHandler, pt as registerTriggerHandler, mt as registerVisibleHandler, Ne as toQuatObject, Pe as toQuaternion, q as toVec3Object, J as toVector3, _e as validDeviceTypes };
3475
3492
 
3476
3493
  //# sourceMappingURL=sage.es.js.map