@combeenation/3d-viewer 15.1.0-beta1 → 16.0.0-alpha1

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.
@@ -0,0 +1,45 @@
1
+ import { IAssetContainer, Mesh, Tuple } from '..';
2
+ export declare type DecalConfiguration = {
3
+ name: string;
4
+ sourceMeshName: string;
5
+ position: Tuple<number, 3>;
6
+ normal: Tuple<number, 3>;
7
+ size: Tuple<number, 3>;
8
+ angle: number;
9
+ /** Shifts decals away from source mesh in direction of "normal" vector */
10
+ offset: number;
11
+ /**
12
+ * `true`: Use UV mapping from source mesh\
13
+ * `false`: Use default box mapping from the decal
14
+ *
15
+ * Default `false`
16
+ */
17
+ captureUVS?: boolean;
18
+ /**
19
+ * Create decal only on front side if set to `true`
20
+ *
21
+ * Default `true`
22
+ */
23
+ cullBackFaces?: boolean;
24
+ /** `true`: Sets created decal as child of source mesh
25
+ *
26
+ * Default `true`
27
+ */
28
+ localMode?: boolean;
29
+ /**
30
+ * The Babylon.js default for mesh side orientation value is `Material.CounterClockWiseSideOrientation`.\
31
+ * However if the mesh (in this case the created decal mesh) is located under a glTF root node, it has to be flipped,
32
+ * using `Material.ClockWiseSideOrientation`.
33
+ *
34
+ * Default `Material.ClockWiseSideOrientation`
35
+ */
36
+ sideOrientation?: number;
37
+ };
38
+ /**
39
+ * Creates mesh from a decal configuration.\
40
+ * This is basically calling `MeshBuilder.CreateDecal`, with some extra steps:
41
+ * - add created decal mesh to source mesh asset container
42
+ * - overwrite decal mesh side orientation (important for glTF models)
43
+ * - move decal along the "normal" to avoid clipping
44
+ */
45
+ export declare function createDecalMesh(config: DecalConfiguration, assetContainer: IAssetContainer, addToScene?: boolean): Mesh;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDecalMesh = void 0;
4
+ const __1 = require("..");
5
+ /**
6
+ * Creates mesh from a decal configuration.\
7
+ * This is basically calling `MeshBuilder.CreateDecal`, with some extra steps:
8
+ * - add created decal mesh to source mesh asset container
9
+ * - overwrite decal mesh side orientation (important for glTF models)
10
+ * - move decal along the "normal" to avoid clipping
11
+ */
12
+ function createDecalMesh(config, assetContainer, addToScene = true) {
13
+ var _a, _b, _c, _d, _e;
14
+ const sourceMesh = assetContainer.meshes.find(mesh => mesh.name === config.sourceMeshName);
15
+ if (!sourceMesh) {
16
+ throw new __1.ViewerError({
17
+ id: __1.ViewerErrorIds.InvalidDecalConfiguration,
18
+ message: `Source mesh for decal "${config.name}" couldn't be found`,
19
+ });
20
+ }
21
+ const position = __1.Vector3.FromArray(config.position);
22
+ const normal = __1.Vector3.FromArray(config.normal).normalizeToNew();
23
+ const localMode = (_a = config.localMode) !== null && _a !== void 0 ? _a : true;
24
+ const worldNormal = localMode ? __1.Vector3.TransformNormal(normal, sourceMesh.getWorldMatrix()) : normal;
25
+ const decalMesh = __1.MeshBuilder.CreateDecal(config.name, sourceMesh, {
26
+ position: position,
27
+ normal: normal,
28
+ size: __1.Vector3.FromArray(config.size),
29
+ angle: config.angle,
30
+ captureUVS: (_b = config.captureUVS) !== null && _b !== void 0 ? _b : false,
31
+ cullBackFaces: (_c = config.cullBackFaces) !== null && _c !== void 0 ? _c : true,
32
+ localMode: (_d = config.localMode) !== null && _d !== void 0 ? _d : true,
33
+ });
34
+ if (!addToScene) {
35
+ const scene = sourceMesh.getScene();
36
+ scene.removeMesh(decalMesh);
37
+ }
38
+ // make sure that the decal is part of the source mesh asset container
39
+ decalMesh._parentContainer = assetContainer;
40
+ assetContainer.meshes.push(decalMesh);
41
+ decalMesh.sideOrientation = (_e = config.sideOrientation) !== null && _e !== void 0 ? _e : __1.Material.ClockWiseSideOrientation;
42
+ // move decal away from mesh to avoid clipping
43
+ // NOTE: zOffset of material can't be used, since it's not supported in glTF and therefore not usable in AR
44
+ const offsetVector = worldNormal.scale(config.offset);
45
+ decalMesh.position.addInPlace(offsetVector);
46
+ return decalMesh;
47
+ }
48
+ exports.createDecalMesh = createDecalMesh;
49
+ //# sourceMappingURL=decals-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decals-helper.js","sourceRoot":"","sources":["../../../src/helper/decals-helper.ts"],"names":[],"mappings":";;;AAAA,0BAA+G;AA6C/G;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,MAA0B,EAAE,cAA+B,EAAE,UAAU,GAAG,IAAI;;IAC5G,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,cAAc,CAAC,CAAC;IAC3F,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,eAAW,CAAC;YACpB,EAAE,EAAE,kBAAc,CAAC,yBAAyB;YAC5C,OAAO,EAAE,0BAA0B,MAAM,CAAC,IAAI,qBAAqB;SACpE,CAAC,CAAC;KACJ;IAED,MAAM,QAAQ,GAAG,WAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,WAAO,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,CAAC;IAEjE,MAAM,SAAS,GAAG,MAAA,MAAM,CAAC,SAAS,mCAAI,IAAI,CAAC;IAC3C,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,WAAO,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEtG,MAAM,SAAS,GAAG,eAAW,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE;QACjE,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,WAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,KAAK;QACtC,aAAa,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,IAAI;QAC3C,SAAS,EAAE,MAAA,MAAM,CAAC,SAAS,mCAAI,IAAI;KACpC,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;QACpC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;KAC7B;IAED,sEAAsE;IACtE,SAAS,CAAC,gBAAgB,GAAG,cAAc,CAAC;IAC5C,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEtC,SAAS,CAAC,eAAe,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,YAAQ,CAAC,wBAAwB,CAAC;IAExF,8CAA8C;IAC9C,2GAA2G;IAC3G,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtD,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE5C,OAAO,SAAS,CAAC;AACnB,CAAC;AA1CD,0CA0CC"}
@@ -49,3 +49,4 @@ export * from './manager/model-manager';
49
49
  export * from './manager/parameter-manager';
50
50
  export * from './manager/scene-manager';
51
51
  export * from './manager/texture-manager';
52
+ export * from './helper/decals-helper';
@@ -82,4 +82,5 @@ __exportStar(require("./manager/model-manager"), exports);
82
82
  __exportStar(require("./manager/parameter-manager"), exports);
83
83
  __exportStar(require("./manager/scene-manager"), exports);
84
84
  __exportStar(require("./manager/texture-manager"), exports);
85
+ __exportStar(require("./helper/decals-helper"), exports);
85
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAA0C;AAC1C,wBAAwB;AACxB,qDAAqD;AACrD,kDAAgD;AAChD,sDAAoD;AAEpD,qBAAqB;AACrB,2DAA2D;AAC3D,wHAAwH;AACxH,+CAA+C;AAC/C,yGAAyG;AACzG,iEAAiE;AACjE,6DAA2C;AAC3C,iEAA+C;AAC/C,kEAAgD;AAChD,0DAAwC;AACxC,0EAAwD;AACxD,iEAA+C;AAC/C,0DAAwC;AACxC,mEAAiD;AACjD,mEAAiD;AACjD,iEAA+C;AAC/C,qEAAmD;AACnD,yDAAuC;AACvC,0DAAwC;AACxC,qEAAmD;AACnD,gEAA8C;AAC9C,6EAA2D;AAC3D,qEAAmD;AACnD,wDAAsC;AACtC,sEAAoD;AACpD,kEAAgD;AAChD,uEAAqD;AACrD,8DAA4C;AAC5C,qEAAmD;AACnD,uEAAqD;AACrD,iFAA+D;AAC/D,uEAAqD;AACrD,wDAAsC;AACtC,uDAAqC;AACrC,iFAA+D;AAC/D,wDAAsC;AACtC,wDAAsC;AACtC,yEAAuD;AACvD,iFAA+D;AAE/D,gCAAgC;AAChC,sHAAsH;AACtH,UAAU;AACV,2DAA2D;AAC3D,6DAA2C;AAC3C,qCAAqC;AACrC,uEAAqD;AACrD,sDAAsD;AACtD,uEAAqD;AACrD,gDAAgD;AAChD,iEAA+C;AAE/C,iBAAiB;AACjB,qFAAqF;AACrF,2CAAyB;AACzB,iDAA+B;AAC/B,2DAAyC;AACzC,0DAAwC;AACxC,0DAAwC;AACxC,gEAA8C;AAC9C,6DAA2C;AAC3C,0DAAwC;AACxC,8DAA4C;AAC5C,0DAAwC;AACxC,4DAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAA0C;AAC1C,wBAAwB;AACxB,qDAAqD;AACrD,kDAAgD;AAChD,sDAAoD;AAEpD,qBAAqB;AACrB,2DAA2D;AAC3D,wHAAwH;AACxH,+CAA+C;AAC/C,yGAAyG;AACzG,iEAAiE;AACjE,6DAA2C;AAC3C,iEAA+C;AAC/C,kEAAgD;AAChD,0DAAwC;AACxC,0EAAwD;AACxD,iEAA+C;AAC/C,0DAAwC;AACxC,mEAAiD;AACjD,mEAAiD;AACjD,iEAA+C;AAC/C,qEAAmD;AACnD,yDAAuC;AACvC,0DAAwC;AACxC,qEAAmD;AACnD,gEAA8C;AAC9C,6EAA2D;AAC3D,qEAAmD;AACnD,wDAAsC;AACtC,sEAAoD;AACpD,kEAAgD;AAChD,uEAAqD;AACrD,8DAA4C;AAC5C,qEAAmD;AACnD,uEAAqD;AACrD,iFAA+D;AAC/D,uEAAqD;AACrD,wDAAsC;AACtC,uDAAqC;AACrC,iFAA+D;AAC/D,wDAAsC;AACtC,wDAAsC;AACtC,yEAAuD;AACvD,iFAA+D;AAE/D,gCAAgC;AAChC,sHAAsH;AACtH,UAAU;AACV,2DAA2D;AAC3D,6DAA2C;AAC3C,qCAAqC;AACrC,uEAAqD;AACrD,sDAAsD;AACtD,uEAAqD;AACrD,gDAAgD;AAChD,iEAA+C;AAE/C,iBAAiB;AACjB,qFAAqF;AACrF,2CAAyB;AACzB,iDAA+B;AAC/B,2DAAyC;AACzC,0DAAwC;AACxC,0DAAwC;AACxC,gEAA8C;AAC9C,6DAA2C;AAC3C,0DAAwC;AACxC,8DAA4C;AAC5C,0DAAwC;AACxC,4DAA0C;AAC1C,yDAAuC"}
@@ -1,10 +1,28 @@
1
+ import { AssetContainer, DecalConfiguration } from '../index';
2
+ /**
3
+ * Contains cbn custom data, like decals.
4
+ * This is just a temporary type, as the `loadAssetContainer` function only returns an asset container, which can be
5
+ * altered by our file loader plugin.
6
+ * After loading the model, `cbnData` is cropped and a pure asset container is available for further processing.
7
+ */
8
+ export declare class ExtendedAssetContainer extends AssetContainer {
9
+ cbnData?: CbnBabylonFileData;
10
+ }
11
+ export declare type CbnBabylonFileData = {
12
+ decals?: ParsedDecalConfiguration[];
13
+ };
14
+ export declare type ParsedDecalConfiguration = DecalConfiguration & {
15
+ materialId?: string;
16
+ };
1
17
  /**
2
18
  * Create and return a custom loader plugin to be registered with SceneLoader, that allows
3
19
  * us to run our own code against the input data before using the standard procedure to
4
20
  * import.
5
- * The main use case is to mark missing material in meshes, which will get loaded on demand at the first time the
6
- * dedicated mesh gets visible.
7
- * This is the case if the babylon file is a Combeenation "3d asset" which comes without materials, as the materials
8
- * are defined as "material assets".
21
+ * The main use cases are:
22
+ * - Marking missing material in meshes, which will get loaded on demand at the first time the dedicated mesh gets
23
+ * visible. This is the case if the babylon file is a Combeenation "3d asset" which comes without materials, as the
24
+ * materials are defined as "material assets".
25
+ * - Interpreting custom cbn data that have been injected in the babylon file, e.g. by the "decals editor" in the asset
26
+ * editor area
9
27
  */
10
28
  export declare function registerCustomCbnBabylonLoaderPlugin(): void;
@@ -1,18 +1,40 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerCustomCbnBabylonLoaderPlugin = void 0;
14
+ exports.registerCustomCbnBabylonLoaderPlugin = exports.ExtendedAssetContainer = void 0;
4
15
  const index_1 = require("../index");
5
16
  const metadata_helper_1 = require("./metadata-helper");
6
17
  const tags_helper_1 = require("./tags-helper");
7
18
  const lodash_es_1 = require("lodash-es");
19
+ /**
20
+ * Contains cbn custom data, like decals.
21
+ * This is just a temporary type, as the `loadAssetContainer` function only returns an asset container, which can be
22
+ * altered by our file loader plugin.
23
+ * After loading the model, `cbnData` is cropped and a pure asset container is available for further processing.
24
+ */
25
+ class ExtendedAssetContainer extends index_1.AssetContainer {
26
+ }
27
+ exports.ExtendedAssetContainer = ExtendedAssetContainer;
8
28
  /**
9
29
  * Create and return a custom loader plugin to be registered with SceneLoader, that allows
10
30
  * us to run our own code against the input data before using the standard procedure to
11
31
  * import.
12
- * The main use case is to mark missing material in meshes, which will get loaded on demand at the first time the
13
- * dedicated mesh gets visible.
14
- * This is the case if the babylon file is a Combeenation "3d asset" which comes without materials, as the materials
15
- * are defined as "material assets".
32
+ * The main use cases are:
33
+ * - Marking missing material in meshes, which will get loaded on demand at the first time the dedicated mesh gets
34
+ * visible. This is the case if the babylon file is a Combeenation "3d asset" which comes without materials, as the
35
+ * materials are defined as "material assets".
36
+ * - Interpreting custom cbn data that have been injected in the babylon file, e.g. by the "decals editor" in the asset
37
+ * editor area
16
38
  */
17
39
  function registerCustomCbnBabylonLoaderPlugin() {
18
40
  // get original plugin for babylon files
@@ -24,37 +46,53 @@ function registerCustomCbnBabylonLoaderPlugin() {
24
46
  extensions: '.babylon',
25
47
  importMesh: previousLoaderPlugin.importMesh,
26
48
  load: previousLoaderPlugin.load,
27
- loadAssetContainer: function (scene, data, rootUrl, onError) {
28
- // temporarily remove all morph target managers from scene before loading the model to avoid clashes with existing
29
- // unique ids => see CB-9928
30
- // NOTE: morph target managers still exist on the dedicated mesh when getting removed from the scene, only
31
- // `scene.getMorphTargetManagerById` is affected, which is used internally in the `loadAssetContainer` function
32
- const curMorphTargetManagers = scene.morphTargetManagers;
33
- scene.morphTargetManagers = [];
49
+ loadAssetContainer: (scene, data, rootUrl, onError) => {
34
50
  const dataParsed = JSON.parse(data);
35
51
  const importedContainer = previousLoaderPlugin.loadAssetContainer(scene, data, rootUrl);
36
52
  _addMissingMaterialMetadata(dataParsed, importedContainer);
37
53
  _reconstructTagsForInstancedMeshes(dataParsed, importedContainer);
38
- // restore existing morph target managers
39
- scene.morphTargetManagers.push(...curMorphTargetManagers);
40
- return importedContainer;
54
+ _createDecals(dataParsed, importedContainer);
55
+ // add `cbnData` to output asset container, so that this information can be store as metadata for the model
56
+ const extendedContainer = importedContainer;
57
+ extendedContainer.cbnData = dataParsed.cbnData;
58
+ return extendedContainer;
41
59
  },
42
60
  };
43
61
  index_1.SceneLoader.RegisterPlugin(customLoader);
44
62
  }
45
63
  exports.registerCustomCbnBabylonLoaderPlugin = registerCustomCbnBabylonLoaderPlugin;
46
- function _isMeshInstanceData(data) {
47
- const hasName = (0, lodash_es_1.isString)(data.name);
48
- const hasValidTags = !data.tags || (0, lodash_es_1.isString)(data.tags);
49
- return hasName && hasValidTags;
64
+ function _isDataWithMeshes(data) {
65
+ return (0, lodash_es_1.isArray)(data === null || data === void 0 ? void 0 : data.meshes);
66
+ }
67
+ function _isDataWithDecalConfigurations(data) {
68
+ var _a;
69
+ return (0, lodash_es_1.isArray)((_a = data === null || data === void 0 ? void 0 : data.cbnData) === null || _a === void 0 ? void 0 : _a.decals);
50
70
  }
51
71
  function _isMeshData(data) {
52
72
  const hasName = (0, lodash_es_1.isString)(data.name);
53
73
  const hasValidMaterialId = !data.materialId || (0, lodash_es_1.isString)(data.materialId);
54
74
  return hasName && hasValidMaterialId;
55
75
  }
56
- function _isDataWithMeshes(data) {
57
- return data && (0, lodash_es_1.isArray)(data.meshes);
76
+ function _isMeshInstanceData(data) {
77
+ const hasName = (0, lodash_es_1.isString)(data.name);
78
+ const hasValidTags = !data.tags || (0, lodash_es_1.isString)(data.tags);
79
+ return hasName && hasValidTags;
80
+ }
81
+ function _isDecalConfiguration(data) {
82
+ const hasValidProps = (0, lodash_es_1.isString)(data.name) &&
83
+ (0, lodash_es_1.isString)(data.sourceMeshName) &&
84
+ (0, lodash_es_1.isArray)(data.position) &&
85
+ (0, lodash_es_1.isArray)(data.normal) &&
86
+ (0, lodash_es_1.isArray)(data.size) &&
87
+ (0, lodash_es_1.isNumber)(data.angle) &&
88
+ (0, lodash_es_1.isNumber)(data.offset);
89
+ if (!hasValidProps) {
90
+ throw new index_1.ViewerError({
91
+ id: index_1.ViewerErrorIds.InvalidDecalConfiguration,
92
+ message: `Configuration for decal "${data.name}" invalid`,
93
+ });
94
+ }
95
+ return hasValidProps;
58
96
  }
59
97
  /**
60
98
  * Internal function that compares the original meshes on a .babylon file with what was loaded,
@@ -113,4 +151,29 @@ function _reconstructTagsForInstancedMeshes(dataParsed, container) {
113
151
  }
114
152
  });
115
153
  }
154
+ /**
155
+ * This function interprets the decal configuration, that is stored top level in the babylon file (`dataParsed`) and
156
+ * creates decal meshes in the given `container`.
157
+ *
158
+ * Having the decal information stored in that way is required for the "decals editor" in the asset manager, as meshes
159
+ * created from decals have to be updateable.
160
+ *
161
+ * @param container This is being manipulated, by adding decal meshes to it based on the decal configuration read from
162
+ * `dataParsed`.
163
+ */
164
+ function _createDecals(dataParsed, container) {
165
+ if (!_isDataWithDecalConfigurations(dataParsed))
166
+ return;
167
+ const validatedDecals = dataParsed.cbnData.decals.filter(_isDecalConfiguration);
168
+ validatedDecals.forEach(decalConfig => {
169
+ var _a;
170
+ const { materialId } = decalConfig, decalMeshConfig = __rest(decalConfig, ["materialId"]);
171
+ const decalMesh = (0, index_1.createDecalMesh)(decalMeshConfig, container, false);
172
+ // optionally set material directly
173
+ if (materialId) {
174
+ (_a = window.Cbn) === null || _a === void 0 ? void 0 : _a.Assets.assertMaterialExists(materialId);
175
+ (0, metadata_helper_1.setInternalMetadataValue)(decalMesh, 'deferredMaterial', materialId);
176
+ }
177
+ });
178
+ }
116
179
  //# sourceMappingURL=cbn-custom-babylon-loader-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cbn-custom-babylon-loader-plugin.js","sourceRoot":"","sources":["../../../src/internal/cbn-custom-babylon-loader-plugin.ts"],"names":[],"mappings":";;;AAAA,oCAA0F;AAC1F,uDAA6D;AAC7D,+CAAwE;AACxE,yCAA8C;AAE9C;;;;;;;;GAQG;AACH,SAAgB,oCAAoC;IAClD,wCAAwC;IACxC,4FAA4F;IAC5F,oGAAoG;IACpG,MAAM,oBAAoB,GAAG,mBAAW,CAAC,qBAAqB,CAAC,UAAU,CAAuB,CAAC;IAE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AAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE9D,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;;QACtC,IAAI,YAAY,YAAY,qBAAa,EAAE;YACzC,0GAA0G;YAC1G,gFAAgF;YAChF,MAAM,OAAO,GAAG,IAAA,qBAAO,EAAC,YAAY,CAAC,CAAC;YACtC,IAAI,OAAO,EAAE;gBACX,IAAA,2BAAa,EAAC,YAAY,CAAC,CAAC;gBAE5B,gFAAgF;gBAChF,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAClG,MAAM,4BAA4B,GAAG,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,0CAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;gBAC9F,MAAM,mBAAmB,GAAG,4BAA4B,aAA5B,4BAA4B,uBAA5B,4BAA4B,CAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;gBACxG,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,IAAI,CAAC;gBAC7C,IAAI,UAAU,EAAE;oBACd,IAAA,6BAAe,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC;iBAC3C;aACF;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"cbn-custom-babylon-loader-plugin.js","sourceRoot":"","sources":["../../../src/internal/cbn-custom-babylon-loader-plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oCASkB;AAClB,uDAA6D;AAC7D,+CAAwE;AACxE,yCAAwD;AAExD;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,sBAAc;CAEzD;AAFD,wDAEC;AAmBD;;;;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AAC,CAAC;SACrE;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { BaseTexture, Material, Node } from '../index';
2
- declare type MetadataValue = string | number | boolean | undefined;
2
+ declare type MetadataValue = string | number | boolean | object | undefined;
3
3
  declare type MetadataTarget = Node | Material | BaseTexture;
4
4
  declare type MetadataKeys = 'deferredMaterial' | 'materialToBeSet' | 'exportNode' | 'deleteAfterExport' | 'exchangeMaterialWith' | 'cloneSource' | 'cloneTarget';
5
5
  /**
@@ -1,4 +1,5 @@
1
- import { AssetContainer, TransformNode, Viewer } from '../index';
1
+ import { AssetContainer, DecalConfiguration, TransformNode, Viewer } from '../index';
2
+ import { CbnBabylonFileData } from '../internal/cbn-custom-babylon-loader-plugin';
2
3
  export declare type ModelAssetDefinition = {
3
4
  name: string;
4
5
  url: string;
@@ -24,6 +25,7 @@ declare type Model = {
24
25
  url: string;
25
26
  state: ModelAssetState;
26
27
  assetContainer: AssetContainer;
28
+ cbnBabylonFileData?: CbnBabylonFileData;
27
29
  isClone: boolean;
28
30
  visibilityCallId?: number;
29
31
  };
@@ -112,6 +114,13 @@ export declare class ModelManager {
112
114
  * A typical use case is to clone or instantiate a node from a "library" model.
113
115
  */
114
116
  getAssetContainerOfModel(name: string): Promise<AssetContainer>;
117
+ /**
118
+ * Returns the decals configuration of a certain model.\
119
+ * The model will be loaded before being able to access this configuration.\
120
+ * Decals are already converted to "normal" meshes when loading a model, still the original decals configuration can
121
+ * be useful e.g. for alterning decals.
122
+ */
123
+ getDecalsConfigurationOfModel(name: string): Promise<DecalConfiguration[]>;
115
124
  /**
116
125
  * Get model by name
117
126
  */
@@ -282,6 +282,40 @@ class ModelManager {
282
282
  return model.assetContainer;
283
283
  });
284
284
  }
285
+ /**
286
+ * Returns the decals configuration of a certain model.\
287
+ * The model will be loaded before being able to access this configuration.\
288
+ * Decals are already converted to "normal" meshes when loading a model, still the original decals configuration can
289
+ * be useful e.g. for alterning decals.
290
+ */
291
+ getDecalsConfigurationOfModel(name) {
292
+ var _a, _b;
293
+ return __awaiter(this, void 0, void 0, function* () {
294
+ const model = this._getModel(name);
295
+ if (!model) {
296
+ throw new index_1.ViewerError({
297
+ id: index_1.ViewerErrorIds.ModelNotRegistered,
298
+ message: `Can't get decals configuration of model "${name}" as model is not registered`,
299
+ });
300
+ }
301
+ if (model.state === 'notLoaded') {
302
+ yield this._loadModel(model);
303
+ }
304
+ else if (model.state === 'loading') {
305
+ yield this._loadModelPromises[model.name];
306
+ }
307
+ if (model.state !== 'inScene') {
308
+ yield this._prepareModelForScene(model);
309
+ }
310
+ // crop materialId as this is not part of `DecalConfiguration`
311
+ const decals = ((_b = (_a = model.cbnBabylonFileData) === null || _a === void 0 ? void 0 : _a.decals) !== null && _b !== void 0 ? _b : []).map(parsedDecal => {
312
+ const croppedDecal = parsedDecal;
313
+ delete croppedDecal.materialId;
314
+ return croppedDecal;
315
+ });
316
+ return decals;
317
+ });
318
+ }
285
319
  /**
286
320
  * Get model by name
287
321
  */
@@ -304,7 +338,12 @@ class ModelManager {
304
338
  const curEnvIntensity = this.viewer.scene.environmentIntensity;
305
339
  let assetContainer;
306
340
  try {
307
- assetContainer = yield index_1.SceneLoader.LoadAssetContainerAsync('', model.url, this.viewer.scene);
341
+ const fullContainer = (yield index_1.SceneLoader.LoadAssetContainerAsync('', model.url, this.viewer.scene));
342
+ // crop and store custom cbn data from .babylon file
343
+ model.cbnBabylonFileData = fullContainer.cbnData;
344
+ delete fullContainer.cbnData;
345
+ // from here it's a basic asset container again
346
+ assetContainer = fullContainer;
308
347
  }
309
348
  catch (e) {
310
349
  throw new index_1.ViewerError({
@@ -1 +1 @@
1
- {"version":3,"file":"model-manager.js","sourceRoot":"","sources":["../../../src/manager/model-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAWkB;AAClB,+DAAsE;AACtE,iEAAuE;AACvE,yCAAoC;AAqCpC;;;;GAIG;AACH,MAAa,YAAY;IAgCvB,YAA6B,MAA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Ac,CAAC,MAAM,EAAE;gBAC9C,MAAM,gBAAgB,GAAG,IAAA,0CAAwB,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;gBAC5E,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,EAAE,wBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC7G,MAAM,OAAO,GAAG,eAAe,KAAK,SAAS,IAAI,wBAAgB,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;gBACzG,IAAI,gBAAgB,IAAI,OAAO,EAAE;oBAC/B,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,gBAA0B,EAAE,IAAI,CAAC,CAAC;iBACvF;aACF;QACH,CAAC;KAAA;;AAtcH,oCAucC;AAtcC;;;GAGG;AACoB,0CAA6B,GAAG,WAAW,CAAC"}
@@ -27,6 +27,7 @@ export declare const ViewerErrorIds: {
27
27
  TextureCouldNotBeParsed: string;
28
28
  MaterialAlreadyExists: string;
29
29
  NotAClonedMaterial: string;
30
+ InvalidDecalConfiguration: string;
30
31
  };
31
32
  /** @internal */
32
33
  export declare class ViewerError extends Error {
@@ -25,6 +25,7 @@ exports.ViewerErrorIds = {
25
25
  TextureCouldNotBeParsed: 'TextureCouldNotBeParsed',
26
26
  MaterialAlreadyExists: 'MaterialAlreadyExists',
27
27
  NotAClonedMaterial: 'NotAClonedMaterial',
28
+ InvalidDecalConfiguration: 'InvalidDecalConfiguration',
28
29
  };
29
30
  /** @internal */
30
31
  class ViewerError extends Error {
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-error.js","sourceRoot":"","sources":["../../src/viewer-error.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAQH;;;;;;;;GAQG;AACU,QAAA,cAAc,GAAG;IAC5B,qBAAqB,EAAE,uBAAuB;IAC9C,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,gB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enation/3d-viewer",
3
- "version": "15.1.0-beta1",
3
+ "version": "16.0.0-alpha1",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -0,0 +1,95 @@
1
+ import { IAssetContainer, Material, Mesh, MeshBuilder, Tuple, Vector3, ViewerError, ViewerErrorIds } from '..';
2
+
3
+ export type DecalConfiguration = {
4
+ // basic settings for decal creation
5
+ name: string;
6
+ sourceMeshName: string;
7
+ position: Tuple<number, 3>;
8
+ normal: Tuple<number, 3>;
9
+ size: Tuple<number, 3>;
10
+ angle: number;
11
+
12
+ /** Shifts decals away from source mesh in direction of "normal" vector */
13
+ offset: number;
14
+
15
+ /**
16
+ * `true`: Use UV mapping from source mesh\
17
+ * `false`: Use default box mapping from the decal
18
+ *
19
+ * Default `false`
20
+ */
21
+ captureUVS?: boolean;
22
+
23
+ /**
24
+ * Create decal only on front side if set to `true`
25
+ *
26
+ * Default `true`
27
+ */
28
+ cullBackFaces?: boolean;
29
+
30
+ /** `true`: Sets created decal as child of source mesh
31
+ *
32
+ * Default `true`
33
+ */
34
+ localMode?: boolean;
35
+
36
+ /**
37
+ * The Babylon.js default for mesh side orientation value is `Material.CounterClockWiseSideOrientation`.\
38
+ * However if the mesh (in this case the created decal mesh) is located under a glTF root node, it has to be flipped,
39
+ * using `Material.ClockWiseSideOrientation`.
40
+ *
41
+ * Default `Material.ClockWiseSideOrientation`
42
+ */
43
+ sideOrientation?: number;
44
+ };
45
+
46
+ /**
47
+ * Creates mesh from a decal configuration.\
48
+ * This is basically calling `MeshBuilder.CreateDecal`, with some extra steps:
49
+ * - add created decal mesh to source mesh asset container
50
+ * - overwrite decal mesh side orientation (important for glTF models)
51
+ * - move decal along the "normal" to avoid clipping
52
+ */
53
+ export function createDecalMesh(config: DecalConfiguration, assetContainer: IAssetContainer, addToScene = true): Mesh {
54
+ const sourceMesh = assetContainer.meshes.find(mesh => mesh.name === config.sourceMeshName);
55
+ if (!sourceMesh) {
56
+ throw new ViewerError({
57
+ id: ViewerErrorIds.InvalidDecalConfiguration,
58
+ message: `Source mesh for decal "${config.name}" couldn't be found`,
59
+ });
60
+ }
61
+
62
+ const position = Vector3.FromArray(config.position);
63
+ const normal = Vector3.FromArray(config.normal).normalizeToNew();
64
+
65
+ const localMode = config.localMode ?? true;
66
+ const worldNormal = localMode ? Vector3.TransformNormal(normal, sourceMesh.getWorldMatrix()) : normal;
67
+
68
+ const decalMesh = MeshBuilder.CreateDecal(config.name, sourceMesh, {
69
+ position: position,
70
+ normal: normal,
71
+ size: Vector3.FromArray(config.size),
72
+ angle: config.angle,
73
+ captureUVS: config.captureUVS ?? false,
74
+ cullBackFaces: config.cullBackFaces ?? true,
75
+ localMode: config.localMode ?? true,
76
+ });
77
+
78
+ if (!addToScene) {
79
+ const scene = sourceMesh.getScene();
80
+ scene.removeMesh(decalMesh);
81
+ }
82
+
83
+ // make sure that the decal is part of the source mesh asset container
84
+ decalMesh._parentContainer = assetContainer;
85
+ assetContainer.meshes.push(decalMesh);
86
+
87
+ decalMesh.sideOrientation = config.sideOrientation ?? Material.ClockWiseSideOrientation;
88
+
89
+ // move decal away from mesh to avoid clipping
90
+ // NOTE: zOffset of material can't be used, since it's not supported in glTF and therefore not usable in AR
91
+ const offsetVector = worldNormal.scale(config.offset);
92
+ decalMesh.position.addInPlace(offsetVector);
93
+
94
+ return decalMesh;
95
+ }
package/src/index.ts CHANGED
@@ -69,3 +69,4 @@ export * from './manager/model-manager';
69
69
  export * from './manager/parameter-manager';
70
70
  export * from './manager/scene-manager';
71
71
  export * from './manager/texture-manager';
72
+ export * from './helper/decals-helper';