rayzee 5.3.0 → 5.3.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/rayzee.es.js CHANGED
@@ -10055,7 +10055,7 @@ var vc = class extends hn {
10055
10055
  this._transparentBackground.value = e ? 1 : 0;
10056
10056
  }
10057
10057
  dispose() {
10058
- this.displayMaterial?.dispose();
10058
+ this.displayMaterial?.dispose(), this.displayQuad?.dispose();
10059
10059
  }
10060
10060
  }, bc = class {
10061
10061
  constructor() {
@@ -10559,13 +10559,13 @@ var vc = class extends hn {
10559
10559
  wireAppEvents(e) {
10560
10560
  this.addEventListener("objectSelected", (t) => {
10561
10561
  this.select(t.object), e.refreshFrame(), e.dispatchEvent({
10562
- type: "objectSelected",
10562
+ type: vn.OBJECT_SELECTED,
10563
10563
  object: t.object,
10564
10564
  uuid: t.uuid
10565
10565
  });
10566
10566
  }), this.addEventListener("objectDeselected", (t) => {
10567
10567
  this.select(null), e.refreshFrame(), e.dispatchEvent({
10568
- type: "objectDeselected",
10568
+ type: vn.OBJECT_DESELECTED,
10569
10569
  object: t.object,
10570
10570
  uuid: t.uuid
10571
10571
  });
@@ -13122,7 +13122,7 @@ var Jc = new Float32Array(3), Yc = {
13122
13122
  }
13123
13123
  }, ol = class extends E {
13124
13124
  constructor(e, t = {}) {
13125
- super(), this.canvas = e, this._autoResize = t.autoResize !== !1, this._showStats = t.showStats !== !1, this._statsContainer = t.statsContainer || null, this.settings = new kc(X), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this.pipeline = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new il(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this.pathTracerEnabled = !0, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this.completion = new Cc(), this._resizeDebounceTimer = null;
13125
+ super(), this.canvas = e, this._autoResize = t.autoResize !== !1, this._showStats = t.showStats !== !1, this._statsContainer = t.statsContainer || null, this.settings = new kc(X), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this.pipeline = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new il(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this.pathTracerEnabled = !0, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this.completion = new Cc(), this._resizeDebounceTimer = null, this._resizeObserver = null, this._lastObservedWidth = 0, this._lastObservedHeight = 0;
13126
13126
  }
13127
13127
  async init() {
13128
13128
  return await this._initRenderer(), this._initCameraManager(), this._initScenes(), this._initAssetPipeline(), this._initPipeline(), this._initManagers(), this._wireEvents(), this.stages.pathTracer.setTriangleData(new Float32Array(32), 0), this.stages.pathTracer.setBVHData(new Float32Array(16)), this.stages.pathTracer.materialData.setMaterialData(new Float32Array(16)), this.stages.pathTracer.setupMaterial(), this._showStats && this._initStats(), this.isInitialized = !0, console.log("WebGPU Path Tracer App initialized"), this;
@@ -13183,7 +13183,7 @@ var Jc = new Float32Array(3), Yc = {
13183
13183
  this.completion.reset(), this.wake(), this.dispatchEvent({ type: "RenderReset" }), this.dispatchEvent({ type: vn.RENDER_RESET });
13184
13184
  }
13185
13185
  dispose() {
13186
- this.animationManager?.dispose(), this.stopAnimation(), bn(null), this.assetLoader && this._onAssetLoaded && this.assetLoader.removeEventListener("load", this._onAssetLoaded), this.transformManager?.dispose(), this.overlayManager?.dispose(), this._sceneHelpers?.clear(), this.denoisingManager?.dispose(), this.pipeline?.dispose(), this.interactionManager?.dispose(), this.cameraManager?.dispose(), this.renderer?.dispose(), this._stats &&= (this._stats.dom.remove(), null), clearTimeout(this._resizeDebounceTimer), window.removeEventListener("resize", this.resizeHandler), this.isInitialized = !1;
13186
+ this.animationManager?.dispose(), this.stopAnimation(), bn(null), this.assetLoader && this._onAssetLoaded && this.assetLoader.removeEventListener("load", this._onAssetLoaded), this.transformManager?.dispose(), this.overlayManager?.dispose(), this._sceneHelpers?.clear(), this.denoisingManager?.dispose(), this.pipeline?.dispose(), this.interactionManager?.dispose(), this.cameraManager?.dispose(), this.renderer?.dispose(), this._stats &&= (this._stats.dom.remove(), null), clearTimeout(this._resizeDebounceTimer), this._resizeObserver?.disconnect(), this.isInitialized = !1;
13187
13187
  }
13188
13188
  async loadModel(e) {
13189
13189
  await this._loadWithSceneRebuild(() => this.assetLoader.loadModel(e), {
@@ -13254,8 +13254,8 @@ var Jc = new Float32Array(3), Yc = {
13254
13254
  }
13255
13255
  onResize() {
13256
13256
  let e = this.canvas.clientWidth, t = this.canvas.clientHeight;
13257
- if (e === 0 || t === 0) return;
13258
- this.renderer.setPixelRatio(1), this.renderer.setSize(e, t, !1), this.cameraManager.camera.aspect = e / t, this.cameraManager.camera.updateProjectionMatrix(), this.denoisingManager?.syncCanvasStyle(e, t);
13257
+ if (e === 0 || t === 0 || e === this._lastObservedWidth && t === this._lastObservedHeight) return;
13258
+ this._lastObservedWidth = e, this._lastObservedHeight = t, this.renderer.setPixelRatio(1), this.renderer.setSize(e, t, !1), this.cameraManager.camera.aspect = e / t, this.cameraManager.camera.updateProjectionMatrix(), this.denoisingManager?.syncCanvasStyle(e, t);
13259
13259
  let n = window.devicePixelRatio || 1;
13260
13260
  this.overlayManager?.setSize(Math.round(e * n), Math.round(t * n));
13261
13261
  let r = this.denoisingManager?._lastRenderWidth ?? 0, i = this.denoisingManager?._lastRenderHeight ?? 0;
@@ -13425,7 +13425,7 @@ var Jc = new Float32Array(3), Yc = {
13425
13425
  stages: this.stages,
13426
13426
  resetCallback: () => this.reset(),
13427
13427
  reconcileCompletion: () => this._reconcileCompletion()
13428
- }), this.onResize(), this.resizeHandler = () => this.onResize(), this._autoResize && window.addEventListener("resize", this.resizeHandler), this._onAssetLoaded = async (e) => {
13428
+ }), this.onResize(), this._autoResize && (this._resizeObserver = new ResizeObserver(() => this.onResize()), this._resizeObserver.observe(this.canvas)), this._onAssetLoaded = async (e) => {
13429
13429
  if (!this._loadingInProgress) {
13430
13430
  if (e.model) await this.loadSceneData();
13431
13431
  else if (e.texture) {