From 2f65406b6f8a0ea63e2a900154cef51c4d45872d Mon Sep 17 00:00:00 2001 From: AlexandruPopovici Date: Tue, 26 Nov 2024 14:27:59 +0200 Subject: [PATCH 1/3] Added FilterMaterial and related types to export list --- packages/viewer/src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/viewer/src/index.ts b/packages/viewer/src/index.ts index e38a1cdc05..182a7bd2b7 100644 --- a/packages/viewer/src/index.ts +++ b/packages/viewer/src/index.ts @@ -119,6 +119,11 @@ import { DepthNormalPass } from './modules/pipeline/Passes/DepthNormalPass.js' import { BasitPass } from './modules/pipeline/Passes/BasitPass.js' import { ProgressiveAOPass } from './modules/pipeline/Passes/ProgressiveAOPass.js' import { TAAPass } from './modules/pipeline/Passes/TAAPass.js' +import { + FilterMaterial, + FilterMaterialOptions, + FilterMaterialType +} from './modules/materials/Materials.js' export { Viewer, @@ -201,7 +206,10 @@ export { MRTShadedViewPipeline, MRTPenViewPipeline, ViewModes, - ViewMode + ViewMode, + FilterMaterial, + FilterMaterialType, + FilterMaterialOptions } export type { From 79a788c2b5372db9412f9468ef2ff1c0be241e97 Mon Sep 17 00:00:00 2001 From: AlexandruPopovici Date: Tue, 26 Nov 2024 14:28:39 +0200 Subject: [PATCH 2/3] Handled WEB-1389 --- packages/viewer/src/modules/Viewer.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/viewer/src/modules/Viewer.ts b/packages/viewer/src/modules/Viewer.ts index 47a3f2954a..0aaa797574 100644 --- a/packages/viewer/src/modules/Viewer.ts +++ b/packages/viewer/src/modules/Viewer.ts @@ -79,11 +79,9 @@ export class Viewer extends EventEmitter implements IViewer { const cs = [] let pt = obj do { - if ((pt = Object.getPrototypeOf(pt))) cs.push(pt.constructor || null) + if ((pt = Object.getPrototypeOf(pt))) cs.push(pt.constructor.name || null) } while (pt !== null) - return cs.map(function (c) { - return c ? c.toString().split(/\s|\(/)[1] : null - }) + return cs } public createExtension(type: Constructor): T { From db9fda1231ff741861d5b1f32c93233111a0c34f Mon Sep 17 00:00:00 2001 From: AlexandruPopovici Date: Tue, 26 Nov 2024 18:58:24 +0200 Subject: [PATCH 3/3] Camera orbit controls now takes the offset position and size when computing zoom to cursor coordinates. Fixes WEB-1611 --- .../src/modules/extensions/controls/SmoothOrbitControls.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts b/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts index 9ee8753125..ed254e6bbe 100644 --- a/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts +++ b/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts @@ -411,7 +411,6 @@ export class SmoothOrbitControls extends SpeckleControls { * such that they progress across their allowed ranges in sync. */ adjustOrbit(deltaTheta: number, deltaPhi: number, deltaZoom: number) { - deltaZoom this._radiusDelta const { theta, phi, radius } = this.goalSpherical @@ -979,13 +978,14 @@ export class SmoothOrbitControls extends SpeckleControls { protected onWheel = (event: WheelEvent) => { const x = - ((event.clientX - this._container.clientLeft) / this._container.clientWidth) * 2 - + ((event.clientX - this._container.offsetLeft) / this._container.offsetWidth) * 2 - 1 const y = - ((event.clientY - this._container.clientTop) / this._container.clientHeight) * + ((event.clientY - this._container.offsetTop) / this._container.offsetHeight) * -2 + 1 + this.zoomControlCoord.set(x, y) const deltaZoom =