@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.
- 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/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.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 +2 -2
- package/Bones/skeleton.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/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/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/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/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +2 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -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 +1 -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 +9 -4
- 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/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 +3 -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 +1 -1
- 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/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/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.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/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/scene.d.ts +61 -61
- package/scene.js +58 -46
- 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 {
|
|
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.
|
|
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
|
-
* @
|
|
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
|
-
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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.
|
|
3849
|
+
const cameras = this.cameras;
|
|
3850
|
+
this._disposeList(cameras);
|
|
3839
3851
|
// Release materials
|
|
3840
3852
|
if (this._defaultMaterial) {
|
|
3841
3853
|
this._defaultMaterial.dispose();
|