@babylonjs/core 5.23.0 → 5.24.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.
Files changed (305) hide show
  1. package/Actions/abstractActionManager.d.ts +6 -6
  2. package/Actions/abstractActionManager.js +1 -1
  3. package/Actions/abstractActionManager.js.map +1 -1
  4. package/Actions/actionManager.d.ts +5 -5
  5. package/Actions/actionManager.js +5 -5
  6. package/Actions/actionManager.js.map +1 -1
  7. package/Animations/animationGroup.d.ts +3 -3
  8. package/Animations/animationGroup.js +3 -3
  9. package/Animations/animationGroup.js.map +1 -1
  10. package/Audio/audioSceneComponent.d.ts +1 -1
  11. package/Audio/audioSceneComponent.js.map +1 -1
  12. package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
  13. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  14. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  15. package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
  16. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  17. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  18. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  19. package/Behaviors/Cameras/framingBehavior.js +1 -1
  20. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  21. package/Bones/bone.d.ts +1 -1
  22. package/Bones/bone.js +1 -1
  23. package/Bones/bone.js.map +1 -1
  24. package/Bones/skeleton.d.ts +2 -2
  25. package/Bones/skeleton.js +2 -2
  26. package/Bones/skeleton.js.map +1 -1
  27. package/Cameras/arcRotateCamera.d.ts +1 -1
  28. package/Cameras/arcRotateCamera.js +1 -1
  29. package/Cameras/arcRotateCamera.js.map +1 -1
  30. package/Cameras/camera.d.ts +2 -2
  31. package/Cameras/camera.js +2 -2
  32. package/Cameras/camera.js.map +1 -1
  33. package/Cameras/freeCamera.d.ts +1 -1
  34. package/Cameras/freeCamera.js +1 -1
  35. package/Cameras/freeCamera.js.map +1 -1
  36. package/Cameras/gamepadCamera.d.ts +1 -1
  37. package/Cameras/gamepadCamera.js +1 -1
  38. package/Cameras/gamepadCamera.js.map +1 -1
  39. package/Cameras/targetCamera.d.ts +1 -1
  40. package/Cameras/targetCamera.js +1 -1
  41. package/Cameras/targetCamera.js.map +1 -1
  42. package/Cameras/touchCamera.d.ts +1 -1
  43. package/Cameras/touchCamera.js +1 -1
  44. package/Cameras/touchCamera.js.map +1 -1
  45. package/Cameras/universalCamera.d.ts +1 -1
  46. package/Cameras/universalCamera.js +1 -1
  47. package/Cameras/universalCamera.js.map +1 -1
  48. package/Cameras/virtualJoysticksCamera.d.ts +1 -1
  49. package/Cameras/virtualJoysticksCamera.js +1 -1
  50. package/Cameras/virtualJoysticksCamera.js.map +1 -1
  51. package/Culling/boundingBox.d.ts +2 -2
  52. package/Culling/boundingBox.js +2 -2
  53. package/Culling/boundingBox.js.map +1 -1
  54. package/Culling/ray.d.ts +1 -1
  55. package/Culling/ray.js +1 -1
  56. package/Culling/ray.js.map +1 -1
  57. package/Debug/debugLayer.d.ts +1 -1
  58. package/Debug/debugLayer.js +1 -1
  59. package/Debug/debugLayer.js.map +1 -1
  60. package/Engines/Extensions/engine.multiRender.js +8 -10
  61. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  62. package/Engines/Extensions/engine.query.d.ts +2 -2
  63. package/Engines/Extensions/engine.query.js.map +1 -1
  64. package/Engines/ICanvas.d.ts +11 -0
  65. package/Engines/ICanvas.js.map +1 -1
  66. package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
  67. package/Engines/WebGL/webGLPipelineContext.js +99 -311
  68. package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
  69. package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
  70. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  71. package/Engines/engine.d.ts +2 -2
  72. package/Engines/engine.js +2 -2
  73. package/Engines/engine.js.map +1 -1
  74. package/Engines/nativeEngine.d.ts +2 -2
  75. package/Engines/nativeEngine.js +2 -2
  76. package/Engines/nativeEngine.js.map +1 -1
  77. package/Engines/renderTargetWrapper.d.ts +1 -0
  78. package/Engines/renderTargetWrapper.js +5 -2
  79. package/Engines/renderTargetWrapper.js.map +1 -1
  80. package/Engines/thinEngine.d.ts +6 -5
  81. package/Engines/thinEngine.js +11 -7
  82. package/Engines/thinEngine.js.map +1 -1
  83. package/Engines/webgpuEngine.js +4 -1
  84. package/Engines/webgpuEngine.js.map +1 -1
  85. package/Events/clipboardEvents.d.ts +1 -1
  86. package/Events/clipboardEvents.js +1 -1
  87. package/Events/clipboardEvents.js.map +1 -1
  88. package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
  89. package/Gamepads/Controllers/windowsMotionController.js +1 -1
  90. package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
  91. package/Gizmos/boundingBoxGizmo.d.ts +4 -0
  92. package/Gizmos/boundingBoxGizmo.js +6 -0
  93. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  94. package/Layers/effectLayer.d.ts +3 -3
  95. package/Layers/effectLayer.js +1 -1
  96. package/Layers/effectLayer.js.map +1 -1
  97. package/Layers/glowLayer.d.ts +3 -3
  98. package/Layers/glowLayer.js +2 -2
  99. package/Layers/glowLayer.js.map +1 -1
  100. package/Layers/highlightLayer.d.ts +3 -3
  101. package/Layers/highlightLayer.js +2 -2
  102. package/Layers/highlightLayer.js.map +1 -1
  103. package/Lights/directionalLight.d.ts +2 -2
  104. package/Lights/directionalLight.js +2 -2
  105. package/Lights/directionalLight.js.map +1 -1
  106. package/Lights/hemisphericLight.d.ts +3 -3
  107. package/Lights/hemisphericLight.js +3 -3
  108. package/Lights/hemisphericLight.js.map +1 -1
  109. package/Lights/light.d.ts +2 -2
  110. package/Lights/light.js +2 -2
  111. package/Lights/light.js.map +1 -1
  112. package/Lights/lightConstants.d.ts +1 -1
  113. package/Lights/lightConstants.js +1 -1
  114. package/Lights/lightConstants.js.map +1 -1
  115. package/Loading/sceneLoader.d.ts +1 -1
  116. package/Loading/sceneLoader.js.map +1 -1
  117. package/Materials/Background/backgroundMaterial.js +1 -1
  118. package/Materials/Background/backgroundMaterial.js.map +1 -1
  119. package/Materials/Node/nodeMaterial.d.ts +1 -1
  120. package/Materials/Node/nodeMaterial.js +2 -2
  121. package/Materials/Node/nodeMaterial.js.map +1 -1
  122. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  123. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  124. package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
  125. package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
  126. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  127. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
  128. package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
  129. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  130. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
  131. package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
  132. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  133. package/Materials/Textures/colorGradingTexture.d.ts +1 -1
  134. package/Materials/Textures/colorGradingTexture.js +1 -1
  135. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  136. package/Materials/Textures/cubeTexture.d.ts +2 -2
  137. package/Materials/Textures/cubeTexture.js +2 -2
  138. package/Materials/Textures/cubeTexture.js.map +1 -1
  139. package/Materials/Textures/rawCubeTexture.d.ts +1 -1
  140. package/Materials/Textures/rawCubeTexture.js +1 -1
  141. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  142. package/Materials/Textures/renderTargetTexture.d.ts +3 -5
  143. package/Materials/Textures/renderTargetTexture.js +19 -19
  144. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  145. package/Materials/colorCurves.d.ts +3 -3
  146. package/Materials/colorCurves.js +3 -3
  147. package/Materials/colorCurves.js.map +1 -1
  148. package/Materials/effect.d.ts +27 -27
  149. package/Materials/effect.js +22 -288
  150. package/Materials/effect.js.map +1 -1
  151. package/Materials/fresnelParameters.d.ts +1 -1
  152. package/Materials/fresnelParameters.js +1 -1
  153. package/Materials/fresnelParameters.js.map +1 -1
  154. package/Materials/imageProcessingConfiguration.d.ts +4 -4
  155. package/Materials/imageProcessingConfiguration.js +4 -4
  156. package/Materials/imageProcessingConfiguration.js.map +1 -1
  157. package/Materials/shaderMaterial.d.ts +25 -25
  158. package/Materials/shaderMaterial.js +25 -25
  159. package/Materials/shaderMaterial.js.map +1 -1
  160. package/Materials/standardMaterial.js +1 -1
  161. package/Materials/standardMaterial.js.map +1 -1
  162. package/Maths/index.d.ts +1 -0
  163. package/Maths/index.js +1 -0
  164. package/Maths/index.js.map +1 -1
  165. package/Maths/math.functions.d.ts +2 -2
  166. package/Maths/math.functions.js +2 -2
  167. package/Maths/math.functions.js.map +1 -1
  168. package/Maths/math.polar.d.ts +77 -0
  169. package/Maths/math.polar.js +114 -0
  170. package/Maths/math.polar.js.map +1 -0
  171. package/Maths/math.scalar.d.ts +2 -2
  172. package/Maths/math.scalar.js +2 -2
  173. package/Maths/math.scalar.js.map +1 -1
  174. package/Maths/math.vector.d.ts +13 -12
  175. package/Maths/math.vector.js +13 -12
  176. package/Maths/math.vector.js.map +1 -1
  177. package/Meshes/abstractMesh.d.ts +1 -1
  178. package/Meshes/abstractMesh.js +9 -4
  179. package/Meshes/abstractMesh.js.map +1 -1
  180. package/Meshes/geometry.d.ts +3 -3
  181. package/Meshes/geometry.js +3 -3
  182. package/Meshes/geometry.js.map +1 -1
  183. package/Meshes/instancedMesh.d.ts +1 -1
  184. package/Meshes/instancedMesh.js +1 -1
  185. package/Meshes/instancedMesh.js.map +1 -1
  186. package/Meshes/mesh.d.ts +3 -3
  187. package/Meshes/mesh.js +7 -3
  188. package/Meshes/mesh.js.map +1 -1
  189. package/Meshes/subMesh.d.ts +1 -1
  190. package/Meshes/subMesh.js +1 -1
  191. package/Meshes/subMesh.js.map +1 -1
  192. package/Meshes/thinInstanceMesh.d.ts +1 -1
  193. package/Meshes/thinInstanceMesh.js.map +1 -1
  194. package/Meshes/transformNode.js +3 -0
  195. package/Meshes/transformNode.js.map +1 -1
  196. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
  197. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
  198. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  199. package/Misc/HighDynamicRange/hdr.d.ts +3 -3
  200. package/Misc/HighDynamicRange/hdr.js +3 -3
  201. package/Misc/HighDynamicRange/hdr.js.map +1 -1
  202. package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
  203. package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
  204. package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
  205. package/Misc/arrayTools.d.ts +13 -12
  206. package/Misc/arrayTools.js +70 -39
  207. package/Misc/arrayTools.js.map +1 -1
  208. package/Misc/assetsManager.d.ts +3 -3
  209. package/Misc/assetsManager.js +3 -3
  210. package/Misc/assetsManager.js.map +1 -1
  211. package/Misc/basis.js +1 -1
  212. package/Misc/basis.js.map +1 -1
  213. package/Misc/environmentTextureTools.d.ts +4 -4
  214. package/Misc/environmentTextureTools.js +5 -5
  215. package/Misc/environmentTextureTools.js.map +1 -1
  216. package/Misc/fileTools.d.ts +3 -3
  217. package/Misc/fileTools.js +19 -12
  218. package/Misc/fileTools.js.map +1 -1
  219. package/Misc/observable.d.ts +1 -1
  220. package/Misc/observable.js +1 -1
  221. package/Misc/observable.js.map +1 -1
  222. package/Misc/performanceMonitor.d.ts +3 -3
  223. package/Misc/performanceMonitor.js +3 -3
  224. package/Misc/performanceMonitor.js.map +1 -1
  225. package/Misc/rgbdTextureTools.d.ts +1 -1
  226. package/Misc/rgbdTextureTools.js +1 -1
  227. package/Misc/rgbdTextureTools.js.map +1 -1
  228. package/Misc/sceneOptimizer.d.ts +7 -7
  229. package/Misc/sceneOptimizer.js +7 -7
  230. package/Misc/sceneOptimizer.js.map +1 -1
  231. package/Misc/stringDictionary.d.ts +6 -6
  232. package/Misc/stringDictionary.js +6 -6
  233. package/Misc/stringDictionary.js.map +1 -1
  234. package/Misc/textureTools.d.ts +4 -4
  235. package/Misc/textureTools.js +4 -4
  236. package/Misc/textureTools.js.map +1 -1
  237. package/Misc/tools.d.ts +6 -6
  238. package/Misc/tools.js +6 -6
  239. package/Misc/tools.js.map +1 -1
  240. package/Misc/videoRecorder.d.ts +1 -1
  241. package/Misc/videoRecorder.js +1 -1
  242. package/Misc/videoRecorder.js.map +1 -1
  243. package/Particles/IParticleSystem.d.ts +1 -1
  244. package/Particles/IParticleSystem.js.map +1 -1
  245. package/Particles/gpuParticleSystem.d.ts +1 -1
  246. package/Particles/gpuParticleSystem.js +1 -1
  247. package/Particles/gpuParticleSystem.js.map +1 -1
  248. package/Particles/particleSystem.d.ts +1 -1
  249. package/Particles/particleSystem.js +1 -1
  250. package/Particles/particleSystem.js.map +1 -1
  251. package/Particles/solidParticleSystem.d.ts +4 -0
  252. package/Particles/solidParticleSystem.js +25 -3
  253. package/Particles/solidParticleSystem.js.map +1 -1
  254. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
  255. package/Physics/Plugins/ammoJSPlugin.js +1 -1
  256. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  257. package/Physics/Plugins/oimoJSPlugin.js +1 -1
  258. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  259. package/Physics/physicsEngineComponent.d.ts +1 -1
  260. package/Physics/physicsEngineComponent.js +1 -1
  261. package/Physics/physicsEngineComponent.js.map +1 -1
  262. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  263. package/PostProcesses/blurPostProcess.d.ts +3 -3
  264. package/PostProcesses/blurPostProcess.js +3 -3
  265. package/PostProcesses/blurPostProcess.js.map +1 -1
  266. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
  267. package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
  268. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  269. package/Rendering/depthPeelingRenderer.d.ts +1 -0
  270. package/Rendering/depthPeelingRenderer.js +32 -5
  271. package/Rendering/depthPeelingRenderer.js.map +1 -1
  272. package/Rendering/edgesRenderer.d.ts +2 -2
  273. package/Rendering/edgesRenderer.js +1 -1
  274. package/Rendering/edgesRenderer.js.map +1 -1
  275. package/Rendering/geometryBufferRenderer.d.ts +4 -2
  276. package/Rendering/geometryBufferRenderer.js +5 -3
  277. package/Rendering/geometryBufferRenderer.js.map +1 -1
  278. package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
  279. package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
  280. package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
  281. package/Rendering/prePassRenderer.d.ts +11 -3
  282. package/Rendering/prePassRenderer.js +18 -3
  283. package/Rendering/prePassRenderer.js.map +1 -1
  284. package/Rendering/subSurfaceConfiguration.d.ts +2 -2
  285. package/Rendering/subSurfaceConfiguration.js +2 -2
  286. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  287. package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
  288. package/XR/features/WebXRControllerTeleportation.js +24 -19
  289. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  290. package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
  291. package/XR/motionController/webXRAbstractMotionController.js +2 -2
  292. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  293. package/XR/motionController/webXRControllerComponent.d.ts +1 -1
  294. package/XR/motionController/webXRControllerComponent.js +1 -1
  295. package/XR/motionController/webXRControllerComponent.js.map +1 -1
  296. package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
  297. package/XR/motionController/webXRMotionControllerManager.js +3 -3
  298. package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
  299. package/node.d.ts +4 -4
  300. package/node.js +3 -3
  301. package/node.js.map +1 -1
  302. package/package.json +1 -1
  303. package/scene.d.ts +61 -61
  304. package/scene.js +58 -46
  305. package/scene.js.map +1 -1
package/scene.js CHANGED
@@ -25,7 +25,7 @@ import { UniqueIdGenerator } from "./Misc/uniqueIdGenerator.js";
25
25
  import { ReadFile, RequestFile, LoadFile } from "./Misc/fileTools.js";
26
26
  import { LightConstants } from "./Lights/lightConstants.js";
27
27
  import { ComputePressureObserverWrapper } from "./Misc/computePressure.js";
28
- import { ArrayTools } from "./Misc/arrayTools.js";
28
+ import { _ObserveArray } from "./Misc/arrayTools.js";
29
29
  /**
30
30
  * Define how the scene should favor performance over ease of use
31
31
  */
@@ -401,7 +401,7 @@ export class Scene extends AbstractScene {
401
401
  // Lights
402
402
  this._shadowsEnabled = true;
403
403
  this._lightsEnabled = true;
404
- this._activeCameras = ArrayTools.MakeObservableArray(this.onActiveCamerasChanged, []);
404
+ this._unObserveActiveCameras = null;
405
405
  // Textures
406
406
  this._texturesEnabled = true;
407
407
  // Physics
@@ -680,6 +680,7 @@ export class Scene extends AbstractScene {
680
680
  * Note: Compute pressure is an experimental API.
681
681
  */
682
682
  this.onComputePressureChanged = new Observable();
683
+ this.activeCameras = new Array();
683
684
  const fullOptions = {
684
685
  useGeometryUniqueIdsMap: true,
685
686
  useMaterialMeshMap: true,
@@ -927,7 +928,7 @@ export class Scene extends AbstractScene {
927
928
  * @param effect The effect to be bound
928
929
  * @param variableName name of the shader variable that will hold the eye position
929
930
  * @param isVector3 true to indicates that variableName is a Vector3 and not a Vector4
930
- * @return the computed eye position
931
+ * @returns the computed eye position
931
932
  */
932
933
  bindEyePosition(effect, variableName = "vEyePosition", isVector3 = false) {
933
934
  const eyePosition = this._forcedViewPosition
@@ -1067,7 +1068,16 @@ export class Scene extends AbstractScene {
1067
1068
  return this._activeCameras;
1068
1069
  }
1069
1070
  set activeCameras(cameras) {
1070
- this._activeCameras = ArrayTools.MakeObservableArray(this.onActiveCamerasChanged, cameras);
1071
+ if (this._unObserveActiveCameras) {
1072
+ this._unObserveActiveCameras();
1073
+ this._unObserveActiveCameras = null;
1074
+ }
1075
+ if (cameras) {
1076
+ this._unObserveActiveCameras = _ObserveArray(cameras, () => {
1077
+ this.onActiveCamerasChanged.notifyObservers(this);
1078
+ });
1079
+ }
1080
+ this._activeCameras = cameras;
1071
1081
  }
1072
1082
  /** Gets or sets the current active camera */
1073
1083
  get activeCamera() {
@@ -1419,7 +1429,7 @@ export class Scene extends AbstractScene {
1419
1429
  * This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
1420
1430
  * Delay loaded resources are not taking in account
1421
1431
  * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: true)
1422
- * @return true if all required resources are ready
1432
+ * @returns true if all required resources are ready
1423
1433
  */
1424
1434
  isReady(checkRenderTargets = true) {
1425
1435
  if (this._isDisposed) {
@@ -2229,7 +2239,7 @@ export class Scene extends AbstractScene {
2229
2239
  /**
2230
2240
  * sets the active camera of the scene using its Id
2231
2241
  * @param id defines the camera's Id
2232
- * @return the new active camera or null if none found.
2242
+ * @returns the new active camera or null if none found.
2233
2243
  */
2234
2244
  setActiveCameraById(id) {
2235
2245
  const camera = this.getCameraById(id);
@@ -2255,7 +2265,7 @@ export class Scene extends AbstractScene {
2255
2265
  /**
2256
2266
  * get an animation group using its name
2257
2267
  * @param name defines the material's name
2258
- * @return the animation group or null if none found.
2268
+ * @returns the animation group or null if none found.
2259
2269
  */
2260
2270
  getAnimationGroupByName(name) {
2261
2271
  for (let index = 0; index < this.animationGroups.length; index++) {
@@ -2268,7 +2278,7 @@ export class Scene extends AbstractScene {
2268
2278
  /**
2269
2279
  * Get a material using its unique id
2270
2280
  * @param uniqueId defines the material's unique id
2271
- * @return the material or null if none found.
2281
+ * @returns the material or null if none found.
2272
2282
  */
2273
2283
  getMaterialByUniqueID(uniqueId) {
2274
2284
  for (let index = 0; index < this.materials.length; index++) {
@@ -2281,7 +2291,7 @@ export class Scene extends AbstractScene {
2281
2291
  /**
2282
2292
  * get a material using its id
2283
2293
  * @param id defines the material's Id
2284
- * @return the material or null if none found.
2294
+ * @returns the material or null if none found.
2285
2295
  */
2286
2296
  getMaterialById(id) {
2287
2297
  for (let index = 0; index < this.materials.length; index++) {
@@ -2295,7 +2305,7 @@ export class Scene extends AbstractScene {
2295
2305
  * Gets a the last added material using a given id
2296
2306
  * @param id defines the material's Id
2297
2307
  * @param allowMultiMaterials determines whether multimaterials should be considered
2298
- * @return the last material with the given id or null if none found.
2308
+ * @returns the last material with the given id or null if none found.
2299
2309
  */
2300
2310
  getLastMaterialById(id, allowMultiMaterials = false) {
2301
2311
  for (let index = this.materials.length - 1; index >= 0; index--) {
@@ -2315,7 +2325,7 @@ export class Scene extends AbstractScene {
2315
2325
  /**
2316
2326
  * Gets a material using its name
2317
2327
  * @param name defines the material's name
2318
- * @return the material or null if none found.
2328
+ * @returns the material or null if none found.
2319
2329
  */
2320
2330
  getMaterialByName(name) {
2321
2331
  for (let index = 0; index < this.materials.length; index++) {
@@ -2328,7 +2338,7 @@ export class Scene extends AbstractScene {
2328
2338
  /**
2329
2339
  * Get a texture using its unique id
2330
2340
  * @param uniqueId defines the texture's unique id
2331
- * @return the texture or null if none found.
2341
+ * @returns the texture or null if none found.
2332
2342
  */
2333
2343
  getTextureByUniqueId(uniqueId) {
2334
2344
  for (let index = 0; index < this.textures.length; index++) {
@@ -2341,7 +2351,7 @@ export class Scene extends AbstractScene {
2341
2351
  /**
2342
2352
  * Gets a texture using its name
2343
2353
  * @param name defines the texture's name
2344
- * @return the texture or null if none found.
2354
+ * @returns the texture or null if none found.
2345
2355
  */
2346
2356
  getTextureByName(name) {
2347
2357
  for (let index = 0; index < this.textures.length; index++) {
@@ -2380,7 +2390,7 @@ export class Scene extends AbstractScene {
2380
2390
  /**
2381
2391
  * Gets a camera using its name
2382
2392
  * @param name defines the camera's name
2383
- * @return the camera or null if none found.
2393
+ * @returns the camera or null if none found.
2384
2394
  */
2385
2395
  getCameraByName(name) {
2386
2396
  for (let index = 0; index < this.cameras.length; index++) {
@@ -2393,7 +2403,7 @@ export class Scene extends AbstractScene {
2393
2403
  /**
2394
2404
  * Gets a bone using its Id
2395
2405
  * @param id defines the bone's Id
2396
- * @return the bone or null if not found
2406
+ * @returns the bone or null if not found
2397
2407
  */
2398
2408
  getBoneById(id) {
2399
2409
  for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
@@ -2409,7 +2419,7 @@ export class Scene extends AbstractScene {
2409
2419
  /**
2410
2420
  * Gets a bone using its id
2411
2421
  * @param name defines the bone's name
2412
- * @return the bone or null if not found
2422
+ * @returns the bone or null if not found
2413
2423
  */
2414
2424
  getBoneByName(name) {
2415
2425
  for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
@@ -2425,7 +2435,7 @@ export class Scene extends AbstractScene {
2425
2435
  /**
2426
2436
  * Gets a light node using its name
2427
2437
  * @param name defines the the light's name
2428
- * @return the light or null if none found.
2438
+ * @returns the light or null if none found.
2429
2439
  */
2430
2440
  getLightByName(name) {
2431
2441
  for (let index = 0; index < this.lights.length; index++) {
@@ -2438,7 +2448,7 @@ export class Scene extends AbstractScene {
2438
2448
  /**
2439
2449
  * Gets a light node using its Id
2440
2450
  * @param id defines the light's Id
2441
- * @return the light or null if none found.
2451
+ * @returns the light or null if none found.
2442
2452
  */
2443
2453
  getLightById(id) {
2444
2454
  for (let index = 0; index < this.lights.length; index++) {
@@ -2451,7 +2461,7 @@ export class Scene extends AbstractScene {
2451
2461
  /**
2452
2462
  * Gets a light node using its scene-generated unique Id
2453
2463
  * @param uniqueId defines the light's unique Id
2454
- * @return the light or null if none found.
2464
+ * @returns the light or null if none found.
2455
2465
  */
2456
2466
  getLightByUniqueId(uniqueId) {
2457
2467
  for (let index = 0; index < this.lights.length; index++) {
@@ -2464,7 +2474,7 @@ export class Scene extends AbstractScene {
2464
2474
  /**
2465
2475
  * Gets a particle system by Id
2466
2476
  * @param id defines the particle system Id
2467
- * @return the corresponding system or null if none found
2477
+ * @returns the corresponding system or null if none found
2468
2478
  */
2469
2479
  getParticleSystemById(id) {
2470
2480
  for (let index = 0; index < this.particleSystems.length; index++) {
@@ -2477,7 +2487,7 @@ export class Scene extends AbstractScene {
2477
2487
  /**
2478
2488
  * Gets a geometry using its Id
2479
2489
  * @param id defines the geometry's Id
2480
- * @return the geometry or null if none found.
2490
+ * @returns the geometry or null if none found.
2481
2491
  */
2482
2492
  getGeometryById(id) {
2483
2493
  for (let index = 0; index < this.geometries.length; index++) {
@@ -2507,7 +2517,7 @@ export class Scene extends AbstractScene {
2507
2517
  * Add a new geometry to this scene
2508
2518
  * @param geometry defines the geometry to be added to the scene.
2509
2519
  * @param force defines if the geometry must be pushed even if a geometry with this id already exists
2510
- * @return a boolean defining if the geometry was added or not
2520
+ * @returns a boolean defining if the geometry was added or not
2511
2521
  */
2512
2522
  pushGeometry(geometry, force) {
2513
2523
  if (!force && this._getGeometryByUniqueId(geometry.uniqueId)) {
@@ -2520,7 +2530,7 @@ export class Scene extends AbstractScene {
2520
2530
  /**
2521
2531
  * Removes an existing geometry
2522
2532
  * @param geometry defines the geometry to be removed from the scene
2523
- * @return a boolean defining if the geometry was removed or not
2533
+ * @returns a boolean defining if the geometry was removed or not
2524
2534
  */
2525
2535
  removeGeometry(geometry) {
2526
2536
  let index;
@@ -2562,7 +2572,7 @@ export class Scene extends AbstractScene {
2562
2572
  /**
2563
2573
  * Gets the first added mesh found of a given Id
2564
2574
  * @param id defines the Id to search for
2565
- * @return the mesh found or null if not found at all
2575
+ * @returns the mesh found or null if not found at all
2566
2576
  */
2567
2577
  getMeshById(id) {
2568
2578
  for (let index = 0; index < this.meshes.length; index++) {
@@ -2585,7 +2595,7 @@ export class Scene extends AbstractScene {
2585
2595
  /**
2586
2596
  * Gets the first added transform node found of a given Id
2587
2597
  * @param id defines the Id to search for
2588
- * @return the found transform node or null if not found at all.
2598
+ * @returns the found transform node or null if not found at all.
2589
2599
  */
2590
2600
  getTransformNodeById(id) {
2591
2601
  for (let index = 0; index < this.transformNodes.length; index++) {
@@ -2598,7 +2608,7 @@ export class Scene extends AbstractScene {
2598
2608
  /**
2599
2609
  * Gets a transform node with its auto-generated unique Id
2600
2610
  * @param uniqueId defines the unique Id to search for
2601
- * @return the found transform node or null if not found at all.
2611
+ * @returns the found transform node or null if not found at all.
2602
2612
  */
2603
2613
  getTransformNodeByUniqueId(uniqueId) {
2604
2614
  for (let index = 0; index < this.transformNodes.length; index++) {
@@ -2621,7 +2631,7 @@ export class Scene extends AbstractScene {
2621
2631
  /**
2622
2632
  * Gets a mesh with its auto-generated unique Id
2623
2633
  * @param uniqueId defines the unique Id to search for
2624
- * @return the found mesh or null if not found at all.
2634
+ * @returns the found mesh or null if not found at all.
2625
2635
  */
2626
2636
  getMeshByUniqueId(uniqueId) {
2627
2637
  for (let index = 0; index < this.meshes.length; index++) {
@@ -2634,7 +2644,7 @@ export class Scene extends AbstractScene {
2634
2644
  /**
2635
2645
  * Gets a the last added mesh using a given Id
2636
2646
  * @param id defines the Id to search for
2637
- * @return the found mesh or null if not found at all.
2647
+ * @returns the found mesh or null if not found at all.
2638
2648
  */
2639
2649
  getLastMeshById(id) {
2640
2650
  for (let index = this.meshes.length - 1; index >= 0; index--) {
@@ -2647,7 +2657,7 @@ export class Scene extends AbstractScene {
2647
2657
  /**
2648
2658
  * Gets a the last added node (Mesh, Camera, Light) using a given Id
2649
2659
  * @param id defines the Id to search for
2650
- * @return the found node or null if not found at all
2660
+ * @returns the found node or null if not found at all
2651
2661
  */
2652
2662
  getLastEntryById(id) {
2653
2663
  let index;
@@ -2676,7 +2686,7 @@ export class Scene extends AbstractScene {
2676
2686
  /**
2677
2687
  * Gets a node (Mesh, Camera, Light) using a given Id
2678
2688
  * @param id defines the Id to search for
2679
- * @return the found node or null if not found at all
2689
+ * @returns the found node or null if not found at all
2680
2690
  */
2681
2691
  getNodeById(id) {
2682
2692
  const mesh = this.getMeshById(id);
@@ -2704,7 +2714,7 @@ export class Scene extends AbstractScene {
2704
2714
  /**
2705
2715
  * Gets a node (Mesh, Camera, Light) using a given name
2706
2716
  * @param name defines the name to search for
2707
- * @return the found node or null if not found at all.
2717
+ * @returns the found node or null if not found at all.
2708
2718
  */
2709
2719
  getNodeByName(name) {
2710
2720
  const mesh = this.getMeshByName(name);
@@ -2732,7 +2742,7 @@ export class Scene extends AbstractScene {
2732
2742
  /**
2733
2743
  * Gets a mesh using a given name
2734
2744
  * @param name defines the name to search for
2735
- * @return the found mesh or null if not found at all.
2745
+ * @returns the found mesh or null if not found at all.
2736
2746
  */
2737
2747
  getMeshByName(name) {
2738
2748
  for (let index = 0; index < this.meshes.length; index++) {
@@ -2745,7 +2755,7 @@ export class Scene extends AbstractScene {
2745
2755
  /**
2746
2756
  * Gets a transform node using a given name
2747
2757
  * @param name defines the name to search for
2748
- * @return the found transform node or null if not found at all.
2758
+ * @returns the found transform node or null if not found at all.
2749
2759
  */
2750
2760
  getTransformNodeByName(name) {
2751
2761
  for (let index = 0; index < this.transformNodes.length; index++) {
@@ -2758,7 +2768,7 @@ export class Scene extends AbstractScene {
2758
2768
  /**
2759
2769
  * Gets a skeleton using a given Id (if many are found, this function will pick the last one)
2760
2770
  * @param id defines the Id to search for
2761
- * @return the found skeleton or null if not found at all.
2771
+ * @returns the found skeleton or null if not found at all.
2762
2772
  */
2763
2773
  getLastSkeletonById(id) {
2764
2774
  for (let index = this.skeletons.length - 1; index >= 0; index--) {
@@ -2771,7 +2781,7 @@ export class Scene extends AbstractScene {
2771
2781
  /**
2772
2782
  * Gets a skeleton using a given auto generated unique id
2773
2783
  * @param uniqueId defines the unique id to search for
2774
- * @return the found skeleton or null if not found at all.
2784
+ * @returns the found skeleton or null if not found at all.
2775
2785
  */
2776
2786
  getSkeletonByUniqueId(uniqueId) {
2777
2787
  for (let index = 0; index < this.skeletons.length; index++) {
@@ -2784,7 +2794,7 @@ export class Scene extends AbstractScene {
2784
2794
  /**
2785
2795
  * Gets a skeleton using a given id (if many are found, this function will pick the first one)
2786
2796
  * @param id defines the id to search for
2787
- * @return the found skeleton or null if not found at all.
2797
+ * @returns the found skeleton or null if not found at all.
2788
2798
  */
2789
2799
  getSkeletonById(id) {
2790
2800
  for (let index = 0; index < this.skeletons.length; index++) {
@@ -2797,7 +2807,7 @@ export class Scene extends AbstractScene {
2797
2807
  /**
2798
2808
  * Gets a skeleton using a given name
2799
2809
  * @param name defines the name to search for
2800
- * @return the found skeleton or null if not found at all.
2810
+ * @returns the found skeleton or null if not found at all.
2801
2811
  */
2802
2812
  getSkeletonByName(name) {
2803
2813
  for (let index = 0; index < this.skeletons.length; index++) {
@@ -2810,7 +2820,7 @@ export class Scene extends AbstractScene {
2810
2820
  /**
2811
2821
  * Gets a morph target manager using a given id (if many are found, this function will pick the last one)
2812
2822
  * @param id defines the id to search for
2813
- * @return the found morph target manager or null if not found at all.
2823
+ * @returns the found morph target manager or null if not found at all.
2814
2824
  */
2815
2825
  getMorphTargetManagerById(id) {
2816
2826
  for (let index = 0; index < this.morphTargetManagers.length; index++) {
@@ -2823,7 +2833,7 @@ export class Scene extends AbstractScene {
2823
2833
  /**
2824
2834
  * Gets a morph target using a given id (if many are found, this function will pick the first one)
2825
2835
  * @param id defines the id to search for
2826
- * @return the found morph target or null if not found at all.
2836
+ * @returns the found morph target or null if not found at all.
2827
2837
  */
2828
2838
  getMorphTargetById(id) {
2829
2839
  for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
@@ -2840,7 +2850,7 @@ export class Scene extends AbstractScene {
2840
2850
  /**
2841
2851
  * Gets a morph target using a given name (if many are found, this function will pick the first one)
2842
2852
  * @param name defines the name to search for
2843
- * @return the found morph target or null if not found at all.
2853
+ * @returns the found morph target or null if not found at all.
2844
2854
  */
2845
2855
  getMorphTargetByName(name) {
2846
2856
  for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
@@ -2857,7 +2867,7 @@ export class Scene extends AbstractScene {
2857
2867
  /**
2858
2868
  * Gets a post process using a given name (if many are found, this function will pick the first one)
2859
2869
  * @param name defines the name to search for
2860
- * @return the found post process or null if not found at all.
2870
+ * @returns the found post process or null if not found at all.
2861
2871
  */
2862
2872
  getPostProcessByName(name) {
2863
2873
  for (let postProcessIndex = 0; postProcessIndex < this.postProcesses.length; ++postProcessIndex) {
@@ -2891,7 +2901,7 @@ export class Scene extends AbstractScene {
2891
2901
  * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.
2892
2902
  * @param key the unique key that identifies the data
2893
2903
  * @param data the data object to associate to the key for this Engine instance
2894
- * @return true if no such key were already present and the data was added successfully, false otherwise
2904
+ * @returns true if no such key were already present and the data was added successfully, false otherwise
2895
2905
  */
2896
2906
  addExternalData(key, data) {
2897
2907
  if (!this._externalData) {
@@ -2902,7 +2912,7 @@ export class Scene extends AbstractScene {
2902
2912
  /**
2903
2913
  * Get an externally attached data from its key
2904
2914
  * @param key the unique key that identifies the data
2905
- * @return the associated data, if present (can be null), or undefined if not present
2915
+ * @returns the associated data, if present (can be null), or undefined if not present
2906
2916
  */
2907
2917
  getExternalData(key) {
2908
2918
  if (!this._externalData) {
@@ -2914,7 +2924,7 @@ export class Scene extends AbstractScene {
2914
2924
  * Get an externally attached data from its key, create it using a factory if it's not already present
2915
2925
  * @param key the unique key that identifies the data
2916
2926
  * @param factory the factory that will be called to create the instance if and only if it doesn't exists
2917
- * @return the associated data, can be null if the factory returned null.
2927
+ * @returns the associated data, can be null if the factory returned null.
2918
2928
  */
2919
2929
  getOrAddExternalDataWithFactory(key, factory) {
2920
2930
  if (!this._externalData) {
@@ -2925,7 +2935,7 @@ export class Scene extends AbstractScene {
2925
2935
  /**
2926
2936
  * Remove an externally attached data from the Engine instance
2927
2937
  * @param key the unique key that identifies the data
2928
- * @return true if the data was successfully removed, false if it doesn't exist
2938
+ * @returns true if the data was successfully removed, false if it doesn't exist
2929
2939
  */
2930
2940
  removeExternalData(key) {
2931
2941
  return this._externalData.remove(key);
@@ -3752,6 +3762,7 @@ export class Scene extends AbstractScene {
3752
3762
  this.activeCamera._activeMeshes.dispose();
3753
3763
  this.activeCamera = null;
3754
3764
  }
3765
+ this.activeCameras = null;
3755
3766
  this._activeMeshes.dispose();
3756
3767
  this._renderingManager.dispose();
3757
3768
  this._processedMaterials.dispose();
@@ -3835,7 +3846,8 @@ export class Scene extends AbstractScene {
3835
3846
  this._disposeList(this.meshes, (item) => item.dispose(true));
3836
3847
  this._disposeList(this.transformNodes, (item) => item.dispose(true));
3837
3848
  // Release cameras
3838
- this._disposeList(this.cameras);
3849
+ const cameras = this.cameras;
3850
+ this._disposeList(cameras);
3839
3851
  // Release materials
3840
3852
  if (this._defaultMaterial) {
3841
3853
  this._defaultMaterial.dispose();