@babylonjs/core 5.48.0 → 5.48.1

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 (66) hide show
  1. package/Bones/skeleton.js +1 -1
  2. package/Bones/skeleton.js.map +1 -1
  3. package/Debug/physicsViewer.js +4 -0
  4. package/Debug/physicsViewer.js.map +1 -1
  5. package/Engines/Native/nativeInterfaces.d.ts +0 -1
  6. package/Engines/Native/nativeInterfaces.js.map +1 -1
  7. package/Engines/engine.d.ts +3 -1
  8. package/Engines/engine.js +14 -5
  9. package/Engines/engine.js.map +1 -1
  10. package/Engines/engineStore.d.ts +6 -0
  11. package/Engines/engineStore.js +6 -0
  12. package/Engines/engineStore.js.map +1 -1
  13. package/Engines/nativeEngine.d.ts +3 -2
  14. package/Engines/nativeEngine.js +9 -5
  15. package/Engines/nativeEngine.js.map +1 -1
  16. package/Engines/thinEngine.d.ts +4 -3
  17. package/Engines/thinEngine.js +11 -13
  18. package/Engines/thinEngine.js.map +1 -1
  19. package/Helpers/environmentHelper.d.ts +1 -0
  20. package/Helpers/environmentHelper.js +6 -5
  21. package/Helpers/environmentHelper.js.map +1 -1
  22. package/Loading/Plugins/babylonFileLoader.js +1 -0
  23. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  24. package/Materials/Background/backgroundMaterial.js +1 -1
  25. package/Materials/Background/backgroundMaterial.js.map +1 -1
  26. package/Materials/Node/Blocks/Input/inputBlock.js +8 -8
  27. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  28. package/Materials/Textures/thinTexture.d.ts +4 -2
  29. package/Materials/Textures/thinTexture.js +5 -2
  30. package/Materials/Textures/thinTexture.js.map +1 -1
  31. package/Materials/material.js +5 -0
  32. package/Materials/material.js.map +1 -1
  33. package/Materials/materialHelper.js +1 -1
  34. package/Materials/materialHelper.js.map +1 -1
  35. package/Materials/materialPluginBase.js +3 -0
  36. package/Materials/materialPluginBase.js.map +1 -1
  37. package/Materials/pushMaterial.d.ts +2 -1
  38. package/Materials/pushMaterial.js +4 -0
  39. package/Materials/pushMaterial.js.map +1 -1
  40. package/Maths/math.color.d.ts +20 -12
  41. package/Maths/math.color.js +85 -31
  42. package/Maths/math.color.js.map +1 -1
  43. package/Misc/decorators.js +2 -2
  44. package/Misc/decorators.js.map +1 -1
  45. package/Misc/fileTools.js +3 -0
  46. package/Misc/fileTools.js.map +1 -1
  47. package/Misc/khronosTextureContainer2.d.ts +3 -3
  48. package/Misc/khronosTextureContainer2.js +4 -3
  49. package/Misc/khronosTextureContainer2.js.map +1 -1
  50. package/Misc/observable.d.ts +18 -1
  51. package/Misc/observable.js +28 -2
  52. package/Misc/observable.js.map +1 -1
  53. package/Physics/v2/IPhysicsEnginePlugin.d.ts +3 -0
  54. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  55. package/Physics/v2/physicsAggregate.js +1 -1
  56. package/Physics/v2/physicsAggregate.js.map +1 -1
  57. package/Physics/v2/physicsBody.d.ts +12 -0
  58. package/Physics/v2/physicsBody.js +19 -0
  59. package/Physics/v2/physicsBody.js.map +1 -1
  60. package/Physics/v2/physicsShape.d.ts +24 -4
  61. package/Physics/v2/physicsShape.js +24 -13
  62. package/Physics/v2/physicsShape.js.map +1 -1
  63. package/package.json +1 -1
  64. package/scene.d.ts +1 -1
  65. package/scene.js +47 -46
  66. package/scene.js.map +1 -1
@@ -189,6 +189,8 @@ export declare class ThinEngine {
189
189
  * Returns the version of the engine
190
190
  */
191
191
  get version(): number;
192
+ private _isDisposed;
193
+ get isDisposed(): boolean;
192
194
  /**
193
195
  * Gets or sets the epsilon value used by collision engine
194
196
  */
@@ -417,7 +419,7 @@ export declare class ThinEngine {
417
419
  */
418
420
  adaptToDeviceRatio: boolean;
419
421
  /** @internal */
420
- private _lastDevicePixelRatio;
422
+ protected _lastDevicePixelRatio: number;
421
423
  /** @internal */
422
424
  _transformTextureUrl: Nullable<(url: string) => string>;
423
425
  /**
@@ -487,11 +489,10 @@ export declare class ThinEngine {
487
489
  */
488
490
  get snapshotRenderingMode(): number;
489
491
  set snapshotRenderingMode(mode: number);
490
- protected _useExactSrgbConversions: boolean;
491
492
  /**
492
493
  * Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
493
494
  */
494
- get useExactSrgbConversions(): boolean;
495
+ readonly useExactSrgbConversions: boolean;
495
496
  /**
496
497
  * Creates a new snapshot at the next frame using the current snapshotRenderingMode
497
498
  */
@@ -34,13 +34,13 @@ export class ThinEngine {
34
34
  */
35
35
  // Not mixed with Version for tooling purpose.
36
36
  static get NpmPackage() {
37
- return "babylonjs@5.48.0";
37
+ return "babylonjs@5.48.1";
38
38
  }
39
39
  /**
40
40
  * Returns the current version of the framework
41
41
  */
42
42
  static get Version() {
43
- return "5.48.0";
43
+ return "5.48.1";
44
44
  }
45
45
  /**
46
46
  * Returns a string describing the current engine
@@ -67,6 +67,9 @@ export class ThinEngine {
67
67
  get version() {
68
68
  return this._webGLVersion;
69
69
  }
70
+ get isDisposed() {
71
+ return this._isDisposed;
72
+ }
70
73
  /**
71
74
  * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
72
75
  */
@@ -235,12 +238,6 @@ export class ThinEngine {
235
238
  set snapshotRenderingMode(mode) {
236
239
  this._snapshotRenderingMode = mode;
237
240
  }
238
- /**
239
- * Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
240
- */
241
- get useExactSrgbConversions() {
242
- return this._useExactSrgbConversions;
243
- }
244
241
  /**
245
242
  * Creates a new snapshot at the next frame using the current snapshotRenderingMode
246
243
  */
@@ -283,6 +280,7 @@ export class ThinEngine {
283
280
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
284
281
  /** @internal */
285
282
  this._name = "WebGL";
283
+ this._isDisposed = false;
286
284
  /**
287
285
  * Gets or sets a boolean that indicates if textures must be forced to power of 2 size even if not required
288
286
  */
@@ -423,7 +421,6 @@ export class ThinEngine {
423
421
  /** @internal */
424
422
  this._isWebGPU = false;
425
423
  this._snapshotRenderingMode = 0;
426
- this._useExactSrgbConversions = false;
427
424
  this._viewportCached = { x: 0, y: 0, z: 0, w: 0 };
428
425
  this._unpackFlipYCached = null;
429
426
  /**
@@ -450,7 +447,7 @@ export class ThinEngine {
450
447
  this._audioContext = (_g = (_f = options.audioEngineOptions) === null || _f === void 0 ? void 0 : _f.audioContext) !== null && _g !== void 0 ? _g : null;
451
448
  this._audioDestination = (_j = (_h = options.audioEngineOptions) === null || _h === void 0 ? void 0 : _h.audioDestination) !== null && _j !== void 0 ? _j : null;
452
449
  this.premultipliedAlpha = (_k = options.premultipliedAlpha) !== null && _k !== void 0 ? _k : true;
453
- this._useExactSrgbConversions = (_l = options.useExactSrgbConversions) !== null && _l !== void 0 ? _l : false;
450
+ this.useExactSrgbConversions = (_l = options.useExactSrgbConversions) !== null && _l !== void 0 ? _l : false;
454
451
  this._doNotHandleContextLost = !!options.doNotHandleContextLost;
455
452
  this._isStencilEnable = options.stencil ? true : false;
456
453
  // Viewport
@@ -1079,7 +1076,7 @@ export class ThinEngine {
1079
1076
  */
1080
1077
  stopRenderLoop(renderFunction) {
1081
1078
  if (!renderFunction) {
1082
- this._activeRenderLoops = [];
1079
+ this._activeRenderLoops.length = 0;
1083
1080
  return;
1084
1081
  }
1085
1082
  const index = this._activeRenderLoops.indexOf(renderFunction);
@@ -1091,7 +1088,7 @@ export class ThinEngine {
1091
1088
  _renderLoop() {
1092
1089
  if (!this._contextWasLost) {
1093
1090
  let shouldRender = true;
1094
- if (!this.renderEvenInBackground && this._windowIsBackground) {
1091
+ if (this._isDisposed || (!this.renderEvenInBackground && this._windowIsBackground)) {
1095
1092
  shouldRender = false;
1096
1093
  }
1097
1094
  if (shouldRender) {
@@ -3438,7 +3435,7 @@ export class ThinEngine {
3438
3435
  */
3439
3436
  updateTextureSamplingMode(samplingMode, texture, generateMipMaps = false) {
3440
3437
  const target = this._getTextureTarget(texture);
3441
- const filters = this._getSamplingParameters(samplingMode, texture.generateMipMaps || generateMipMaps);
3438
+ const filters = this._getSamplingParameters(samplingMode, texture.useMipMaps || generateMipMaps);
3442
3439
  this._setTextureParameterInteger(target, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture);
3443
3440
  this._setTextureParameterInteger(target, this._gl.TEXTURE_MIN_FILTER, filters.min);
3444
3441
  if (generateMipMaps) {
@@ -4079,6 +4076,7 @@ export class ThinEngine {
4079
4076
  */
4080
4077
  dispose() {
4081
4078
  var _a;
4079
+ this._isDisposed = true;
4082
4080
  this.stopRenderLoop();
4083
4081
  // Clear observables
4084
4082
  if (this.onBeforeTextureInitObservable) {