@babylonjs/core 5.22.1 → 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.
- package/Actions/abstractActionManager.d.ts +6 -6
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.d.ts +5 -5
- package/Actions/actionManager.js +5 -5
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.js +2 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +137 -139
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -7
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.d.ts +2 -1
- package/Audio/sound.js +21 -9
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/framingBehavior.js +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/bone.d.ts +1 -1
- package/Bones/bone.js +1 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js +11 -5
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -2
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Culling/boundingBox.d.ts +2 -2
- package/Culling/boundingBox.js +2 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +20 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -10
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +2 -2
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +11 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
- package/Engines/WebGL/webGLPipelineContext.js +99 -311
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +2 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -5
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +4 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/clipboardEvents.d.ts +1 -1
- package/Events/clipboardEvents.js +1 -1
- package/Events/clipboardEvents.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +11 -4
- package/Events/deviceInputEvents.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
- package/Gamepads/Controllers/windowsMotionController.js +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +4 -0
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +3 -3
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/directionalLight.d.ts +2 -2
- package/Lights/directionalLight.js +2 -2
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.d.ts +3 -3
- package/Lights/hemisphericLight.js +3 -3
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.d.ts +2 -2
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +1 -1
- package/Lights/lightConstants.js +1 -1
- package/Lights/lightConstants.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +4 -0
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +5 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +1 -1
- package/Materials/Textures/colorGradingTexture.js +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +2 -2
- package/Materials/Textures/cubeTexture.js +2 -2
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +3 -5
- package/Materials/Textures/renderTargetTexture.js +19 -19
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/colorCurves.d.ts +3 -3
- package/Materials/colorCurves.js +3 -3
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/effect.d.ts +27 -27
- package/Materials/effect.js +22 -288
- package/Materials/effect.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +4 -4
- package/Materials/imageProcessingConfiguration.js +4 -4
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +25 -25
- package/Materials/shaderMaterial.js +25 -25
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +4 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.functions.d.ts +2 -2
- package/Maths/math.functions.js +2 -2
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.polar.d.ts +77 -0
- package/Maths/math.polar.js +114 -0
- package/Maths/math.polar.js.map +1 -0
- package/Maths/math.scalar.d.ts +2 -2
- package/Maths/math.scalar.js +2 -2
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +13 -12
- package/Maths/math.vector.js +13 -12
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -1
- package/Meshes/abstractMesh.js +13 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +3 -3
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.d.ts +5 -4
- package/Meshes/groundMesh.js +5 -4
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +1 -1
- package/Meshes/instancedMesh.js +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js +7 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +3 -3
- package/Misc/HighDynamicRange/hdr.js +3 -3
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/arrayTools.d.ts +13 -12
- package/Misc/arrayTools.js +70 -39
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -3
- package/Misc/assetsManager.js +3 -3
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +17 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +4 -4
- package/Misc/environmentTextureTools.js +5 -5
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.d.ts +3 -3
- package/Misc/fileTools.js +19 -12
- package/Misc/fileTools.js.map +1 -1
- package/Misc/logger.js +1 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/observable.d.ts +1 -1
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Misc/performanceMonitor.d.ts +3 -3
- package/Misc/performanceMonitor.js +3 -3
- package/Misc/performanceMonitor.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +1 -1
- package/Misc/rgbdTextureTools.js +1 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +7 -7
- package/Misc/sceneOptimizer.js +7 -7
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +6 -6
- package/Misc/stringDictionary.js +6 -6
- package/Misc/stringDictionary.js.map +1 -1
- package/Misc/textureTools.d.ts +4 -4
- package/Misc/textureTools.js +4 -4
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -6
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +1 -1
- package/Misc/videoRecorder.js +1 -1
- package/Misc/videoRecorder.js.map +1 -1
- package/Offline/database.js +3 -3
- package/Offline/database.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +1 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +4 -0
- package/Particles/solidParticleSystem.js +25 -3
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
- package/Physics/Plugins/ammoJSPlugin.js +1 -1
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +1 -1
- package/Physics/physicsEngineComponent.js +1 -1
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +3 -3
- package/PostProcesses/blurPostProcess.js +3 -3
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -0
- package/Rendering/depthPeelingRenderer.js +32 -5
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +2 -2
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +4 -2
- package/Rendering/geometryBufferRenderer.js +5 -3
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
- package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +11 -3
- package/Rendering/prePassRenderer.js +18 -3
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +2 -2
- package/Rendering/subSurfaceConfiguration.js +2 -2
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Sprites/spriteSceneComponent.js +4 -1
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
- package/XR/features/WebXRControllerTeleportation.js +24 -19
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
- package/XR/motionController/webXRAbstractMotionController.js +2 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.d.ts +1 -1
- package/XR/motionController/webXRControllerComponent.js +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.js +3 -3
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/node.d.ts +4 -4
- package/node.js +3 -3
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +0 -4
- package/scene.d.ts +80 -63
- package/scene.js +92 -46
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +1 -1
- package/sceneComponent.js.map +1 -1
package/scene.js
CHANGED
|
@@ -25,7 +25,19 @@ 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 {
|
|
28
|
+
import { _ObserveArray } from "./Misc/arrayTools.js";
|
|
29
|
+
/**
|
|
30
|
+
* Define how the scene should favor performance over ease of use
|
|
31
|
+
*/
|
|
32
|
+
export var ScenePerformancePriority;
|
|
33
|
+
(function (ScenePerformancePriority) {
|
|
34
|
+
/** Default mode. No change. Performance will be treated as less important than backward compatibility */
|
|
35
|
+
ScenePerformancePriority[ScenePerformancePriority["BackwardCompatible"] = 0] = "BackwardCompatible";
|
|
36
|
+
/** Some performance options will be turned on trying to strike a balance between perf and ease of use */
|
|
37
|
+
ScenePerformancePriority[ScenePerformancePriority["Intermediate"] = 1] = "Intermediate";
|
|
38
|
+
/** Performance will be top priority */
|
|
39
|
+
ScenePerformancePriority[ScenePerformancePriority["Aggressive"] = 2] = "Aggressive";
|
|
40
|
+
})(ScenePerformancePriority || (ScenePerformancePriority = {}));
|
|
29
41
|
/**
|
|
30
42
|
* Represents a scene to be rendered by the engine.
|
|
31
43
|
* @see https://doc.babylonjs.com/features/scene
|
|
@@ -70,6 +82,7 @@ export class Scene extends AbstractScene {
|
|
|
70
82
|
* this is easier to reference from here than from all the materials.
|
|
71
83
|
*/
|
|
72
84
|
this.environmentIntensity = 1;
|
|
85
|
+
this._performancePriority = ScenePerformancePriority.BackwardCompatible;
|
|
73
86
|
this._forceWireframe = false;
|
|
74
87
|
this._skipFrustumClipping = false;
|
|
75
88
|
this._forcePointsCloud = false;
|
|
@@ -388,7 +401,7 @@ export class Scene extends AbstractScene {
|
|
|
388
401
|
// Lights
|
|
389
402
|
this._shadowsEnabled = true;
|
|
390
403
|
this._lightsEnabled = true;
|
|
391
|
-
this.
|
|
404
|
+
this._unObserveActiveCameras = null;
|
|
392
405
|
// Textures
|
|
393
406
|
this._texturesEnabled = true;
|
|
394
407
|
// Physics
|
|
@@ -667,6 +680,7 @@ export class Scene extends AbstractScene {
|
|
|
667
680
|
* Note: Compute pressure is an experimental API.
|
|
668
681
|
*/
|
|
669
682
|
this.onComputePressureChanged = new Observable();
|
|
683
|
+
this.activeCameras = new Array();
|
|
670
684
|
const fullOptions = {
|
|
671
685
|
useGeometryUniqueIdsMap: true,
|
|
672
686
|
useMaterialMeshMap: true,
|
|
@@ -762,6 +776,27 @@ export class Scene extends AbstractScene {
|
|
|
762
776
|
get imageProcessingConfiguration() {
|
|
763
777
|
return this._imageProcessingConfiguration;
|
|
764
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Gets or sets a value indicating how to treat performance relatively to ease of use and backward compatibility
|
|
781
|
+
*/
|
|
782
|
+
get performancePriority() {
|
|
783
|
+
return this._performancePriority;
|
|
784
|
+
}
|
|
785
|
+
set performancePriority(value) {
|
|
786
|
+
if (value === this._performancePriority) {
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
this._performancePriority = value;
|
|
790
|
+
switch (value) {
|
|
791
|
+
case ScenePerformancePriority.Aggressive:
|
|
792
|
+
this.skipFrustumClipping = true;
|
|
793
|
+
// eslint-disable-next-line no-fallthrough
|
|
794
|
+
case ScenePerformancePriority.Intermediate:
|
|
795
|
+
this.skipPointerMovePicking = true;
|
|
796
|
+
this.autoClear = false;
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
765
800
|
/**
|
|
766
801
|
* Gets or sets a boolean indicating if all rendering must be done in wireframe
|
|
767
802
|
*/
|
|
@@ -893,7 +928,7 @@ export class Scene extends AbstractScene {
|
|
|
893
928
|
* @param effect The effect to be bound
|
|
894
929
|
* @param variableName name of the shader variable that will hold the eye position
|
|
895
930
|
* @param isVector3 true to indicates that variableName is a Vector3 and not a Vector4
|
|
896
|
-
* @
|
|
931
|
+
* @returns the computed eye position
|
|
897
932
|
*/
|
|
898
933
|
bindEyePosition(effect, variableName = "vEyePosition", isVector3 = false) {
|
|
899
934
|
const eyePosition = this._forcedViewPosition
|
|
@@ -1033,7 +1068,16 @@ export class Scene extends AbstractScene {
|
|
|
1033
1068
|
return this._activeCameras;
|
|
1034
1069
|
}
|
|
1035
1070
|
set activeCameras(cameras) {
|
|
1036
|
-
|
|
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;
|
|
1037
1081
|
}
|
|
1038
1082
|
/** Gets or sets the current active camera */
|
|
1039
1083
|
get activeCamera() {
|
|
@@ -1385,7 +1429,7 @@ export class Scene extends AbstractScene {
|
|
|
1385
1429
|
* This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
|
|
1386
1430
|
* Delay loaded resources are not taking in account
|
|
1387
1431
|
* @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: true)
|
|
1388
|
-
* @
|
|
1432
|
+
* @returns true if all required resources are ready
|
|
1389
1433
|
*/
|
|
1390
1434
|
isReady(checkRenderTargets = true) {
|
|
1391
1435
|
if (this._isDisposed) {
|
|
@@ -2195,7 +2239,7 @@ export class Scene extends AbstractScene {
|
|
|
2195
2239
|
/**
|
|
2196
2240
|
* sets the active camera of the scene using its Id
|
|
2197
2241
|
* @param id defines the camera's Id
|
|
2198
|
-
* @
|
|
2242
|
+
* @returns the new active camera or null if none found.
|
|
2199
2243
|
*/
|
|
2200
2244
|
setActiveCameraById(id) {
|
|
2201
2245
|
const camera = this.getCameraById(id);
|
|
@@ -2221,7 +2265,7 @@ export class Scene extends AbstractScene {
|
|
|
2221
2265
|
/**
|
|
2222
2266
|
* get an animation group using its name
|
|
2223
2267
|
* @param name defines the material's name
|
|
2224
|
-
* @
|
|
2268
|
+
* @returns the animation group or null if none found.
|
|
2225
2269
|
*/
|
|
2226
2270
|
getAnimationGroupByName(name) {
|
|
2227
2271
|
for (let index = 0; index < this.animationGroups.length; index++) {
|
|
@@ -2234,7 +2278,7 @@ export class Scene extends AbstractScene {
|
|
|
2234
2278
|
/**
|
|
2235
2279
|
* Get a material using its unique id
|
|
2236
2280
|
* @param uniqueId defines the material's unique id
|
|
2237
|
-
* @
|
|
2281
|
+
* @returns the material or null if none found.
|
|
2238
2282
|
*/
|
|
2239
2283
|
getMaterialByUniqueID(uniqueId) {
|
|
2240
2284
|
for (let index = 0; index < this.materials.length; index++) {
|
|
@@ -2247,7 +2291,7 @@ export class Scene extends AbstractScene {
|
|
|
2247
2291
|
/**
|
|
2248
2292
|
* get a material using its id
|
|
2249
2293
|
* @param id defines the material's Id
|
|
2250
|
-
* @
|
|
2294
|
+
* @returns the material or null if none found.
|
|
2251
2295
|
*/
|
|
2252
2296
|
getMaterialById(id) {
|
|
2253
2297
|
for (let index = 0; index < this.materials.length; index++) {
|
|
@@ -2261,7 +2305,7 @@ export class Scene extends AbstractScene {
|
|
|
2261
2305
|
* Gets a the last added material using a given id
|
|
2262
2306
|
* @param id defines the material's Id
|
|
2263
2307
|
* @param allowMultiMaterials determines whether multimaterials should be considered
|
|
2264
|
-
* @
|
|
2308
|
+
* @returns the last material with the given id or null if none found.
|
|
2265
2309
|
*/
|
|
2266
2310
|
getLastMaterialById(id, allowMultiMaterials = false) {
|
|
2267
2311
|
for (let index = this.materials.length - 1; index >= 0; index--) {
|
|
@@ -2281,7 +2325,7 @@ export class Scene extends AbstractScene {
|
|
|
2281
2325
|
/**
|
|
2282
2326
|
* Gets a material using its name
|
|
2283
2327
|
* @param name defines the material's name
|
|
2284
|
-
* @
|
|
2328
|
+
* @returns the material or null if none found.
|
|
2285
2329
|
*/
|
|
2286
2330
|
getMaterialByName(name) {
|
|
2287
2331
|
for (let index = 0; index < this.materials.length; index++) {
|
|
@@ -2294,7 +2338,7 @@ export class Scene extends AbstractScene {
|
|
|
2294
2338
|
/**
|
|
2295
2339
|
* Get a texture using its unique id
|
|
2296
2340
|
* @param uniqueId defines the texture's unique id
|
|
2297
|
-
* @
|
|
2341
|
+
* @returns the texture or null if none found.
|
|
2298
2342
|
*/
|
|
2299
2343
|
getTextureByUniqueId(uniqueId) {
|
|
2300
2344
|
for (let index = 0; index < this.textures.length; index++) {
|
|
@@ -2307,7 +2351,7 @@ export class Scene extends AbstractScene {
|
|
|
2307
2351
|
/**
|
|
2308
2352
|
* Gets a texture using its name
|
|
2309
2353
|
* @param name defines the texture's name
|
|
2310
|
-
* @
|
|
2354
|
+
* @returns the texture or null if none found.
|
|
2311
2355
|
*/
|
|
2312
2356
|
getTextureByName(name) {
|
|
2313
2357
|
for (let index = 0; index < this.textures.length; index++) {
|
|
@@ -2346,7 +2390,7 @@ export class Scene extends AbstractScene {
|
|
|
2346
2390
|
/**
|
|
2347
2391
|
* Gets a camera using its name
|
|
2348
2392
|
* @param name defines the camera's name
|
|
2349
|
-
* @
|
|
2393
|
+
* @returns the camera or null if none found.
|
|
2350
2394
|
*/
|
|
2351
2395
|
getCameraByName(name) {
|
|
2352
2396
|
for (let index = 0; index < this.cameras.length; index++) {
|
|
@@ -2359,7 +2403,7 @@ export class Scene extends AbstractScene {
|
|
|
2359
2403
|
/**
|
|
2360
2404
|
* Gets a bone using its Id
|
|
2361
2405
|
* @param id defines the bone's Id
|
|
2362
|
-
* @
|
|
2406
|
+
* @returns the bone or null if not found
|
|
2363
2407
|
*/
|
|
2364
2408
|
getBoneById(id) {
|
|
2365
2409
|
for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
|
|
@@ -2375,7 +2419,7 @@ export class Scene extends AbstractScene {
|
|
|
2375
2419
|
/**
|
|
2376
2420
|
* Gets a bone using its id
|
|
2377
2421
|
* @param name defines the bone's name
|
|
2378
|
-
* @
|
|
2422
|
+
* @returns the bone or null if not found
|
|
2379
2423
|
*/
|
|
2380
2424
|
getBoneByName(name) {
|
|
2381
2425
|
for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
|
|
@@ -2391,7 +2435,7 @@ export class Scene extends AbstractScene {
|
|
|
2391
2435
|
/**
|
|
2392
2436
|
* Gets a light node using its name
|
|
2393
2437
|
* @param name defines the the light's name
|
|
2394
|
-
* @
|
|
2438
|
+
* @returns the light or null if none found.
|
|
2395
2439
|
*/
|
|
2396
2440
|
getLightByName(name) {
|
|
2397
2441
|
for (let index = 0; index < this.lights.length; index++) {
|
|
@@ -2404,7 +2448,7 @@ export class Scene extends AbstractScene {
|
|
|
2404
2448
|
/**
|
|
2405
2449
|
* Gets a light node using its Id
|
|
2406
2450
|
* @param id defines the light's Id
|
|
2407
|
-
* @
|
|
2451
|
+
* @returns the light or null if none found.
|
|
2408
2452
|
*/
|
|
2409
2453
|
getLightById(id) {
|
|
2410
2454
|
for (let index = 0; index < this.lights.length; index++) {
|
|
@@ -2417,7 +2461,7 @@ export class Scene extends AbstractScene {
|
|
|
2417
2461
|
/**
|
|
2418
2462
|
* Gets a light node using its scene-generated unique Id
|
|
2419
2463
|
* @param uniqueId defines the light's unique Id
|
|
2420
|
-
* @
|
|
2464
|
+
* @returns the light or null if none found.
|
|
2421
2465
|
*/
|
|
2422
2466
|
getLightByUniqueId(uniqueId) {
|
|
2423
2467
|
for (let index = 0; index < this.lights.length; index++) {
|
|
@@ -2430,7 +2474,7 @@ export class Scene extends AbstractScene {
|
|
|
2430
2474
|
/**
|
|
2431
2475
|
* Gets a particle system by Id
|
|
2432
2476
|
* @param id defines the particle system Id
|
|
2433
|
-
* @
|
|
2477
|
+
* @returns the corresponding system or null if none found
|
|
2434
2478
|
*/
|
|
2435
2479
|
getParticleSystemById(id) {
|
|
2436
2480
|
for (let index = 0; index < this.particleSystems.length; index++) {
|
|
@@ -2443,7 +2487,7 @@ export class Scene extends AbstractScene {
|
|
|
2443
2487
|
/**
|
|
2444
2488
|
* Gets a geometry using its Id
|
|
2445
2489
|
* @param id defines the geometry's Id
|
|
2446
|
-
* @
|
|
2490
|
+
* @returns the geometry or null if none found.
|
|
2447
2491
|
*/
|
|
2448
2492
|
getGeometryById(id) {
|
|
2449
2493
|
for (let index = 0; index < this.geometries.length; index++) {
|
|
@@ -2473,7 +2517,7 @@ export class Scene extends AbstractScene {
|
|
|
2473
2517
|
* Add a new geometry to this scene
|
|
2474
2518
|
* @param geometry defines the geometry to be added to the scene.
|
|
2475
2519
|
* @param force defines if the geometry must be pushed even if a geometry with this id already exists
|
|
2476
|
-
* @
|
|
2520
|
+
* @returns a boolean defining if the geometry was added or not
|
|
2477
2521
|
*/
|
|
2478
2522
|
pushGeometry(geometry, force) {
|
|
2479
2523
|
if (!force && this._getGeometryByUniqueId(geometry.uniqueId)) {
|
|
@@ -2486,7 +2530,7 @@ export class Scene extends AbstractScene {
|
|
|
2486
2530
|
/**
|
|
2487
2531
|
* Removes an existing geometry
|
|
2488
2532
|
* @param geometry defines the geometry to be removed from the scene
|
|
2489
|
-
* @
|
|
2533
|
+
* @returns a boolean defining if the geometry was removed or not
|
|
2490
2534
|
*/
|
|
2491
2535
|
removeGeometry(geometry) {
|
|
2492
2536
|
let index;
|
|
@@ -2528,7 +2572,7 @@ export class Scene extends AbstractScene {
|
|
|
2528
2572
|
/**
|
|
2529
2573
|
* Gets the first added mesh found of a given Id
|
|
2530
2574
|
* @param id defines the Id to search for
|
|
2531
|
-
* @
|
|
2575
|
+
* @returns the mesh found or null if not found at all
|
|
2532
2576
|
*/
|
|
2533
2577
|
getMeshById(id) {
|
|
2534
2578
|
for (let index = 0; index < this.meshes.length; index++) {
|
|
@@ -2551,7 +2595,7 @@ export class Scene extends AbstractScene {
|
|
|
2551
2595
|
/**
|
|
2552
2596
|
* Gets the first added transform node found of a given Id
|
|
2553
2597
|
* @param id defines the Id to search for
|
|
2554
|
-
* @
|
|
2598
|
+
* @returns the found transform node or null if not found at all.
|
|
2555
2599
|
*/
|
|
2556
2600
|
getTransformNodeById(id) {
|
|
2557
2601
|
for (let index = 0; index < this.transformNodes.length; index++) {
|
|
@@ -2564,7 +2608,7 @@ export class Scene extends AbstractScene {
|
|
|
2564
2608
|
/**
|
|
2565
2609
|
* Gets a transform node with its auto-generated unique Id
|
|
2566
2610
|
* @param uniqueId defines the unique Id to search for
|
|
2567
|
-
* @
|
|
2611
|
+
* @returns the found transform node or null if not found at all.
|
|
2568
2612
|
*/
|
|
2569
2613
|
getTransformNodeByUniqueId(uniqueId) {
|
|
2570
2614
|
for (let index = 0; index < this.transformNodes.length; index++) {
|
|
@@ -2587,7 +2631,7 @@ export class Scene extends AbstractScene {
|
|
|
2587
2631
|
/**
|
|
2588
2632
|
* Gets a mesh with its auto-generated unique Id
|
|
2589
2633
|
* @param uniqueId defines the unique Id to search for
|
|
2590
|
-
* @
|
|
2634
|
+
* @returns the found mesh or null if not found at all.
|
|
2591
2635
|
*/
|
|
2592
2636
|
getMeshByUniqueId(uniqueId) {
|
|
2593
2637
|
for (let index = 0; index < this.meshes.length; index++) {
|
|
@@ -2600,7 +2644,7 @@ export class Scene extends AbstractScene {
|
|
|
2600
2644
|
/**
|
|
2601
2645
|
* Gets a the last added mesh using a given Id
|
|
2602
2646
|
* @param id defines the Id to search for
|
|
2603
|
-
* @
|
|
2647
|
+
* @returns the found mesh or null if not found at all.
|
|
2604
2648
|
*/
|
|
2605
2649
|
getLastMeshById(id) {
|
|
2606
2650
|
for (let index = this.meshes.length - 1; index >= 0; index--) {
|
|
@@ -2613,7 +2657,7 @@ export class Scene extends AbstractScene {
|
|
|
2613
2657
|
/**
|
|
2614
2658
|
* Gets a the last added node (Mesh, Camera, Light) using a given Id
|
|
2615
2659
|
* @param id defines the Id to search for
|
|
2616
|
-
* @
|
|
2660
|
+
* @returns the found node or null if not found at all
|
|
2617
2661
|
*/
|
|
2618
2662
|
getLastEntryById(id) {
|
|
2619
2663
|
let index;
|
|
@@ -2642,7 +2686,7 @@ export class Scene extends AbstractScene {
|
|
|
2642
2686
|
/**
|
|
2643
2687
|
* Gets a node (Mesh, Camera, Light) using a given Id
|
|
2644
2688
|
* @param id defines the Id to search for
|
|
2645
|
-
* @
|
|
2689
|
+
* @returns the found node or null if not found at all
|
|
2646
2690
|
*/
|
|
2647
2691
|
getNodeById(id) {
|
|
2648
2692
|
const mesh = this.getMeshById(id);
|
|
@@ -2670,7 +2714,7 @@ export class Scene extends AbstractScene {
|
|
|
2670
2714
|
/**
|
|
2671
2715
|
* Gets a node (Mesh, Camera, Light) using a given name
|
|
2672
2716
|
* @param name defines the name to search for
|
|
2673
|
-
* @
|
|
2717
|
+
* @returns the found node or null if not found at all.
|
|
2674
2718
|
*/
|
|
2675
2719
|
getNodeByName(name) {
|
|
2676
2720
|
const mesh = this.getMeshByName(name);
|
|
@@ -2698,7 +2742,7 @@ export class Scene extends AbstractScene {
|
|
|
2698
2742
|
/**
|
|
2699
2743
|
* Gets a mesh using a given name
|
|
2700
2744
|
* @param name defines the name to search for
|
|
2701
|
-
* @
|
|
2745
|
+
* @returns the found mesh or null if not found at all.
|
|
2702
2746
|
*/
|
|
2703
2747
|
getMeshByName(name) {
|
|
2704
2748
|
for (let index = 0; index < this.meshes.length; index++) {
|
|
@@ -2711,7 +2755,7 @@ export class Scene extends AbstractScene {
|
|
|
2711
2755
|
/**
|
|
2712
2756
|
* Gets a transform node using a given name
|
|
2713
2757
|
* @param name defines the name to search for
|
|
2714
|
-
* @
|
|
2758
|
+
* @returns the found transform node or null if not found at all.
|
|
2715
2759
|
*/
|
|
2716
2760
|
getTransformNodeByName(name) {
|
|
2717
2761
|
for (let index = 0; index < this.transformNodes.length; index++) {
|
|
@@ -2724,7 +2768,7 @@ export class Scene extends AbstractScene {
|
|
|
2724
2768
|
/**
|
|
2725
2769
|
* Gets a skeleton using a given Id (if many are found, this function will pick the last one)
|
|
2726
2770
|
* @param id defines the Id to search for
|
|
2727
|
-
* @
|
|
2771
|
+
* @returns the found skeleton or null if not found at all.
|
|
2728
2772
|
*/
|
|
2729
2773
|
getLastSkeletonById(id) {
|
|
2730
2774
|
for (let index = this.skeletons.length - 1; index >= 0; index--) {
|
|
@@ -2737,7 +2781,7 @@ export class Scene extends AbstractScene {
|
|
|
2737
2781
|
/**
|
|
2738
2782
|
* Gets a skeleton using a given auto generated unique id
|
|
2739
2783
|
* @param uniqueId defines the unique id to search for
|
|
2740
|
-
* @
|
|
2784
|
+
* @returns the found skeleton or null if not found at all.
|
|
2741
2785
|
*/
|
|
2742
2786
|
getSkeletonByUniqueId(uniqueId) {
|
|
2743
2787
|
for (let index = 0; index < this.skeletons.length; index++) {
|
|
@@ -2750,7 +2794,7 @@ export class Scene extends AbstractScene {
|
|
|
2750
2794
|
/**
|
|
2751
2795
|
* Gets a skeleton using a given id (if many are found, this function will pick the first one)
|
|
2752
2796
|
* @param id defines the id to search for
|
|
2753
|
-
* @
|
|
2797
|
+
* @returns the found skeleton or null if not found at all.
|
|
2754
2798
|
*/
|
|
2755
2799
|
getSkeletonById(id) {
|
|
2756
2800
|
for (let index = 0; index < this.skeletons.length; index++) {
|
|
@@ -2763,7 +2807,7 @@ export class Scene extends AbstractScene {
|
|
|
2763
2807
|
/**
|
|
2764
2808
|
* Gets a skeleton using a given name
|
|
2765
2809
|
* @param name defines the name to search for
|
|
2766
|
-
* @
|
|
2810
|
+
* @returns the found skeleton or null if not found at all.
|
|
2767
2811
|
*/
|
|
2768
2812
|
getSkeletonByName(name) {
|
|
2769
2813
|
for (let index = 0; index < this.skeletons.length; index++) {
|
|
@@ -2776,7 +2820,7 @@ export class Scene extends AbstractScene {
|
|
|
2776
2820
|
/**
|
|
2777
2821
|
* Gets a morph target manager using a given id (if many are found, this function will pick the last one)
|
|
2778
2822
|
* @param id defines the id to search for
|
|
2779
|
-
* @
|
|
2823
|
+
* @returns the found morph target manager or null if not found at all.
|
|
2780
2824
|
*/
|
|
2781
2825
|
getMorphTargetManagerById(id) {
|
|
2782
2826
|
for (let index = 0; index < this.morphTargetManagers.length; index++) {
|
|
@@ -2789,7 +2833,7 @@ export class Scene extends AbstractScene {
|
|
|
2789
2833
|
/**
|
|
2790
2834
|
* Gets a morph target using a given id (if many are found, this function will pick the first one)
|
|
2791
2835
|
* @param id defines the id to search for
|
|
2792
|
-
* @
|
|
2836
|
+
* @returns the found morph target or null if not found at all.
|
|
2793
2837
|
*/
|
|
2794
2838
|
getMorphTargetById(id) {
|
|
2795
2839
|
for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
|
|
@@ -2806,7 +2850,7 @@ export class Scene extends AbstractScene {
|
|
|
2806
2850
|
/**
|
|
2807
2851
|
* Gets a morph target using a given name (if many are found, this function will pick the first one)
|
|
2808
2852
|
* @param name defines the name to search for
|
|
2809
|
-
* @
|
|
2853
|
+
* @returns the found morph target or null if not found at all.
|
|
2810
2854
|
*/
|
|
2811
2855
|
getMorphTargetByName(name) {
|
|
2812
2856
|
for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
|
|
@@ -2823,7 +2867,7 @@ export class Scene extends AbstractScene {
|
|
|
2823
2867
|
/**
|
|
2824
2868
|
* Gets a post process using a given name (if many are found, this function will pick the first one)
|
|
2825
2869
|
* @param name defines the name to search for
|
|
2826
|
-
* @
|
|
2870
|
+
* @returns the found post process or null if not found at all.
|
|
2827
2871
|
*/
|
|
2828
2872
|
getPostProcessByName(name) {
|
|
2829
2873
|
for (let postProcessIndex = 0; postProcessIndex < this.postProcesses.length; ++postProcessIndex) {
|
|
@@ -2857,7 +2901,7 @@ export class Scene extends AbstractScene {
|
|
|
2857
2901
|
* If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.
|
|
2858
2902
|
* @param key the unique key that identifies the data
|
|
2859
2903
|
* @param data the data object to associate to the key for this Engine instance
|
|
2860
|
-
* @
|
|
2904
|
+
* @returns true if no such key were already present and the data was added successfully, false otherwise
|
|
2861
2905
|
*/
|
|
2862
2906
|
addExternalData(key, data) {
|
|
2863
2907
|
if (!this._externalData) {
|
|
@@ -2868,7 +2912,7 @@ export class Scene extends AbstractScene {
|
|
|
2868
2912
|
/**
|
|
2869
2913
|
* Get an externally attached data from its key
|
|
2870
2914
|
* @param key the unique key that identifies the data
|
|
2871
|
-
* @
|
|
2915
|
+
* @returns the associated data, if present (can be null), or undefined if not present
|
|
2872
2916
|
*/
|
|
2873
2917
|
getExternalData(key) {
|
|
2874
2918
|
if (!this._externalData) {
|
|
@@ -2880,7 +2924,7 @@ export class Scene extends AbstractScene {
|
|
|
2880
2924
|
* Get an externally attached data from its key, create it using a factory if it's not already present
|
|
2881
2925
|
* @param key the unique key that identifies the data
|
|
2882
2926
|
* @param factory the factory that will be called to create the instance if and only if it doesn't exists
|
|
2883
|
-
* @
|
|
2927
|
+
* @returns the associated data, can be null if the factory returned null.
|
|
2884
2928
|
*/
|
|
2885
2929
|
getOrAddExternalDataWithFactory(key, factory) {
|
|
2886
2930
|
if (!this._externalData) {
|
|
@@ -2891,7 +2935,7 @@ export class Scene extends AbstractScene {
|
|
|
2891
2935
|
/**
|
|
2892
2936
|
* Remove an externally attached data from the Engine instance
|
|
2893
2937
|
* @param key the unique key that identifies the data
|
|
2894
|
-
* @
|
|
2938
|
+
* @returns true if the data was successfully removed, false if it doesn't exist
|
|
2895
2939
|
*/
|
|
2896
2940
|
removeExternalData(key) {
|
|
2897
2941
|
return this._externalData.remove(key);
|
|
@@ -3718,6 +3762,7 @@ export class Scene extends AbstractScene {
|
|
|
3718
3762
|
this.activeCamera._activeMeshes.dispose();
|
|
3719
3763
|
this.activeCamera = null;
|
|
3720
3764
|
}
|
|
3765
|
+
this.activeCameras = null;
|
|
3721
3766
|
this._activeMeshes.dispose();
|
|
3722
3767
|
this._renderingManager.dispose();
|
|
3723
3768
|
this._processedMaterials.dispose();
|
|
@@ -3801,7 +3846,8 @@ export class Scene extends AbstractScene {
|
|
|
3801
3846
|
this._disposeList(this.meshes, (item) => item.dispose(true));
|
|
3802
3847
|
this._disposeList(this.transformNodes, (item) => item.dispose(true));
|
|
3803
3848
|
// Release cameras
|
|
3804
|
-
this.
|
|
3849
|
+
const cameras = this.cameras;
|
|
3850
|
+
this._disposeList(cameras);
|
|
3805
3851
|
// Release materials
|
|
3806
3852
|
if (this._defaultMaterial) {
|
|
3807
3853
|
this._defaultMaterial.dispose();
|