babylonjs-editor-tools 0.0.8 → 0.0.9

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.
Files changed (73) hide show
  1. package/build/index.node.js +1318 -0
  2. package/build/src/cinematic/events/apply-impulse.js +12 -0
  3. package/build/src/cinematic/events/set-enabled.js +5 -0
  4. package/build/src/cinematic/generate.js +134 -0
  5. package/build/src/cinematic/parse.js +99 -0
  6. package/build/src/cinematic/tools.js +66 -0
  7. package/build/src/cinematic/typings.js +2 -0
  8. package/build/src/decorators/apply.js +71 -0
  9. package/build/{decorators → src/decorators}/gui.js +1 -5
  10. package/build/src/decorators/inspector.js +131 -0
  11. package/build/src/decorators/particle-systems.js +15 -0
  12. package/build/{decorators → src/decorators}/scene.js +16 -7
  13. package/build/{decorators → src/decorators}/sound.js +1 -5
  14. package/build/src/index.js +17 -0
  15. package/build/src/loading/loader.js +55 -0
  16. package/build/src/loading/physics.js +28 -0
  17. package/build/src/loading/rendering.js +30 -0
  18. package/build/src/loading/script.js +35 -0
  19. package/build/src/loading/sound.js +14 -0
  20. package/build/{texture.js → src/loading/texture.js} +9 -11
  21. package/build/{rendering → src/rendering}/default-pipeline.js +40 -15
  22. package/build/src/rendering/motion-blur.js +42 -0
  23. package/build/{rendering → src/rendering}/ssao.js +11 -15
  24. package/build/{rendering → src/rendering}/ssr.js +11 -15
  25. package/build/src/rendering/tools.js +51 -0
  26. package/build/src/rendering/vls.js +57 -0
  27. package/build/src/script.js +2 -0
  28. package/build/{guards.js → src/tools/guards.js} +3 -9
  29. package/build/src/tools/light.js +25 -0
  30. package/build/src/tools/scalar.js +8 -0
  31. package/build/src/tools/sound.js +19 -0
  32. package/build/src/tools/texture.js +16 -0
  33. package/package.json +24 -6
  34. package/build/decorators/apply.js +0 -42
  35. package/build/decorators/apply.js.map +0 -1
  36. package/build/decorators/gui.js.map +0 -1
  37. package/build/decorators/scene.js.map +0 -1
  38. package/build/decorators/sound.js.map +0 -1
  39. package/build/guards.js.map +0 -1
  40. package/build/index.js +0 -26
  41. package/build/index.js.map +0 -1
  42. package/build/light.js +0 -30
  43. package/build/light.js.map +0 -1
  44. package/build/loader.js +0 -87
  45. package/build/loader.js.map +0 -1
  46. package/build/physics.js +0 -33
  47. package/build/physics.js.map +0 -1
  48. package/build/rendering/default-pipeline.js.map +0 -1
  49. package/build/rendering/motion-blur.js +0 -46
  50. package/build/rendering/motion-blur.js.map +0 -1
  51. package/build/rendering/ssao.js.map +0 -1
  52. package/build/rendering/ssr.js.map +0 -1
  53. package/build/script.js +0 -3
  54. package/build/script.js.map +0 -1
  55. package/build/texture.js.map +0 -1
  56. package/build/tools/scalar.js +0 -12
  57. package/build/tools/scalar.js.map +0 -1
  58. package/declaration/decorators/apply.d.ts +0 -23
  59. package/declaration/decorators/gui.d.ts +0 -12
  60. package/declaration/decorators/scene.d.ts +0 -17
  61. package/declaration/decorators/sound.d.ts +0 -8
  62. package/declaration/guards.d.ts +0 -18
  63. package/declaration/index.d.ts +0 -9
  64. package/declaration/light.d.ts +0 -3
  65. package/declaration/loader.d.ts +0 -31
  66. package/declaration/physics.d.ts +0 -6
  67. package/declaration/rendering/default-pipeline.d.ts +0 -11
  68. package/declaration/rendering/motion-blur.d.ts +0 -8
  69. package/declaration/rendering/ssao.d.ts +0 -8
  70. package/declaration/rendering/ssr.d.ts +0 -8
  71. package/declaration/script.d.ts +0 -13
  72. package/declaration/texture.d.ts +0 -1
  73. package/declaration/tools/scalar.d.ts +0 -1
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Searches for a sound by its id in the scene by traversing all soundtracks.
3
+ * @param id defines the id of the sound to retrieve.
4
+ * @param scene defines the reference to the scene where to find the instantiated sound.
5
+ */
6
+ export function getSoundById(id, scene) {
7
+ const soundTracks = scene.soundTracks ?? [];
8
+ if (!soundTracks.length) {
9
+ soundTracks.push(scene.mainSoundTrack);
10
+ }
11
+ for (let i = 0, len = soundTracks.length; i < len; i++) {
12
+ const sound = soundTracks[i].soundCollection.find((s) => s.id === id);
13
+ if (sound) {
14
+ return sound;
15
+ }
16
+ }
17
+ return null;
18
+ }
19
+ //# sourceMappingURL=sound.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Set the compressed texture format to use, based on the formats you have, and the formats
3
+ * supported by the hardware / browser.
4
+ * @param engine defines the reference to the engine to configure the texture format to use.
5
+ * @see `@babylonjs/core/Engines/Extensions/engine.textureSelector.d.ts` for more information.
6
+ */
7
+ export function configureEngineToUseCompressedTextures(engine) {
8
+ engine.setTextureFormatToUse([
9
+ "-dxt.ktx",
10
+ "-astc.ktx",
11
+ "-pvrtc.ktx",
12
+ "-etc1.ktx",
13
+ "-etc2.ktx",
14
+ ]);
15
+ }
16
+ //# sourceMappingURL=texture.js.map
package/package.json CHANGED
@@ -1,19 +1,37 @@
1
1
  {
2
2
  "name": "babylonjs-editor-tools",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Babylon.js Editor Tools is a set of tools to help you create, edit and manage your Babylon.js scenes made using the Babylon.JS Editor",
5
5
  "productName": "Babylon.js Editor Tools",
6
6
  "scripts": {
7
- "build": "tsc -p .",
8
- "watch": "tsc -p . --watch"
7
+ "build": "tsc -p . && node esbuild.mjs",
8
+ "watch": "concurrently \"tsc -p . --watch\" \"node esbuild.mjs --watch\"",
9
+ "test": "jest test/*",
10
+ "coverage": "jest test/* --coverage"
9
11
  },
10
12
  "main": "build/index.js",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./declaration/src/index.d.ts",
16
+ "import": "./build/src/index.js",
17
+ "require": "./build/index.node.js"
18
+ }
19
+ },
11
20
  "typings": "declaration/index.ts",
12
21
  "license": "(Apache-2.0)",
13
22
  "devDependencies": {
14
- "@babylonjs/core": "7.44.0",
15
- "@babylonjs/gui": "7.44.0",
16
- "typescript": "5.3.3"
23
+ "@babel/core": "^7.26.10",
24
+ "@babel/preset-env": "^7.26.9",
25
+ "@babel/preset-typescript": "^7.27.0",
26
+ "@babylonjs/core": "8.6.1",
27
+ "@babylonjs/gui": "8.6.1",
28
+ "@types/jest": "^29.5.14",
29
+ "babel-jest": "^29.7.0",
30
+ "babel-plugin-transform-class-properties": "^6.24.1",
31
+ "babel-plugin-transform-decorators-legacy": "^1.3.5",
32
+ "esbuild": "^0.25.0",
33
+ "jest": "^29.7.0",
34
+ "typescript": "5.4.5"
17
35
  },
18
36
  "dependencies": {}
19
37
  }
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyDecorators = void 0;
4
- const advancedDynamicTexture_1 = require("@babylonjs/gui/2D/advancedDynamicTexture");
5
- function applyDecorators(scene, object, instance, rootUrl) {
6
- const ctor = instance.constructor;
7
- if (!ctor) {
8
- return;
9
- }
10
- // @nodeFromScene
11
- ctor._NodesFromScene?.forEach((params) => {
12
- instance[params.propertyKey.toString()] = scene.getNodeByName(params.nodeName);
13
- });
14
- // @nodeFromDescendants
15
- ctor._NodesFromDescendants?.forEach((params) => {
16
- const descendant = object.getDescendants?.(params.directDescendantsOnly, (node) => node.name === params.nodeName)[0];
17
- instance[params.propertyKey.toString()] = descendant ?? null;
18
- });
19
- // soundFromScene
20
- ctor._SoundsFromScene?.forEach((params) => {
21
- const sound = scene.getSoundByName?.(params.soundName);
22
- instance[params.propertyKey.toString()] = sound ?? null;
23
- });
24
- // @guiFromAsset
25
- ctor._GuiFromAsset?.forEach(async (params) => {
26
- const guiUrl = `${rootUrl}assets/${params.pathInAssets}`;
27
- try {
28
- const response = await fetch(guiUrl);
29
- const data = await response.json();
30
- const gui = advancedDynamicTexture_1.AdvancedDynamicTexture.CreateFullscreenUI(data.name, true, scene);
31
- gui.parseSerializedObject(data.content, false);
32
- instance[params.propertyKey.toString()] = gui;
33
- params.onGuiCreated?.(instance, gui);
34
- }
35
- catch (e) {
36
- console.error(`Failed to load GUI from asset: ${guiUrl}`);
37
- throw e;
38
- }
39
- });
40
- }
41
- exports.applyDecorators = applyDecorators;
42
- //#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
1
- {"version":3,"file":"scene.js","sourceRoot":"","sources":["../../src/decorators/scene.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC1C,OAAO,UAAU,MAAW,EAAE,WAA4B;QACtD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAkC,CAAC;QAEvD,IAAI,CAAC,eAAe,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC;AACN,CAAC;AAPD,sCAOC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,wBAAiC,KAAK;IACxF,OAAO,UAAU,MAAW,EAAE,WAA4B;QACtD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAkC,CAAC;QAEvD,IAAI,CAAC,qBAAqB,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACtF,CAAC,CAAC;AACN,CAAC;AAPD,kDAOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sound.js","sourceRoot":"","sources":["../../src/decorators/sound.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,SAAiB;IAC5C,OAAO,UAAU,MAAW,EAAE,WAA4B;QACtD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAkC,CAAC;QAEvD,IAAI,CAAC,gBAAgB,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC;AACN,CAAC;AAPD,wCAOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":";;;AAIA;;;GAGG;AACH,SAAgB,MAAM,CAAC,MAAW;IAC9B,QAAQ,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC;QAC9B,KAAK,MAAM,CAAC;QACZ,KAAK,YAAY;YACb,OAAO,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AARD,wBAQC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,MAAW;IACpC,OAAO,MAAM,CAAC,YAAY,EAAE,EAAE,KAAK,YAAY,CAAC;AACpD,CAAC;AAFD,oCAEC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAW;IACjC,OAAO,MAAM,EAAE,YAAY,EAAE,EAAE,KAAK,SAAS,CAAC;AAClD,CAAC;AAFD,8BAEC"}
package/build/index.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./loader"), exports);
18
- __exportStar(require("./rendering/ssao"), exports);
19
- __exportStar(require("./rendering/ssr"), exports);
20
- __exportStar(require("./rendering/motion-blur"), exports);
21
- __exportStar(require("./rendering/default-pipeline"), exports);
22
- __exportStar(require("./decorators/scene"), exports);
23
- __exportStar(require("./decorators/gui"), exports);
24
- __exportStar(require("./decorators/sound"), exports);
25
- __exportStar(require("./script"), exports);
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AAEzB,mDAAiC;AACjC,kDAAgC;AAChC,0DAAwC;AACxC,+DAA6C;AAE7C,qDAAmC;AACnC,mDAAiC;AACjC,qDAAmC;AAEnC,2CAAyB"}
package/build/light.js DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configureShadowMapRefreshRate = exports.configureShadowMapRenderListPredicate = void 0;
4
- const math_vector_1 = require("@babylonjs/core/Maths/math.vector");
5
- const renderTargetTexture_1 = require("@babylonjs/core/Materials/Textures/renderTargetTexture");
6
- function configureShadowMapRenderListPredicate(scene) {
7
- scene.lights.forEach((light) => {
8
- const shadowMap = light.getShadowGenerator()?.getShadowMap();
9
- if (!shadowMap) {
10
- return;
11
- }
12
- shadowMap.renderListPredicate = (mesh) => {
13
- const distance = math_vector_1.Vector3.Distance(mesh.getAbsolutePosition(), light.getAbsolutePosition());
14
- return distance <= light.range;
15
- };
16
- });
17
- }
18
- exports.configureShadowMapRenderListPredicate = configureShadowMapRenderListPredicate;
19
- async function configureShadowMapRefreshRate(scene) {
20
- scene.executeWhenReady(() => {
21
- scene.lights.forEach((light) => {
22
- const shadowMap = light.getShadowGenerator()?.getShadowMap();
23
- if (shadowMap) {
24
- shadowMap.refreshRate = light.metadata?.refreshRate ?? renderTargetTexture_1.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME;
25
- }
26
- });
27
- });
28
- }
29
- exports.configureShadowMapRefreshRate = configureShadowMapRefreshRate;
30
- //# sourceMappingURL=light.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"light.js","sourceRoot":"","sources":["../src/light.ts"],"names":[],"mappings":";;;AACA,mEAA4D;AAC5D,gGAA6F;AAE7F,SAAgB,qCAAqC,CAAC,KAAY;IAC9D,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAkB,EAAE,EAAE,YAAY,EAAE,CAAC;QAC7D,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO;QACX,CAAC;QAED,SAAS,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE,EAAE;YACrC,MAAM,QAAQ,GAAG,qBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC;YAC3F,OAAO,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC;QACnC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAZD,sFAYC;AAEM,KAAK,UAAU,6BAA6B,CAAC,KAAY;IAC5D,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;QACxB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3B,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAkB,EAAE,EAAE,YAAY,EAAE,CAAC;YAC7D,IAAI,SAAS,EAAE,CAAC;gBACZ,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAE,WAAW,IAAI,yCAAmB,CAAC,+BAA+B,CAAC;YAC/G,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AATD,sEASC"}
package/build/loader.js DELETED
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadScriptsFor = exports.loadScene = void 0;
4
- const sceneLoader_1 = require("@babylonjs/core/Loading/sceneLoader");
5
- const ssr_1 = require("./rendering/ssr");
6
- const ssao_1 = require("./rendering/ssao");
7
- const motion_blur_1 = require("./rendering/motion-blur");
8
- const default_pipeline_1 = require("./rendering/default-pipeline");
9
- const apply_1 = require("./decorators/apply");
10
- const physics_1 = require("./physics");
11
- const light_1 = require("./light");
12
- require("./texture");
13
- async function loadScene(rootUrl, sceneFilename, scene, scriptsMap, quality = "high") {
14
- scene.loadingQuality = quality;
15
- await sceneLoader_1.SceneLoader.AppendAsync(rootUrl, sceneFilename, scene, null, ".babylon");
16
- // Wait until scene is ready.
17
- while (!scene.isReady()) {
18
- await new Promise((resolve) => setTimeout(resolve, 150));
19
- }
20
- (0, light_1.configureShadowMapRenderListPredicate)(scene);
21
- (0, light_1.configureShadowMapRefreshRate)(scene);
22
- if (scene.metadata?.rendering) {
23
- const camera = scene.activeCamera ?? scene.cameras[0];
24
- if (scene.metadata.rendering.ssao2RenderingPipeline) {
25
- (0, ssao_1.parseSSAO2RenderingPipeline)(scene, camera, scene.metadata.rendering.ssao2RenderingPipeline);
26
- }
27
- if (scene.metadata.rendering.ssrRenderingPipeline) {
28
- (0, ssr_1.parseSSRRenderingPipeline)(scene, camera, scene.metadata.rendering.ssrRenderingPipeline);
29
- }
30
- if (scene.metadata.rendering.motionBlurPostProcess) {
31
- (0, motion_blur_1.parseMotionBlurPostProcess)(scene, camera, scene.metadata.rendering.motionBlurPostProcess);
32
- }
33
- if (scene.metadata.rendering.defaultRenderingPipeline) {
34
- (0, default_pipeline_1.parseDefaultRenderingPipeline)(scene, camera, scene.metadata.rendering.defaultRenderingPipeline);
35
- }
36
- }
37
- loadScriptsFor(scene, scene, scriptsMap, rootUrl);
38
- scene.transformNodes.forEach((transformNode) => {
39
- loadScriptsFor(scene, transformNode, scriptsMap, rootUrl);
40
- });
41
- scene.meshes.forEach((mesh) => {
42
- (0, physics_1.configurePhysicsAggregate)(mesh);
43
- loadScriptsFor(scene, mesh, scriptsMap, rootUrl);
44
- });
45
- scene.lights.forEach((light) => {
46
- loadScriptsFor(scene, light, scriptsMap, rootUrl);
47
- });
48
- scene.cameras.forEach((camera) => {
49
- loadScriptsFor(scene, camera, scriptsMap, rootUrl);
50
- });
51
- }
52
- exports.loadScene = loadScene;
53
- function loadScriptsFor(scene, object, scriptsMap, rootUrl) {
54
- if (!object.metadata) {
55
- return;
56
- }
57
- object.metadata.scripts?.forEach((script) => {
58
- if (!script.enabled) {
59
- return;
60
- }
61
- const exports = scriptsMap[script.key];
62
- if (!exports) {
63
- return;
64
- }
65
- if (exports.default) {
66
- const instance = new exports.default(object);
67
- (0, apply_1.applyDecorators)(scene, object, instance, rootUrl);
68
- if (instance.onStart) {
69
- scene.onBeforeRenderObservable.addOnce(() => instance.onStart());
70
- }
71
- if (instance.onUpdate) {
72
- scene.onBeforeRenderObservable.add(() => instance.onUpdate());
73
- }
74
- }
75
- else {
76
- if (exports.onStart) {
77
- scene.onBeforeRenderObservable.addOnce(() => exports.onStart(object));
78
- }
79
- if (exports.onUpdate) {
80
- scene.onBeforeRenderObservable.add(() => exports.onUpdate(object));
81
- }
82
- }
83
- });
84
- object.metadata.scripts = undefined;
85
- }
86
- exports.loadScriptsFor = loadScriptsFor;
87
- //# sourceMappingURL=loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAElE,yCAA4D;AAC5D,2CAA+D;AAC/D,yDAAqE;AACrE,mEAA6E;AAE7E,8CAAqD;AAErD,uCAAsD;AACtD,mCAA+F;AAE/F,qBAAmB;AAmCZ,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,aAAqB,EAAE,KAAY,EAAE,UAAqB,EAAE,UAAsC,MAAM;IACrJ,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC;IAE/B,MAAM,yBAAW,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAE/E,6BAA6B;IAC7B,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CA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E,CAAC;gBACnB,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,CAAC;YACtE,CAAC;YAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACpB,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAS,EAAE,CAAC,CAAC;YACnE,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBAClB,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3E,CAAC;YAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACnB,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YACxE,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;AACxC,CAAC;AAvCD,wCAuCC"}
package/build/physics.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configurePhysicsAggregate = void 0;
4
- const math_vector_1 = require("@babylonjs/core/Maths/math.vector");
5
- const physicsAggregate_1 = require("@babylonjs/core/Physics/v2/physicsAggregate");
6
- const guards_1 = require("./guards");
7
- /**
8
- * Parses and loads the physics aggregate data for the given mesh.
9
- * @param mesh defines the reference to the mesh object.
10
- */
11
- function configurePhysicsAggregate(mesh) {
12
- const data = mesh.metadata?.physicsAggregate;
13
- if (!data) {
14
- return;
15
- }
16
- const shapeType = data.shape.type;
17
- const aggregate = new physicsAggregate_1.PhysicsAggregate(mesh, shapeType, {
18
- mass: data.massProperties.mass,
19
- mesh: (0, guards_1.isMesh)(mesh) ? mesh : undefined,
20
- });
21
- aggregate.body.setMassProperties({
22
- mass: data.massProperties.mass,
23
- inertia: data.massProperties.inertia ? math_vector_1.Vector3.FromArray(data.massProperties.inertia) : undefined,
24
- centerOfMass: data.massProperties.centerOfMass ? math_vector_1.Vector3.FromArray(data.massProperties.centerOfMass) : undefined,
25
- inertiaOrientation: data.massProperties.inertiaOrientation ? math_vector_1.Quaternion.FromArray(data.massProperties.inertiaOrientation) : undefined,
26
- });
27
- aggregate.shape.density = data.shape.density;
28
- aggregate.body.setMotionType(data.body.motionType);
29
- aggregate.shape.material = data.material;
30
- mesh.metadata.physicsAggregate = undefined;
31
- }
32
- exports.configurePhysicsAggregate = configurePhysicsAggregate;
33
- //# sourceMappingURL=physics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"physics.js","sourceRoot":"","sources":["../src/physics.ts"],"names":[],"mappings":";;;AACA,mEAAwE;AACxE,kFAA+E;AAE/E,qCAAkC;AAElC;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,IAAkB;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO;IACX,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IAElC,MAAM,SAAS,GAAG,IAAI,mCAAgB,CAAC,IAAI,EAAE,SAAS,EAAE;QACpD,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI;QAC9B,IAAI,EAAE,IAAA,eAAM,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;KACxC,CAAC,CAAC;IAEH,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC7B,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI;QAC9B,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAO,C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G,IAAI,CAAC,WAAW,CAAC;IAErD,OAAO,QAAQ,CAAC;AACpB,CAAC;AA3CD,sEA2CC"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseMotionBlurPostProcess = exports.serializeMotionBlurPostProcess = exports.createMotionBlurPostProcess = exports.disposeMotionBlurPostProcess = exports.getMotionBlurPostProcess = void 0;
4
- const motionBlurPostProcess_1 = require("@babylonjs/core/PostProcesses/motionBlurPostProcess");
5
- let motionBlurPostProcess = null;
6
- function getMotionBlurPostProcess() {
7
- return motionBlurPostProcess;
8
- }
9
- exports.getMotionBlurPostProcess = getMotionBlurPostProcess;
10
- function disposeMotionBlurPostProcess() {
11
- if (motionBlurPostProcess) {
12
- motionBlurPostProcess.dispose();
13
- motionBlurPostProcess = null;
14
- }
15
- }
16
- exports.disposeMotionBlurPostProcess = disposeMotionBlurPostProcess;
17
- function createMotionBlurPostProcess(scene, camera) {
18
- motionBlurPostProcess = new motionBlurPostProcess_1.MotionBlurPostProcess("MotionBlurPostProcess", scene, 1.0, camera);
19
- motionBlurPostProcess.motionStrength = 1.0;
20
- motionBlurPostProcess.isObjectBased = true;
21
- return motionBlurPostProcess;
22
- }
23
- exports.createMotionBlurPostProcess = createMotionBlurPostProcess;
24
- function serializeMotionBlurPostProcess() {
25
- if (!motionBlurPostProcess) {
26
- return null;
27
- }
28
- return {
29
- isObjectBased: motionBlurPostProcess.isObjectBased,
30
- motionStrength: motionBlurPostProcess.motionStrength,
31
- motionBlurSamples: motionBlurPostProcess.motionBlurSamples,
32
- };
33
- }
34
- exports.serializeMotionBlurPostProcess = serializeMotionBlurPostProcess;
35
- function parseMotionBlurPostProcess(scene, camera, data) {
36
- if (motionBlurPostProcess) {
37
- return motionBlurPostProcess;
38
- }
39
- const postProcess = createMotionBlurPostProcess(scene, camera);
40
- postProcess.isObjectBased = data.isObjectBased;
41
- postProcess.motionStrength = data.motionStrength;
42
- postProcess.motionBlurSamples = data.motionBlurSamples;
43
- return postProcess;
44
- }
45
- exports.parseMotionBlurPostProcess = parseMotionBlurPostProcess;
46
- //# sourceMappingURL=motion-blur.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"motion-blur.js","sourceRoot":"","sources":["../../src/rendering/motion-blur.ts"],"names":[],"mappings":";;;AAEA,+FAA4F;AAE5F,IAAI,qBAAqB,GAAiC,IAAI,CAAC;AAE/D,SAAgB,wBAAwB;IACpC,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAFD,4DAEC;AAED,SAAgB,4BAA4B;IACxC,IAAI,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,CAAC,OAAO,EAAE,CAAC;QAChC,qBAAqB,GAAG,IAAI,CAAC;IACjC,CAAC;AACL,CAAC;AALD,oEAKC;AAED,SAAgB,2BAA2B,CAAC,KAAY,EAAE,MAAc;IACpE,qBAAqB,GAAG,IAAI,6CAAqB,CAAC,uBAAuB,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC/F,qBAAqB,CAAC,cAAc,GAAG,GAAG,CAAC;IAC3C,qBAAqB,CAAC,aAAa,GAAG,IAAI,CAAC;IAE3C,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAND,kEAMC;AAED,SAAgB,8BAA8B;IAC1C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO;QACH,aAAa,EAAE,qBAAqB,CAAC,aAAa;QAClD,cAAc,EAAE,qBAAqB,CAAC,cAAc;QACpD,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;KAC7D,CAAC;AACN,CAAC;AAVD,wEAUC;AAED,SAAgB,0BAA0B,CAAC,KAAY,EAAE,MAAc,EAAE,IAAS;IAC9E,IAAI,qBAAqB,EAAE,CAAC;QACxB,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAED,MAAM,WAAW,GAAG,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IA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IAChE,QAAQ,CAAC,mCAAmC,GAAG,IAAI,CAAC,mCAAmC,CAAC;IACxF,QAAQ,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;IAC5D,QAAQ,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAC9D,QAAQ,CAAC,6BAA6B,GAAG,IAAI,CAAC,6BAA6B,CAAC;IAC5E,QAAQ,CAAC,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,CAAC;IAExE,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC9C,QAAQ,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAC1D,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IAC5C,QAAQ,CAAC,8BAA8B,GAAG,IAAI,CAAC,8BAA8B,CAAC;IAE9E,OAAO,QAAQ,CAAC;AACpB,CAAC;AAlCD,8DAkCC"}
package/build/script.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=script.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"script.js","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"texture.js","sourceRoot":"","sources":["../src/texture.ts"],"names":[],"mappings":";;AAGA,4FAAoF;AAEpF,2CAAoD;AAEpD;;GAEG;AACH,MAAM,aAAa,GAAG,8CAAmB,CAAC,cAAc,CAAC;AAEzD,8CAAmB,CAAC,cAAc,GAAG,CAAC,cAAmB,EAAE,KAAY,EAAE,OAAe,EAAyB,EAAE;IAC/G,IAAI,KAAK,CAAC,cAAc,KAAK,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;QACxE,OAAO,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,KAAK,GA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B,OAAO,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAE3D,MAAM,WAAW,GAAG,GAAG,YAAY,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC;IAE5D,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE3B,cAAc,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEzC,OAAO,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPowerOfTwoUntil = void 0;
4
- function getPowerOfTwoUntil(limit) {
5
- let size = 1;
6
- while (size <= limit) {
7
- size <<= 1;
8
- }
9
- return size >> 1;
10
- }
11
- exports.getPowerOfTwoUntil = getPowerOfTwoUntil;
12
- //# sourceMappingURL=scalar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scalar.js","sourceRoot":"","sources":["../../src/tools/scalar.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAAC,KAAa;IAC5C,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,IAAI,KAAK,EAAE,CAAC;QACnB,IAAI,KAAK,CAAC,CAAC;IACf,CAAC;IAED,OAAO,IAAI,IAAI,CAAC,CAAC;AACrB,CAAC;AARD,gDAQC"}
@@ -1,23 +0,0 @@
1
- import { Scene } from "@babylonjs/core/scene";
2
- import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture";
3
- export interface ISceneDecoratorData {
4
- _NodesFromScene: {
5
- nodeName: string;
6
- propertyKey: string | Symbol;
7
- }[];
8
- _NodesFromDescendants: {
9
- nodeName: string;
10
- propertyKey: string | Symbol;
11
- directDescendantsOnly: boolean;
12
- }[];
13
- _SoundsFromScene: {
14
- soundName: string;
15
- propertyKey: string | Symbol;
16
- }[];
17
- _GuiFromAsset: {
18
- pathInAssets: string;
19
- onGuiCreated?: (instance: unknown, gui: AdvancedDynamicTexture) => unknown;
20
- propertyKey: string | Symbol;
21
- }[];
22
- }
23
- export declare function applyDecorators(scene: Scene, object: any, instance: any, rootUrl: string): void;
@@ -1,12 +0,0 @@
1
- import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture";
2
- /**
3
- * Makes the decorated property linked to the GUI created from the given asset file.
4
- * Once the script is instantiated, the reference to the gui texture is created from the asset file
5
- * and assigned to the property. Gui link cant' be used in constructor and its creation is asynchronous.
6
- * @param pathInAssets defines the relative path (as it is in the assets browser in the editor) to the .gui file.
7
- * @param onGuiCreated defines the optional callback that is called when the GUI is created.
8
- * @example
9
- * @guiFromAsset<MyScriptClass>("ui.gui", (instance, gui) => instance._onGuiLoaded(gui))
10
- * private _ui!: AdvancedDynamicTexture;
11
- */
12
- export declare function guiFromAsset<T>(pathInAssets: string, onGuiCreated?: (instance: T, gui: AdvancedDynamicTexture) => unknown): (target: any, propertyKey: string | Symbol) => void;
@@ -1,17 +0,0 @@
1
- /**
2
- * Makes the decorated property linked to the node that has the given name.
3
- * Once the script is instantiated, the reference to the node is retrieved from the scene
4
- * and assigned to the property. Node link cant' be used in constructor.
5
- * This can be used only by scripts using Classes.
6
- * @param nodeName defines the name of the node to retrieve in scene.
7
- */
8
- export declare function nodeFromScene(nodeName: string): (target: any, propertyKey: string | Symbol) => void;
9
- /**
10
- * Makes the decorated property linked to the node that has the given name.
11
- * Once the script is instantiated, the reference to the node is retrieved from the descendants
12
- * of the current node and assigned to the property. Node link cant' be used in constructor.
13
- * This can be used only by scripts using Classes.
14
- * @param nodeName defines the name of the node to retrieve in scene.
15
- * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered.
16
- */
17
- export declare function nodeFromDescendants(nodeName: string, directDescendantsOnly?: boolean): (target: any, propertyKey: string | Symbol) => void;
@@ -1,8 +0,0 @@
1
- /**
2
- * Makes the decorated property linked to the sound that has the given name.
3
- * Once the script is instantiated, the reference to the sound is retrieved from the scene
4
- * and assigned to the property. Node link cant' be used in constructor.
5
- * This can be used only by scripts using Classes.
6
- * @param soundName defines the name of the sound to retrieve in scene.
7
- */
8
- export declare function soundFromScene(soundName: string): (target: any, propertyKey: string | Symbol) => void;
@@ -1,18 +0,0 @@
1
- import { Mesh } from "@babylonjs/core/Meshes/mesh";
2
- import { GroundMesh } from "@babylonjs/core/Meshes/groundMesh";
3
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
4
- /**
5
- * Returns wether or not the given object is a Mesh.
6
- * @param object defines the reference to the object to test its class name.
7
- */
8
- export declare function isMesh(object: any): object is Mesh;
9
- /**
10
- * Returns wether or not the given object is a GroundMesh.
11
- * @param object defines the reference to the object to test its class name.
12
- */
13
- export declare function isGroundMesh(object: any): object is GroundMesh;
14
- /**
15
- * Returns wether or not the given object is a Texture.
16
- * @param object defines the reference to the object to test its class name.
17
- */
18
- export declare function isTexture(object: any): object is Texture;
@@ -1,9 +0,0 @@
1
- export * from "./loader";
2
- export * from "./rendering/ssao";
3
- export * from "./rendering/ssr";
4
- export * from "./rendering/motion-blur";
5
- export * from "./rendering/default-pipeline";
6
- export * from "./decorators/scene";
7
- export * from "./decorators/gui";
8
- export * from "./decorators/sound";
9
- export * from "./script";
@@ -1,3 +0,0 @@
1
- import { Scene } from "@babylonjs/core/scene";
2
- export declare function configureShadowMapRenderListPredicate(scene: Scene): void;
3
- export declare function configureShadowMapRefreshRate(scene: Scene): Promise<void>;
@@ -1,31 +0,0 @@
1
- import { Scene } from "@babylonjs/core/scene";
2
- import "./texture";
3
- /**
4
- * Defines the possible output type of a script.
5
- * `default` is a class that will be instantiated with the object as parameter.
6
- * `onStart` is a function that will be called once before the first render passing the reference to the object the script is attached to.
7
- * `onUpdate` is a function that will be called every frame passing the reference to the object the script is attached to
8
- */
9
- export type ScriptMap = Record<string, {
10
- default?: new (object: any) => {
11
- onStart?(): void;
12
- onUpdate?(): void;
13
- };
14
- onStart?: (object: any) => void;
15
- onUpdate?: (object: any) => void;
16
- }>;
17
- /**
18
- * Defines the overall desired quality of the scene.
19
- * In other words, defines the quality of textures that will be loaded in terms of dimensions.
20
- * The editor computes automatic "hight (untouched)", "medium (half)", and "low (quarter)" quality levels for textures.
21
- * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene
22
- * especially on mobiles where memory is limited.
23
- */
24
- export type SceneLoaderQualitySelector = "low" | "medium" | "high";
25
- declare module "@babylonjs/core/scene" {
26
- interface Scene {
27
- loadingQuality: SceneLoaderQualitySelector;
28
- }
29
- }
30
- export declare function loadScene(rootUrl: string, sceneFilename: string, scene: Scene, scriptsMap: ScriptMap, quality?: SceneLoaderQualitySelector): Promise<void>;
31
- export declare function loadScriptsFor(scene: Scene, object: any, scriptsMap: ScriptMap, rootUrl: string): void;
@@ -1,6 +0,0 @@
1
- import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
2
- /**
3
- * Parses and loads the physics aggregate data for the given mesh.
4
- * @param mesh defines the reference to the mesh object.
5
- */
6
- export declare function configurePhysicsAggregate(mesh: AbstractMesh): void;
@@ -1,11 +0,0 @@
1
- import { Scene } from "@babylonjs/core/scene";
2
- import { Camera } from "@babylonjs/core/Cameras/camera";
3
- import { DefaultRenderingPipeline } from "@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline";
4
- /**
5
- * Returns the reference to the default rendering pipeline if exists.
6
- */
7
- export declare function getDefaultRenderingPipeline(): DefaultRenderingPipeline | null;
8
- export declare function disposeDefaultRenderingPipeline(): void;
9
- export declare function createDefaultRenderingPipeline(scene: Scene, camera: Camera): DefaultRenderingPipeline;
10
- export declare function serializeDefaultRenderingPipeline(): any;
11
- export declare function parseDefaultRenderingPipeline(scene: Scene, camera: Camera, data: any): DefaultRenderingPipeline;