@babylonjs/core 6.14.0 → 6.14.2

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 (38) hide show
  1. package/Debug/physicsViewer.js +4 -0
  2. package/Debug/physicsViewer.js.map +1 -1
  3. package/Engines/Processors/shaderProcessor.d.ts +2 -1
  4. package/Engines/Processors/shaderProcessor.js +1 -0
  5. package/Engines/Processors/shaderProcessor.js.map +1 -1
  6. package/Engines/engine.d.ts +1 -0
  7. package/Engines/engine.js +12 -0
  8. package/Engines/engine.js.map +1 -1
  9. package/Engines/nativeEngine.js +12 -11
  10. package/Engines/nativeEngine.js.map +1 -1
  11. package/Engines/thinEngine.d.ts +1 -0
  12. package/Engines/thinEngine.js +24 -6
  13. package/Engines/thinEngine.js.map +1 -1
  14. package/Inputs/scene.inputManager.js +4 -4
  15. package/Inputs/scene.inputManager.js.map +1 -1
  16. package/Materials/PBR/pbrBaseMaterial.js +3 -1
  17. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  18. package/Materials/effectRenderer.d.ts +2 -0
  19. package/Materials/effectRenderer.js +4 -2
  20. package/Materials/effectRenderer.js.map +1 -1
  21. package/Materials/materialPluginBase.d.ts +7 -2
  22. package/Materials/materialPluginBase.js +11 -2
  23. package/Materials/materialPluginBase.js.map +1 -1
  24. package/Materials/materialPluginEvent.d.ts +1 -0
  25. package/Materials/materialPluginEvent.js.map +1 -1
  26. package/Materials/materialPluginManager.d.ts +1 -1
  27. package/Materials/materialPluginManager.js +34 -6
  28. package/Materials/materialPluginManager.js.map +1 -1
  29. package/Materials/meshDebugPluginMaterial.js +6 -6
  30. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  31. package/Materials/standardMaterial.js +3 -1
  32. package/Materials/standardMaterial.js.map +1 -1
  33. package/Maths/math.color.d.ts +3 -3
  34. package/Maths/math.color.js +3 -3
  35. package/Maths/math.color.js.map +1 -1
  36. package/Misc/customAnimationFrameRequester.d.ts +4 -0
  37. package/Misc/customAnimationFrameRequester.js.map +1 -1
  38. package/package.json +1 -1
@@ -614,6 +614,7 @@ export declare class ThinEngine {
614
614
  * @param renderFunction defines the function to be removed. If not provided all functions will be removed.
615
615
  */
616
616
  stopRenderLoop(renderFunction?: () => void): void;
617
+ protected _cancelFrame(): void;
617
618
  /** @internal */
618
619
  _renderLoop(): void;
619
620
  /**
@@ -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@6.14.0";
37
+ return "babylonjs@6.14.2";
38
38
  }
39
39
  /**
40
40
  * Returns the current version of the framework
41
41
  */
42
42
  static get Version() {
43
- return "6.14.0";
43
+ return "6.14.2";
44
44
  }
45
45
  /**
46
46
  * Returns a string describing the current engine
@@ -1092,11 +1092,32 @@ export class ThinEngine {
1092
1092
  stopRenderLoop(renderFunction) {
1093
1093
  if (!renderFunction) {
1094
1094
  this._activeRenderLoops.length = 0;
1095
+ this._cancelFrame();
1095
1096
  return;
1096
1097
  }
1097
1098
  const index = this._activeRenderLoops.indexOf(renderFunction);
1098
1099
  if (index >= 0) {
1099
1100
  this._activeRenderLoops.splice(index, 1);
1101
+ if (this._activeRenderLoops.length == 0) {
1102
+ this._cancelFrame();
1103
+ }
1104
+ }
1105
+ }
1106
+ _cancelFrame() {
1107
+ if (this._renderingQueueLaunched && this._frameHandler) {
1108
+ this._renderingQueueLaunched = false;
1109
+ if (!IsWindowObjectExist()) {
1110
+ if (typeof cancelAnimationFrame === "function") {
1111
+ return cancelAnimationFrame(this._frameHandler);
1112
+ }
1113
+ }
1114
+ else {
1115
+ const { cancelAnimationFrame } = this.getHostWindow() || window;
1116
+ if (typeof cancelAnimationFrame === "function") {
1117
+ return cancelAnimationFrame(this._frameHandler);
1118
+ }
1119
+ }
1120
+ return clearTimeout(this._frameHandler);
1100
1121
  }
1101
1122
  }
1102
1123
  /** @internal */
@@ -4712,10 +4733,7 @@ export class ThinEngine {
4712
4733
  }
4713
4734
  }
4714
4735
  else {
4715
- const { requestPostAnimationFrame, requestAnimationFrame } = requester || window;
4716
- if (typeof requestPostAnimationFrame === "function") {
4717
- return requestPostAnimationFrame(func);
4718
- }
4736
+ const { requestAnimationFrame } = requester || window;
4719
4737
  if (typeof requestAnimationFrame === "function") {
4720
4738
  return requestAnimationFrame(func);
4721
4739
  }