@combeenation/3d-viewer 5.2.0-alpha5 → 6.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.
- package/dist/lib-cjs/api/classes/element.js +2 -2
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/variant.js +1 -1
- package/dist/lib-cjs/api/classes/variant.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.js +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +1 -1
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js +2 -2
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js.map +1 -1
- package/dist/lib-cjs/buildinfo.json +1 -1
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/api/classes/element.ts +2 -2
- package/src/api/classes/variant.ts +1 -1
- package/src/api/internal/debugViewer.ts +1 -1
- package/src/api/manager/sceneManager.ts +1 -1
- package/src/api/util/sceneLoaderHelper.ts +2 -2
- package/src/dev.ts +1 -1
package/package.json
CHANGED
|
@@ -272,7 +272,7 @@ export class Element extends VariantParameterizable {
|
|
|
272
272
|
if (!(node instanceof AbstractMesh)) {
|
|
273
273
|
throw new Error(`The path must be an instance of "AbstractMesh" for camera observer in element "${this.id}".`);
|
|
274
274
|
}
|
|
275
|
-
this.variant.viewer.sceneManager.activeCamera.onViewMatrixChangedObservable.add(() => {
|
|
275
|
+
this.variant.viewer.sceneManager.activeCamera.onViewMatrixChangedObservable.add((eventData, eventState) => {
|
|
276
276
|
const position = getClientRectFromMesh(node, this.variant.viewer.scene, this.variant.viewer.canvas);
|
|
277
277
|
if (payload) {
|
|
278
278
|
payload.style.top = `${position.top}px`;
|
|
@@ -534,7 +534,7 @@ export class Element extends VariantParameterizable {
|
|
|
534
534
|
},
|
|
535
535
|
]);
|
|
536
536
|
this._parameterObservers.set(Parameter.HIGHLIGHT_COLOR, [
|
|
537
|
-
async (element: Element) => {
|
|
537
|
+
async (element: Element, oldValue: ParameterValue, newValue: ParameterValue) => {
|
|
538
538
|
// trigger Parameter.HIGHLIGHTED observers
|
|
539
539
|
this._parameterObservers.get(Parameter.HIGHLIGHTED)?.forEach(observer => {
|
|
540
540
|
observer(element, !!element.highlighted, !!element.highlighted);
|
|
@@ -616,7 +616,7 @@ export class Variant extends Parameterizable {
|
|
|
616
616
|
protected async loadAssets(): Promise<Variant> {
|
|
617
617
|
this.broadcastEvent(Event.ASSET_LOADING_START, this);
|
|
618
618
|
|
|
619
|
-
const promisifiedLoader = new Promise<Variant>(resolve => {
|
|
619
|
+
const promisifiedLoader = new Promise<Variant>((resolve, reject) => {
|
|
620
620
|
if (!this.structureJson) {
|
|
621
621
|
this.broadcastEvent(Event.ASSET_LOADING_END, this);
|
|
622
622
|
return resolve(this);
|
|
@@ -36,7 +36,7 @@ export class DebugViewer extends Viewer {
|
|
|
36
36
|
return scene;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
protected instanceDebugger() {
|
|
39
|
+
protected instanceDebugger(instance: VariantInstance) {
|
|
40
40
|
const instances: string[] = [];
|
|
41
41
|
this.variantInstances.all.forEach(variantInstance => {
|
|
42
42
|
instances.push(
|
|
@@ -88,7 +88,7 @@ export class SceneManager extends ParameterObservable {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
protected addParameterObservers(): SceneManager {
|
|
91
|
-
const handleEnvParamChange = (manager: SceneManager) => {
|
|
91
|
+
const handleEnvParamChange = (manager: SceneManager, oldValue: ParameterValue, newValue: ParameterValue) => {
|
|
92
92
|
const params = {
|
|
93
93
|
color: manager.parameters[Parameter.ENVIRONMENT_COLOR],
|
|
94
94
|
intensity: manager.parameters[Parameter.ENVIRONMENT_INTENSITY],
|
|
@@ -24,7 +24,7 @@ const getCustomCbnBabylonLoaderPlugin = function (previousLoaderPlugin: ISceneLo
|
|
|
24
24
|
extensions: '.babylon',
|
|
25
25
|
importMesh: previousLoaderPlugin.importMesh,
|
|
26
26
|
load: previousLoaderPlugin.load,
|
|
27
|
-
loadAssetContainer: function (scene, data, rootUrl) {
|
|
27
|
+
loadAssetContainer: function (scene, data, rootUrl, onError) {
|
|
28
28
|
//* 1) --- manipulate ORIGINAL data
|
|
29
29
|
const dataParsed = JSON.parse(data);
|
|
30
30
|
//* 2) --- call default (non-custom) loading method
|
|
@@ -46,7 +46,7 @@ const getCustomCbnBabylonLoaderPlugin = function (previousLoaderPlugin: ISceneLo
|
|
|
46
46
|
* @returns observer
|
|
47
47
|
*/
|
|
48
48
|
const getMaterialPostLoadObserver = function (targetMeshOrInstance: AbstractMesh, concerningMesh: Mesh) {
|
|
49
|
-
return () => {
|
|
49
|
+
return (eventData: any, eventState: any) => {
|
|
50
50
|
const hasBeenEnabled = concerningMesh.isEnabled(true);
|
|
51
51
|
const materialMissing = has(concerningMesh.metadata, missingMaterialMetadataName);
|
|
52
52
|
if (!hasBeenEnabled || !materialMissing) return;
|
package/src/dev.ts
CHANGED