@spiffcommerce/preview 3.6.2-rc.3 → 3.6.2-rc.5
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/dist/lib/assetCache.esm.js +21 -0
- package/dist/lib/configuration.esm.js +98 -0
- package/dist/lib/core.esm.js +417 -0
- package/dist/lib/dynamicTexture.esm.js +51 -0
- package/dist/lib/glbLoaderExtensions.esm.js +137 -0
- package/dist/lib/glowLayerManager.esm.js +19 -0
- package/dist/lib/guid.esm.js +7 -0
- package/dist/lib/material.esm.js +50 -0
- package/dist/lib/modelContainer.esm.js +351 -0
- package/dist/lib/productAnimations.esm.js +123 -0
- package/dist/lib/productCamera.esm.js +113 -0
- package/dist/lib/renderConstants.esm.js +103 -0
- package/dist/lib/renderingPipeline.esm.js +99 -0
- package/dist/lib/types.esm.js +5 -0
- package/dist/lib/variants.esm.js +112 -0
- package/dist/node_modules/@babylonjs/core/Actions/abstractActionManager.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/Actions/action.esm.js +122 -0
- package/dist/node_modules/@babylonjs/core/Actions/actionEvent.esm.js +59 -0
- package/dist/node_modules/@babylonjs/core/Actions/actionManager.esm.js +335 -0
- package/dist/node_modules/@babylonjs/core/Actions/condition.esm.js +193 -0
- package/dist/node_modules/@babylonjs/core/Actions/directActions.esm.js +354 -0
- package/dist/node_modules/@babylonjs/core/Animations/animatable.esm.js +478 -0
- package/dist/node_modules/@babylonjs/core/Animations/animation.esm.js +866 -0
- package/dist/node_modules/@babylonjs/core/Animations/animationEvent.esm.js +18 -0
- package/dist/node_modules/@babylonjs/core/Animations/animationGroup.esm.js +470 -0
- package/dist/node_modules/@babylonjs/core/Animations/animationKey.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Animations/animationRange.esm.js +21 -0
- package/dist/node_modules/@babylonjs/core/Animations/easing.esm.js +93 -0
- package/dist/node_modules/@babylonjs/core/Animations/runtimeAnimation.esm.js +281 -0
- package/dist/node_modules/@babylonjs/core/Audio/sound.esm.js +568 -0
- package/dist/node_modules/@babylonjs/core/Audio/weightedsound.esm.js +117 -0
- package/dist/node_modules/@babylonjs/core/Behaviors/Cameras/autoRotationBehavior.esm.js +145 -0
- package/dist/node_modules/@babylonjs/core/Behaviors/Cameras/bouncingBehavior.esm.js +93 -0
- package/dist/node_modules/@babylonjs/core/Behaviors/Cameras/framingBehavior.esm.js +295 -0
- package/dist/node_modules/@babylonjs/core/Bones/bone.esm.js +701 -0
- package/dist/node_modules/@babylonjs/core/Bones/skeleton.esm.js +478 -0
- package/dist/node_modules/@babylonjs/core/Buffers/buffer.esm.js +433 -0
- package/dist/node_modules/@babylonjs/core/Buffers/dataBuffer.esm.js +18 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.esm.js +67 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraPointersInput.esm.js +191 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.esm.js +93 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraMouseWheelInput.esm.js +119 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraPointersInput.esm.js +119 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.esm.js +108 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.esm.js +114 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.esm.js +249 -0
- package/dist/node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.esm.js +103 -0
- package/dist/node_modules/@babylonjs/core/Cameras/arcRotateCamera.esm.js +589 -0
- package/dist/node_modules/@babylonjs/core/Cameras/arcRotateCameraInputsManager.esm.js +37 -0
- package/dist/node_modules/@babylonjs/core/Cameras/camera.esm.js +686 -0
- package/dist/node_modules/@babylonjs/core/Cameras/cameraInputsManager.esm.js +147 -0
- package/dist/node_modules/@babylonjs/core/Cameras/freeCamera.esm.js +236 -0
- package/dist/node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.esm.js +66 -0
- package/dist/node_modules/@babylonjs/core/Cameras/targetCamera.esm.js +214 -0
- package/dist/node_modules/@babylonjs/core/Collisions/intersectionInfo.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Collisions/meshCollisionData.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Collisions/pickingInfo.esm.js +59 -0
- package/dist/node_modules/@babylonjs/core/Compat/compatibilityOptions.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Culling/boundingBox.esm.js +174 -0
- package/dist/node_modules/@babylonjs/core/Culling/boundingInfo.esm.js +159 -0
- package/dist/node_modules/@babylonjs/core/Culling/boundingSphere.esm.js +114 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.esm.js +37 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.esm.js +23 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.esm.js +106 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/eventFactory.esm.js +118 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/internalDeviceSourceManager.esm.js +46 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/nativeDeviceInputSystem.esm.js +50 -0
- package/dist/node_modules/@babylonjs/core/DeviceInput/webDeviceInputSystem.esm.js +354 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.esm.js +101 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.esm.js +103 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.multiRender.esm.js +111 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.esm.js +109 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.esm.js +76 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.esm.js +69 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.esm.js +29 -0
- package/dist/node_modules/@babylonjs/core/Engines/Extensions/engine.views.esm.js +85 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.esm.js +36 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/Expressions/shaderDefineExpression.esm.js +88 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/shaderCodeConditionNode.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/shaderCodeCursor.esm.js +44 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/shaderCodeNode.esm.js +31 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/shaderCodeTestNode.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.esm.js +230 -0
- package/dist/node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.esm.js +30 -0
- package/dist/node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.esm.js +34 -0
- package/dist/node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.esm.js +388 -0
- package/dist/node_modules/@babylonjs/core/Engines/WebGL/webGLRenderTargetWrapper.esm.js +87 -0
- package/dist/node_modules/@babylonjs/core/Engines/WebGL/webGLShaderProcessors.esm.js +16 -0
- package/dist/node_modules/@babylonjs/core/Engines/constants.esm.js +254 -0
- package/dist/node_modules/@babylonjs/core/Engines/engine.esm.js +1120 -0
- package/dist/node_modules/@babylonjs/core/Engines/engineStore.esm.js +23 -0
- package/dist/node_modules/@babylonjs/core/Engines/nullEngine.esm.js +697 -0
- package/dist/node_modules/@babylonjs/core/Engines/performanceConfigurator.esm.js +22 -0
- package/dist/node_modules/@babylonjs/core/Engines/renderTargetWrapper.esm.js +273 -0
- package/dist/node_modules/@babylonjs/core/Engines/shaderStore.esm.js +36 -0
- package/dist/node_modules/@babylonjs/core/Engines/thinEngine.esm.js +2921 -0
- package/dist/node_modules/@babylonjs/core/Events/deviceInputEvents.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Events/keyboardEvents.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/Events/pointerEvents.esm.js +63 -0
- package/dist/node_modules/@babylonjs/core/Inputs/pointerPickingConfiguration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Inputs/scene.inputManager.esm.js +418 -0
- package/dist/node_modules/@babylonjs/core/Layers/effectLayer.esm.js +437 -0
- package/dist/node_modules/@babylonjs/core/Layers/effectLayerSceneComponent.esm.js +141 -0
- package/dist/node_modules/@babylonjs/core/Layers/glowLayer.esm.js +343 -0
- package/dist/node_modules/@babylonjs/core/Layers/highlightLayer.esm.js +396 -0
- package/dist/node_modules/@babylonjs/core/Lights/directionalLight.esm.js +224 -0
- package/dist/node_modules/@babylonjs/core/Lights/hemisphericLight.esm.js +92 -0
- package/dist/node_modules/@babylonjs/core/Lights/light.esm.js +476 -0
- package/dist/node_modules/@babylonjs/core/Lights/lightConstants.esm.js +30 -0
- package/dist/node_modules/@babylonjs/core/Lights/pointLight.esm.js +153 -0
- package/dist/node_modules/@babylonjs/core/Lights/shadowLight.esm.js +196 -0
- package/dist/node_modules/@babylonjs/core/Lights/spotLight.esm.js +287 -0
- package/dist/node_modules/@babylonjs/core/Loading/sceneLoader.esm.js +551 -0
- package/dist/node_modules/@babylonjs/core/Loading/sceneLoaderFlags.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.esm.js +112 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.esm.js +568 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.esm.js +139 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.esm.js +97 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.esm.js +496 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.esm.js +106 -0
- package/dist/node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.esm.js +270 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/Filtering/hdrFiltering.esm.js +103 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader.esm.js +53 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.esm.js +51 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/Loaders/ktxTextureLoader.esm.js +81 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/baseTexture.esm.js +542 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.esm.js +23 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/cubeTexture.esm.js +244 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/dynamicTexture.esm.js +134 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/equiRectangularCubeTexture.esm.js +89 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/hdrCubeTexture.esm.js +175 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/internalTexture.esm.js +150 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/ktx2decoderTypes.esm.js +17 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/mirrorTexture.esm.js +138 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/multiRenderTarget.esm.js +223 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.esm.js +58 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/rawTexture.esm.js +156 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.esm.js +53 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.esm.js +605 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/texture.esm.js +421 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/textureSampler.esm.js +101 -0
- package/dist/node_modules/@babylonjs/core/Materials/Textures/thinTexture.esm.js +170 -0
- package/dist/node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.esm.js +28 -0
- package/dist/node_modules/@babylonjs/core/Materials/colorCurves.esm.js +397 -0
- package/dist/node_modules/@babylonjs/core/Materials/drawWrapper.esm.js +22 -0
- package/dist/node_modules/@babylonjs/core/Materials/effect.esm.js +890 -0
- package/dist/node_modules/@babylonjs/core/Materials/effectFallbacks.esm.js +73 -0
- package/dist/node_modules/@babylonjs/core/Materials/effectRenderer.esm.js +132 -0
- package/dist/node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.esm.js +428 -0
- package/dist/node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.esm.js +90 -0
- package/dist/node_modules/@babylonjs/core/Materials/material.esm.js +906 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialDefines.esm.js +161 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialFlags.esm.js +226 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialHelper.esm.js +501 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialPluginBase.esm.js +226 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialPluginEvent.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialPluginManager.esm.js +212 -0
- package/dist/node_modules/@babylonjs/core/Materials/materialStencilState.esm.js +145 -0
- package/dist/node_modules/@babylonjs/core/Materials/multiMaterial.esm.js +164 -0
- package/dist/node_modules/@babylonjs/core/Materials/prePassConfiguration.esm.js +38 -0
- package/dist/node_modules/@babylonjs/core/Materials/pushMaterial.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/Materials/shaderLanguage.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Materials/shaderMaterial.esm.js +838 -0
- package/dist/node_modules/@babylonjs/core/Materials/standardMaterial.esm.js +934 -0
- package/dist/node_modules/@babylonjs/core/Materials/uniformBuffer.esm.js +541 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.axis.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.color.esm.js +903 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.constants.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.frustum.esm.js +91 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.functions.esm.js +43 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.path.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.plane.esm.js +145 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.scalar.esm.js +284 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.size.esm.js +124 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.vector.esm.js +4915 -0
- package/dist/node_modules/@babylonjs/core/Maths/math.viewport.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/Maths/sphericalPolynomial.esm.js +177 -0
- package/dist/node_modules/@babylonjs/core/Meshes/Builders/boxBuilder.esm.js +260 -0
- package/dist/node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.esm.js +233 -0
- package/dist/node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.esm.js +47 -0
- package/dist/node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.esm.js +12 -0
- package/dist/node_modules/@babylonjs/core/Meshes/abstractMesh.esm.js +1448 -0
- package/dist/node_modules/@babylonjs/core/Meshes/geometry.esm.js +729 -0
- package/dist/node_modules/@babylonjs/core/Meshes/instancedMesh.esm.js +455 -0
- package/dist/node_modules/@babylonjs/core/Meshes/mesh.esm.js +2526 -0
- package/dist/node_modules/@babylonjs/core/Meshes/mesh.vertexData.esm.js +865 -0
- package/dist/node_modules/@babylonjs/core/Meshes/meshLODLevel.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Meshes/subMesh.esm.js +422 -0
- package/dist/node_modules/@babylonjs/core/Meshes/thinInstanceMesh.esm.js +129 -0
- package/dist/node_modules/@babylonjs/core/Meshes/transformNode.esm.js +796 -0
- package/dist/node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.esm.js +111 -0
- package/dist/node_modules/@babylonjs/core/Misc/HighDynamicRange/hdr.esm.js +122 -0
- package/dist/node_modules/@babylonjs/core/Misc/HighDynamicRange/panoramaToCubemap.esm.js +78 -0
- package/dist/node_modules/@babylonjs/core/Misc/andOrNotEvaluator.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/Misc/arrayTools.esm.js +52 -0
- package/dist/node_modules/@babylonjs/core/Misc/assetsManager.esm.js +561 -0
- package/dist/node_modules/@babylonjs/core/Misc/brdfTextureTools.esm.js +31 -0
- package/dist/node_modules/@babylonjs/core/Misc/copyTools.esm.js +44 -0
- package/dist/node_modules/@babylonjs/core/Misc/coroutine.esm.js +53 -0
- package/dist/node_modules/@babylonjs/core/Misc/dataReader.esm.js +55 -0
- package/dist/node_modules/@babylonjs/core/Misc/dds.esm.js +329 -0
- package/dist/node_modules/@babylonjs/core/Misc/decorators.esm.js +332 -0
- package/dist/node_modules/@babylonjs/core/Misc/deepCopier.esm.js +52 -0
- package/dist/node_modules/@babylonjs/core/Misc/deferred.esm.js +25 -0
- package/dist/node_modules/@babylonjs/core/Misc/devTools.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Misc/domManagement.esm.js +21 -0
- package/dist/node_modules/@babylonjs/core/Misc/dumpTools.esm.js +117 -0
- package/dist/node_modules/@babylonjs/core/Misc/environmentTextureTools.esm.js +187 -0
- package/dist/node_modules/@babylonjs/core/Misc/error.esm.js +40 -0
- package/dist/node_modules/@babylonjs/core/Misc/fileTools.esm.js +339 -0
- package/dist/node_modules/@babylonjs/core/Misc/filesInputStore.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Misc/guid.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Misc/instantiationTools.esm.js +26 -0
- package/dist/node_modules/@babylonjs/core/Misc/khronosTextureContainer.esm.js +79 -0
- package/dist/node_modules/@babylonjs/core/Misc/khronosTextureContainer2.esm.js +281 -0
- package/dist/node_modules/@babylonjs/core/Misc/logger.esm.js +77 -0
- package/dist/node_modules/@babylonjs/core/Misc/observable.esm.js +231 -0
- package/dist/node_modules/@babylonjs/core/Misc/perfCounter.esm.js +99 -0
- package/dist/node_modules/@babylonjs/core/Misc/performanceMonitor.esm.js +144 -0
- package/dist/node_modules/@babylonjs/core/Misc/precisionDate.esm.js +12 -0
- package/dist/node_modules/@babylonjs/core/Misc/retryStrategy.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Misc/rgbdTextureTools.esm.js +51 -0
- package/dist/node_modules/@babylonjs/core/Misc/screenshotTools.esm.js +92 -0
- package/dist/node_modules/@babylonjs/core/Misc/smartArray.esm.js +118 -0
- package/dist/node_modules/@babylonjs/core/Misc/stringDictionary.esm.js +129 -0
- package/dist/node_modules/@babylonjs/core/Misc/stringTools.esm.js +26 -0
- package/dist/node_modules/@babylonjs/core/Misc/tags.esm.js +97 -0
- package/dist/node_modules/@babylonjs/core/Misc/textureTools.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/Misc/timingTools.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Misc/tools.esm.js +929 -0
- package/dist/node_modules/@babylonjs/core/Misc/typeStore.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Misc/uniqueIdGenerator.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Misc/webRequest.esm.js +135 -0
- package/dist/node_modules/@babylonjs/core/Misc/workerPool.esm.js +80 -0
- package/dist/node_modules/@babylonjs/core/Morph/morphTarget.esm.js +187 -0
- package/dist/node_modules/@babylonjs/core/Morph/morphTargetManager.esm.js +249 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.esm.js +349 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.esm.js +306 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.esm.js +161 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.esm.js +589 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.esm.js +512 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderEffect.esm.js +114 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipeline.esm.js +139 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.esm.js +99 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/bloomEffect.esm.js +76 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/bloomMergePostProcess.esm.js +40 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/blurPostProcess.esm.js +165 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/chromaticAberrationPostProcess.esm.js +61 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/circleOfConfusionPostProcess.esm.js +62 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/depthOfFieldBlurPostProcess.esm.js +58 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/depthOfFieldEffect.esm.js +131 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/depthOfFieldMergePostProcess.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/extractHighlightsPostProcess.esm.js +27 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/fxaaPostProcess.esm.js +41 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/grainPostProcess.esm.js +46 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/imageProcessingPostProcess.esm.js +359 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/motionBlurPostProcess.esm.js +178 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/passPostProcess.esm.js +40 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/postProcess.esm.js +457 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/postProcessManager.esm.js +94 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/screenSpaceReflectionPostProcess.esm.js +147 -0
- package/dist/node_modules/@babylonjs/core/PostProcesses/sharpenPostProcess.esm.js +46 -0
- package/dist/node_modules/@babylonjs/core/Probes/reflectionProbe.esm.js +184 -0
- package/dist/node_modules/@babylonjs/core/Rendering/boundingBoxRenderer.esm.js +170 -0
- package/dist/node_modules/@babylonjs/core/Rendering/depthRenderer.esm.js +185 -0
- package/dist/node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.esm.js +65 -0
- package/dist/node_modules/@babylonjs/core/Rendering/geometryBufferRenderer.esm.js +353 -0
- package/dist/node_modules/@babylonjs/core/Rendering/geometryBufferRendererSceneComponent.esm.js +55 -0
- package/dist/node_modules/@babylonjs/core/Rendering/motionBlurConfiguration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Rendering/renderingGroup.esm.js +223 -0
- package/dist/node_modules/@babylonjs/core/Rendering/renderingManager.esm.js +185 -0
- package/dist/node_modules/@babylonjs/core/Rendering/screenSpaceReflections2Configuration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Rendering/screenSpaceReflectionsConfiguration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Rendering/ssao2Configuration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.esm.js +48 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.esm.js +24 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.esm.js +35 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.esm.js +56 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererFragmentDeclaration.esm.js +4 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererUboDeclaration.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererVertexDeclaration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.esm.js +67 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.esm.js +58 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.esm.js +93 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.esm.js +42 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.esm.js +21 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.esm.js +21 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.esm.js +27 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragment.esm.js +12 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragmentDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/decalVertexDeclaration.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultFragmentDeclaration.esm.js +86 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultUboDeclaration.esm.js +50 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultVertexDeclaration.esm.js +46 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.esm.js +10 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.esm.js +34 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.esm.js +10 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryUboDeclaration.esm.js +5 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryVertexDeclaration.esm.js +4 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.esm.js +42 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.esm.js +139 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.esm.js +166 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.esm.js +32 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.esm.js +129 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.esm.js +22 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.esm.js +31 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.esm.js +20 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment2.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVaryingDeclaration.esm.js +3 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVertex.esm.js +3 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.esm.js +278 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.esm.js +82 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.esm.js +81 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.esm.js +35 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.esm.js +34 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.esm.js +93 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.esm.js +7 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.esm.js +32 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.esm.js +17 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.esm.js +8 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/mrtFragmentDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.esm.js +40 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.esm.js +268 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.esm.js +83 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlphaFresnel.esm.js +37 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.esm.js +32 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAnisotropic.esm.js +50 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockClearcoat.esm.js +276 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockDirectLighting.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalColorComposition.esm.js +45 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalLitComponents.esm.js +100 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.esm.js +27 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockGeometryInfo.esm.js +30 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockImageProcessing.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockIridescence.esm.js +63 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockLightmapInit.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalFinal.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalGeometric.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance.esm.js +24 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance0.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflection.esm.js +270 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectivity.esm.js +131 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSheen.esm.js +197 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSubSurface.esm.js +337 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDebug.esm.js +176 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.esm.js +64 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFunctions.esm.js +130 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.esm.js +53 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentDeclaration.esm.js +179 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.esm.js +18 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.esm.js +101 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrHelperFunctions.esm.js +83 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrIBLFunctions.esm.js +35 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.esm.js +65 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrVertexDeclaration.esm.js +151 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertex.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.esm.js +37 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.esm.js +116 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentAlternateDeclaration.esm.js +20 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.esm.js +21 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.esm.js +39 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/screenSpaceRayTrace.esm.js +208 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.esm.js +614 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.esm.js +23 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.esm.js +6 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.esm.js +9 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.esm.js +16 -0
- package/dist/node_modules/@babylonjs/core/Shaders/bloomMerge.fragment.esm.js +14 -0
- package/dist/node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.fragment.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.vertex.esm.js +22 -0
- package/dist/node_modules/@babylonjs/core/Shaders/chromaticAberration.fragment.esm.js +34 -0
- package/dist/node_modules/@babylonjs/core/Shaders/circleOfConfusion.fragment.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/default.fragment.esm.js +387 -0
- package/dist/node_modules/@babylonjs/core/Shaders/default.vertex.esm.js +171 -0
- package/dist/node_modules/@babylonjs/core/Shaders/depth.fragment.esm.js +47 -0
- package/dist/node_modules/@babylonjs/core/Shaders/depth.vertex.esm.js +72 -0
- package/dist/node_modules/@babylonjs/core/Shaders/depthOfField.fragment.esm.js +137 -0
- package/dist/node_modules/@babylonjs/core/Shaders/depthOfFieldMerge.fragment.esm.js +54 -0
- package/dist/node_modules/@babylonjs/core/Shaders/extractHighlights.fragment.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/fxaa.fragment.esm.js +211 -0
- package/dist/node_modules/@babylonjs/core/Shaders/fxaa.vertex.esm.js +29 -0
- package/dist/node_modules/@babylonjs/core/Shaders/geometry.fragment.esm.js +147 -0
- package/dist/node_modules/@babylonjs/core/Shaders/geometry.vertex.esm.js +164 -0
- package/dist/node_modules/@babylonjs/core/Shaders/glowBlurPostProcess.fragment.esm.js +39 -0
- package/dist/node_modules/@babylonjs/core/Shaders/glowMapGeneration.fragment.esm.js +73 -0
- package/dist/node_modules/@babylonjs/core/Shaders/glowMapGeneration.vertex.esm.js +94 -0
- package/dist/node_modules/@babylonjs/core/Shaders/glowMapMerge.fragment.esm.js +29 -0
- package/dist/node_modules/@babylonjs/core/Shaders/glowMapMerge.vertex.esm.js +12 -0
- package/dist/node_modules/@babylonjs/core/Shaders/grain.fragment.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/hdrFiltering.fragment.esm.js +19 -0
- package/dist/node_modules/@babylonjs/core/Shaders/hdrFiltering.vertex.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/imageProcessing.fragment.esm.js +26 -0
- package/dist/node_modules/@babylonjs/core/Shaders/kernelBlur.fragment.esm.js +49 -0
- package/dist/node_modules/@babylonjs/core/Shaders/kernelBlur.vertex.esm.js +17 -0
- package/dist/node_modules/@babylonjs/core/Shaders/lensHighlights.fragment.esm.js +115 -0
- package/dist/node_modules/@babylonjs/core/Shaders/motionBlur.fragment.esm.js +74 -0
- package/dist/node_modules/@babylonjs/core/Shaders/pass.fragment.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/passCube.fragment.esm.js +27 -0
- package/dist/node_modules/@babylonjs/core/Shaders/pbr.fragment.esm.js +648 -0
- package/dist/node_modules/@babylonjs/core/Shaders/pbr.vertex.esm.js +236 -0
- package/dist/node_modules/@babylonjs/core/Shaders/postprocess.vertex.esm.js +13 -0
- package/dist/node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Shaders/rgbdEncode.fragment.esm.js +11 -0
- package/dist/node_modules/@babylonjs/core/Shaders/screenSpaceReflection.fragment.esm.js +136 -0
- package/dist/node_modules/@babylonjs/core/Shaders/screenSpaceReflection2.fragment.esm.js +215 -0
- package/dist/node_modules/@babylonjs/core/Shaders/screenSpaceReflection2Blur.fragment.esm.js +52 -0
- package/dist/node_modules/@babylonjs/core/Shaders/screenSpaceReflection2BlurCombiner.fragment.esm.js +59 -0
- package/dist/node_modules/@babylonjs/core/Shaders/sharpen.fragment.esm.js +18 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ssao.fragment.esm.js +55 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ssao2.fragment.esm.js +165 -0
- package/dist/node_modules/@babylonjs/core/Shaders/ssaoCombine.fragment.esm.js +15 -0
- package/dist/node_modules/@babylonjs/core/Shaders/standard.fragment.esm.js +339 -0
- package/dist/node_modules/@babylonjs/core/States/alphaCullingState.esm.js +35 -0
- package/dist/node_modules/@babylonjs/core/States/depthCullingState.esm.js +69 -0
- package/dist/node_modules/@babylonjs/core/States/stencilState.esm.js +62 -0
- package/dist/node_modules/@babylonjs/core/States/stencilStateComposer.esm.js +70 -0
- package/dist/node_modules/@babylonjs/core/abstractScene.esm.js +71 -0
- package/dist/node_modules/@babylonjs/core/assetContainer.esm.js +425 -0
- package/dist/node_modules/@babylonjs/core/node.esm.js +536 -0
- package/dist/node_modules/@babylonjs/core/scene.esm.js +2809 -0
- package/dist/node_modules/@babylonjs/core/sceneComponent.esm.js +102 -0
- package/dist/node_modules/@babylonjs/core/tslib.es6.esm.js +12 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/1.0/glTFBinaryExtension.esm.js +37 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/1.0/glTFLoader.esm.js +902 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderInterfaces.esm.js +42 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderUtils.esm.js +195 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/1.0/glTFMaterialsCommonExtension.esm.js +75 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_lights_image_based.esm.js +77 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.esm.js +53 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_meshopt_compression.esm.js +31 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_texture_webp.esm.js +29 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/ExtrasAsMetadata.esm.js +47 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.esm.js +173 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.esm.js +82 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression.esm.js +68 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_lights_punctual.esm.js +60 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_anisotropy.esm.js +39 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_clearcoat.esm.js +42 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_emissive_strength.esm.js +32 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_ior.esm.js +35 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_iridescence.esm.js +41 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.esm.js +41 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_sheen.esm.js +41 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_specular.esm.js +41 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_translucency.esm.js +41 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_transmission.esm.js +136 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_unlit.esm.js +37 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_variants.esm.js +178 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_volume.esm.js +40 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_mesh_quantization.esm.js +17 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_basisu.esm.js +29 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_transform.esm.js +29 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_xmp_json_ld.esm.js +31 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_audio_emitter.esm.js +149 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_lod.esm.js +170 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_minecraftMesh.esm.js +29 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_sRGBFactors.esm.js +29 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.esm.js +1562 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderAnimation.esm.js +66 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/glTFFileLoader.esm.js +462 -0
- package/dist/node_modules/@babylonjs/loaders/glTF/glTFValidation.esm.js +81 -0
- package/package.json +6 -4
- /package/dist/{src/index.esm.js → index.esm.js} +0 -0
|
@@ -0,0 +1,2809 @@
|
|
|
1
|
+
import { Tools as C } from "./Misc/tools.esm.js";
|
|
2
|
+
import { PrecisionDate as N } from "./Misc/precisionDate.esm.js";
|
|
3
|
+
import { Observable as h } from "./Misc/observable.esm.js";
|
|
4
|
+
import { SmartArrayNoDuplicate as v, SmartArray as x } from "./Misc/smartArray.esm.js";
|
|
5
|
+
import { StringDictionary as P } from "./Misc/stringDictionary.esm.js";
|
|
6
|
+
import { Tags as T } from "./Misc/tags.esm.js";
|
|
7
|
+
import { TmpVectors as b, Vector3 as y, Matrix as F } from "./Maths/math.vector.esm.js";
|
|
8
|
+
import { AbstractScene as E } from "./abstractScene.esm.js";
|
|
9
|
+
import { ImageProcessingConfiguration as S } from "./Materials/imageProcessingConfiguration.esm.js";
|
|
10
|
+
import { UniformBuffer as U } from "./Materials/uniformBuffer.esm.js";
|
|
11
|
+
import { PickingInfo as I } from "./Collisions/pickingInfo.esm.js";
|
|
12
|
+
import { ActionEvent as w } from "./Actions/actionEvent.esm.js";
|
|
13
|
+
import { PostProcessManager as B } from "./PostProcesses/postProcessManager.esm.js";
|
|
14
|
+
import { RenderingManager as L } from "./Rendering/renderingManager.esm.js";
|
|
15
|
+
import { Stage as d } from "./sceneComponent.esm.js";
|
|
16
|
+
import { IsWindowObjectExist as q } from "./Misc/domManagement.esm.js";
|
|
17
|
+
import { EngineStore as R } from "./Engines/engineStore.esm.js";
|
|
18
|
+
import { _WarnImport as f } from "./Misc/devTools.esm.js";
|
|
19
|
+
import { InputManager as m } from "./Inputs/scene.inputManager.esm.js";
|
|
20
|
+
import { PerfCounter as O } from "./Misc/perfCounter.esm.js";
|
|
21
|
+
import { Color4 as G, Color3 as D } from "./Maths/math.color.esm.js";
|
|
22
|
+
import { Frustum as k } from "./Maths/math.frustum.esm.js";
|
|
23
|
+
import { UniqueIdGenerator as V } from "./Misc/uniqueIdGenerator.esm.js";
|
|
24
|
+
import { LoadFile as W, RequestFile as z, ReadFile as j } from "./Misc/fileTools.esm.js";
|
|
25
|
+
import { LightConstants as X } from "./Lights/lightConstants.esm.js";
|
|
26
|
+
import { _ObserveArray as H } from "./Misc/arrayTools.esm.js";
|
|
27
|
+
import { PointerPickingConfiguration as K } from "./Inputs/pointerPickingConfiguration.esm.js";
|
|
28
|
+
var M;
|
|
29
|
+
(function(_) {
|
|
30
|
+
_[_.BackwardCompatible = 0] = "BackwardCompatible", _[_.Intermediate = 1] = "Intermediate", _[_.Aggressive = 2] = "Aggressive";
|
|
31
|
+
})(M || (M = {}));
|
|
32
|
+
class c extends E {
|
|
33
|
+
/**
|
|
34
|
+
* Factory used to create the default material.
|
|
35
|
+
* @param scene The scene to create the material for
|
|
36
|
+
* @returns The default material
|
|
37
|
+
*/
|
|
38
|
+
static DefaultMaterialFactory(e) {
|
|
39
|
+
throw f("StandardMaterial");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Factory used to create the a collision coordinator.
|
|
43
|
+
* @returns The collision coordinator
|
|
44
|
+
*/
|
|
45
|
+
static CollisionCoordinatorFactory() {
|
|
46
|
+
throw f("DefaultCollisionCoordinator");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Texture used in all pbr material as the reflection texture.
|
|
50
|
+
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
51
|
+
* this is easier to reference from here than from all the materials.
|
|
52
|
+
*/
|
|
53
|
+
get environmentTexture() {
|
|
54
|
+
return this._environmentTexture;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Texture used in all pbr material as the reflection texture.
|
|
58
|
+
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
59
|
+
* this is easier to set here than in all the materials.
|
|
60
|
+
*/
|
|
61
|
+
set environmentTexture(e) {
|
|
62
|
+
this._environmentTexture !== e && (this._environmentTexture = e, this.markAllMaterialsAsDirty(1));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default image processing configuration used either in the rendering
|
|
66
|
+
* Forward main pass or through the imageProcessingPostProcess if present.
|
|
67
|
+
* As in the majority of the scene they are the same (exception for multi camera),
|
|
68
|
+
* this is easier to reference from here than from all the materials and post process.
|
|
69
|
+
*
|
|
70
|
+
* No setter as we it is a shared configuration, you can set the values instead.
|
|
71
|
+
*/
|
|
72
|
+
get imageProcessingConfiguration() {
|
|
73
|
+
return this._imageProcessingConfiguration;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets or sets a value indicating how to treat performance relatively to ease of use and backward compatibility
|
|
77
|
+
*/
|
|
78
|
+
get performancePriority() {
|
|
79
|
+
return this._performancePriority;
|
|
80
|
+
}
|
|
81
|
+
set performancePriority(e) {
|
|
82
|
+
if (e !== this._performancePriority) {
|
|
83
|
+
switch (this._performancePriority = e, e) {
|
|
84
|
+
case M.BackwardCompatible:
|
|
85
|
+
this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !1, this.autoClear = !0;
|
|
86
|
+
break;
|
|
87
|
+
case M.Intermediate:
|
|
88
|
+
this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !0, this.autoClear = !1;
|
|
89
|
+
break;
|
|
90
|
+
case M.Aggressive:
|
|
91
|
+
this.skipFrustumClipping = !0, this._renderingManager.maintainStateBetweenFrames = !0, this.skipPointerMovePicking = !0, this.autoClear = !1;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
this.onScenePerformancePriorityChangedObservable.notifyObservers(e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Gets or sets a boolean indicating if all rendering must be done in wireframe
|
|
99
|
+
*/
|
|
100
|
+
set forceWireframe(e) {
|
|
101
|
+
this._forceWireframe !== e && (this._forceWireframe = e, this.markAllMaterialsAsDirty(16));
|
|
102
|
+
}
|
|
103
|
+
get forceWireframe() {
|
|
104
|
+
return this._forceWireframe;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Gets or sets a boolean indicating if we should skip the frustum clipping part of the active meshes selection
|
|
108
|
+
*/
|
|
109
|
+
set skipFrustumClipping(e) {
|
|
110
|
+
this._skipFrustumClipping !== e && (this._skipFrustumClipping = e);
|
|
111
|
+
}
|
|
112
|
+
get skipFrustumClipping() {
|
|
113
|
+
return this._skipFrustumClipping;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Gets or sets a boolean indicating if all rendering must be done in point cloud
|
|
117
|
+
*/
|
|
118
|
+
set forcePointsCloud(e) {
|
|
119
|
+
this._forcePointsCloud !== e && (this._forcePointsCloud = e, this.markAllMaterialsAsDirty(16));
|
|
120
|
+
}
|
|
121
|
+
get forcePointsCloud() {
|
|
122
|
+
return this._forcePointsCloud;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Gets or sets the animation properties override
|
|
126
|
+
*/
|
|
127
|
+
get animationPropertiesOverride() {
|
|
128
|
+
return this._animationPropertiesOverride;
|
|
129
|
+
}
|
|
130
|
+
set animationPropertiesOverride(e) {
|
|
131
|
+
this._animationPropertiesOverride = e;
|
|
132
|
+
}
|
|
133
|
+
/** Sets a function to be executed when this scene is disposed. */
|
|
134
|
+
set onDispose(e) {
|
|
135
|
+
this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
|
|
136
|
+
}
|
|
137
|
+
/** Sets a function to be executed before rendering this scene */
|
|
138
|
+
set beforeRender(e) {
|
|
139
|
+
this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), e && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e));
|
|
140
|
+
}
|
|
141
|
+
/** Sets a function to be executed after rendering this scene */
|
|
142
|
+
set afterRender(e) {
|
|
143
|
+
this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), e && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(e));
|
|
144
|
+
}
|
|
145
|
+
/** Sets a function to be executed before rendering a camera*/
|
|
146
|
+
set beforeCameraRender(e) {
|
|
147
|
+
this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(e);
|
|
148
|
+
}
|
|
149
|
+
/** Sets a function to be executed after rendering a camera*/
|
|
150
|
+
set afterCameraRender(e) {
|
|
151
|
+
this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(e);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer down event
|
|
155
|
+
*/
|
|
156
|
+
get pointerDownPredicate() {
|
|
157
|
+
return this._pointerPickingConfiguration.pointerDownPredicate;
|
|
158
|
+
}
|
|
159
|
+
set pointerDownPredicate(e) {
|
|
160
|
+
this._pointerPickingConfiguration.pointerDownPredicate = e;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer up event
|
|
164
|
+
*/
|
|
165
|
+
get pointerUpPredicate() {
|
|
166
|
+
return this._pointerPickingConfiguration.pointerUpPredicate;
|
|
167
|
+
}
|
|
168
|
+
set pointerUpPredicate(e) {
|
|
169
|
+
this._pointerPickingConfiguration.pointerUpPredicate = e;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer move event
|
|
173
|
+
*/
|
|
174
|
+
get pointerMovePredicate() {
|
|
175
|
+
return this._pointerPickingConfiguration.pointerMovePredicate;
|
|
176
|
+
}
|
|
177
|
+
set pointerMovePredicate(e) {
|
|
178
|
+
this._pointerPickingConfiguration.pointerMovePredicate = e;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer down event
|
|
182
|
+
*/
|
|
183
|
+
get pointerDownFastCheck() {
|
|
184
|
+
return this._pointerPickingConfiguration.pointerDownFastCheck;
|
|
185
|
+
}
|
|
186
|
+
set pointerDownFastCheck(e) {
|
|
187
|
+
this._pointerPickingConfiguration.pointerDownFastCheck = e;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer up event
|
|
191
|
+
*/
|
|
192
|
+
get pointerUpFastCheck() {
|
|
193
|
+
return this._pointerPickingConfiguration.pointerUpFastCheck;
|
|
194
|
+
}
|
|
195
|
+
set pointerUpFastCheck(e) {
|
|
196
|
+
this._pointerPickingConfiguration.pointerUpFastCheck = e;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Gets or sets a predicate used to select candidate meshes for a pointer move event
|
|
200
|
+
*/
|
|
201
|
+
get pointerMoveFastCheck() {
|
|
202
|
+
return this._pointerPickingConfiguration.pointerMoveFastCheck;
|
|
203
|
+
}
|
|
204
|
+
set pointerMoveFastCheck(e) {
|
|
205
|
+
this._pointerPickingConfiguration.pointerMoveFastCheck = e;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer move event occurs.
|
|
209
|
+
*/
|
|
210
|
+
get skipPointerMovePicking() {
|
|
211
|
+
return this._pointerPickingConfiguration.skipPointerMovePicking;
|
|
212
|
+
}
|
|
213
|
+
set skipPointerMovePicking(e) {
|
|
214
|
+
this._pointerPickingConfiguration.skipPointerMovePicking = e;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer down event occurs.
|
|
218
|
+
*/
|
|
219
|
+
get skipPointerDownPicking() {
|
|
220
|
+
return this._pointerPickingConfiguration.skipPointerDownPicking;
|
|
221
|
+
}
|
|
222
|
+
set skipPointerDownPicking(e) {
|
|
223
|
+
this._pointerPickingConfiguration.skipPointerDownPicking = e;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer up event occurs. Off by default.
|
|
227
|
+
*/
|
|
228
|
+
get skipPointerUpPicking() {
|
|
229
|
+
return this._pointerPickingConfiguration.skipPointerUpPicking;
|
|
230
|
+
}
|
|
231
|
+
set skipPointerUpPicking(e) {
|
|
232
|
+
this._pointerPickingConfiguration.skipPointerUpPicking = e;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Gets the pointer coordinates without any translation (ie. straight out of the pointer event)
|
|
236
|
+
*/
|
|
237
|
+
get unTranslatedPointer() {
|
|
238
|
+
return this._inputManager.unTranslatedPointer;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Gets or sets the distance in pixel that you have to move to prevent some events. Default is 10 pixels
|
|
242
|
+
*/
|
|
243
|
+
static get DragMovementThreshold() {
|
|
244
|
+
return m.DragMovementThreshold;
|
|
245
|
+
}
|
|
246
|
+
static set DragMovementThreshold(e) {
|
|
247
|
+
m.DragMovementThreshold = e;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Time in milliseconds to wait to raise long press events if button is still pressed. Default is 500 ms
|
|
251
|
+
*/
|
|
252
|
+
static get LongPressDelay() {
|
|
253
|
+
return m.LongPressDelay;
|
|
254
|
+
}
|
|
255
|
+
static set LongPressDelay(e) {
|
|
256
|
+
m.LongPressDelay = e;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Time in milliseconds to wait to raise long press events if button is still pressed. Default is 300 ms
|
|
260
|
+
*/
|
|
261
|
+
static get DoubleClickDelay() {
|
|
262
|
+
return m.DoubleClickDelay;
|
|
263
|
+
}
|
|
264
|
+
static set DoubleClickDelay(e) {
|
|
265
|
+
m.DoubleClickDelay = e;
|
|
266
|
+
}
|
|
267
|
+
/** If you need to check double click without raising a single click at first click, enable this flag */
|
|
268
|
+
static get ExclusiveDoubleClickMode() {
|
|
269
|
+
return m.ExclusiveDoubleClickMode;
|
|
270
|
+
}
|
|
271
|
+
static set ExclusiveDoubleClickMode(e) {
|
|
272
|
+
m.ExclusiveDoubleClickMode = e;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Bind the current view position to an effect.
|
|
276
|
+
* @param effect The effect to be bound
|
|
277
|
+
* @param variableName name of the shader variable that will hold the eye position
|
|
278
|
+
* @param isVector3 true to indicates that variableName is a Vector3 and not a Vector4
|
|
279
|
+
* @returns the computed eye position
|
|
280
|
+
*/
|
|
281
|
+
bindEyePosition(e, t = "vEyePosition", i = !1) {
|
|
282
|
+
var r;
|
|
283
|
+
const s = this._forcedViewPosition ? this._forcedViewPosition : this._mirroredCameraPosition ? this._mirroredCameraPosition : (r = this.activeCamera.globalPosition) !== null && r !== void 0 ? r : this.activeCamera.devicePosition, n = this.useRightHandedSystem === (this._mirroredCameraPosition != null);
|
|
284
|
+
return b.Vector4[0].set(s.x, s.y, s.z, n ? -1 : 1), e && (i ? e.setFloat3(t, b.Vector4[0].x, b.Vector4[0].y, b.Vector4[0].z) : e.setVector4(t, b.Vector4[0])), b.Vector4[0];
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Update the scene ubo before it can be used in rendering processing
|
|
288
|
+
* @returns the scene UniformBuffer
|
|
289
|
+
*/
|
|
290
|
+
finalizeSceneUbo() {
|
|
291
|
+
const e = this.getSceneUniformBuffer(), t = this.bindEyePosition(null);
|
|
292
|
+
return e.updateFloat4("vEyePosition", t.x, t.y, t.z, t.w), e.update(), e;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Gets or sets a boolean indicating if the scene must use right-handed coordinates system
|
|
296
|
+
*/
|
|
297
|
+
set useRightHandedSystem(e) {
|
|
298
|
+
this._useRightHandedSystem !== e && (this._useRightHandedSystem = e, this.markAllMaterialsAsDirty(16));
|
|
299
|
+
}
|
|
300
|
+
get useRightHandedSystem() {
|
|
301
|
+
return this._useRightHandedSystem;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Sets the step Id used by deterministic lock step
|
|
305
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
306
|
+
* @param newStepId defines the step Id
|
|
307
|
+
*/
|
|
308
|
+
setStepId(e) {
|
|
309
|
+
this._currentStepId = e;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Gets the step Id used by deterministic lock step
|
|
313
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
314
|
+
* @returns the step Id
|
|
315
|
+
*/
|
|
316
|
+
getStepId() {
|
|
317
|
+
return this._currentStepId;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Gets the internal step used by deterministic lock step
|
|
321
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
322
|
+
* @returns the internal step
|
|
323
|
+
*/
|
|
324
|
+
getInternalStep() {
|
|
325
|
+
return this._currentInternalStep;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Gets or sets a boolean indicating if fog is enabled on this scene
|
|
329
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
|
|
330
|
+
* (Default is true)
|
|
331
|
+
*/
|
|
332
|
+
set fogEnabled(e) {
|
|
333
|
+
this._fogEnabled !== e && (this._fogEnabled = e, this.markAllMaterialsAsDirty(16));
|
|
334
|
+
}
|
|
335
|
+
get fogEnabled() {
|
|
336
|
+
return this._fogEnabled;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Gets or sets the fog mode to use
|
|
340
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
|
|
341
|
+
* | mode | value |
|
|
342
|
+
* | --- | --- |
|
|
343
|
+
* | FOGMODE_NONE | 0 |
|
|
344
|
+
* | FOGMODE_EXP | 1 |
|
|
345
|
+
* | FOGMODE_EXP2 | 2 |
|
|
346
|
+
* | FOGMODE_LINEAR | 3 |
|
|
347
|
+
*/
|
|
348
|
+
set fogMode(e) {
|
|
349
|
+
this._fogMode !== e && (this._fogMode = e, this.markAllMaterialsAsDirty(16));
|
|
350
|
+
}
|
|
351
|
+
get fogMode() {
|
|
352
|
+
return this._fogMode;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Flag indicating that the frame buffer binding is handled by another component
|
|
356
|
+
*/
|
|
357
|
+
get prePass() {
|
|
358
|
+
return !!this.prePassRenderer && this.prePassRenderer.defaultRT.enabled;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Gets or sets a boolean indicating if shadows are enabled on this scene
|
|
362
|
+
*/
|
|
363
|
+
set shadowsEnabled(e) {
|
|
364
|
+
this._shadowsEnabled !== e && (this._shadowsEnabled = e, this.markAllMaterialsAsDirty(2));
|
|
365
|
+
}
|
|
366
|
+
get shadowsEnabled() {
|
|
367
|
+
return this._shadowsEnabled;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Gets or sets a boolean indicating if lights are enabled on this scene
|
|
371
|
+
*/
|
|
372
|
+
set lightsEnabled(e) {
|
|
373
|
+
this._lightsEnabled !== e && (this._lightsEnabled = e, this.markAllMaterialsAsDirty(2));
|
|
374
|
+
}
|
|
375
|
+
get lightsEnabled() {
|
|
376
|
+
return this._lightsEnabled;
|
|
377
|
+
}
|
|
378
|
+
/** All of the active cameras added to this scene. */
|
|
379
|
+
get activeCameras() {
|
|
380
|
+
return this._activeCameras;
|
|
381
|
+
}
|
|
382
|
+
set activeCameras(e) {
|
|
383
|
+
this._unObserveActiveCameras && (this._unObserveActiveCameras(), this._unObserveActiveCameras = null), e && (this._unObserveActiveCameras = H(e, () => {
|
|
384
|
+
this.onActiveCamerasChanged.notifyObservers(this);
|
|
385
|
+
})), this._activeCameras = e;
|
|
386
|
+
}
|
|
387
|
+
/** Gets or sets the current active camera */
|
|
388
|
+
get activeCamera() {
|
|
389
|
+
return this._activeCamera;
|
|
390
|
+
}
|
|
391
|
+
set activeCamera(e) {
|
|
392
|
+
e !== this._activeCamera && (this._activeCamera = e, this.onActiveCameraChanged.notifyObservers(this));
|
|
393
|
+
}
|
|
394
|
+
/** The default material used on meshes when no material is affected */
|
|
395
|
+
get defaultMaterial() {
|
|
396
|
+
return this._defaultMaterial || (this._defaultMaterial = c.DefaultMaterialFactory(this)), this._defaultMaterial;
|
|
397
|
+
}
|
|
398
|
+
/** The default material used on meshes when no material is affected */
|
|
399
|
+
set defaultMaterial(e) {
|
|
400
|
+
this._defaultMaterial = e;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Gets or sets a boolean indicating if textures are enabled on this scene
|
|
404
|
+
*/
|
|
405
|
+
set texturesEnabled(e) {
|
|
406
|
+
this._texturesEnabled !== e && (this._texturesEnabled = e, this.markAllMaterialsAsDirty(1));
|
|
407
|
+
}
|
|
408
|
+
get texturesEnabled() {
|
|
409
|
+
return this._texturesEnabled;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Gets or sets a boolean indicating if skeletons are enabled on this scene
|
|
413
|
+
*/
|
|
414
|
+
set skeletonsEnabled(e) {
|
|
415
|
+
this._skeletonsEnabled !== e && (this._skeletonsEnabled = e, this.markAllMaterialsAsDirty(8));
|
|
416
|
+
}
|
|
417
|
+
get skeletonsEnabled() {
|
|
418
|
+
return this._skeletonsEnabled;
|
|
419
|
+
}
|
|
420
|
+
/** @internal */
|
|
421
|
+
get collisionCoordinator() {
|
|
422
|
+
return this._collisionCoordinator || (this._collisionCoordinator = c.CollisionCoordinatorFactory(), this._collisionCoordinator.init(this)), this._collisionCoordinator;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Gets the scene's rendering manager
|
|
426
|
+
*/
|
|
427
|
+
get renderingManager() {
|
|
428
|
+
return this._renderingManager;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Gets the list of frustum planes (built from the active camera)
|
|
432
|
+
*/
|
|
433
|
+
get frustumPlanes() {
|
|
434
|
+
return this._frustumPlanes;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Registers the transient components if needed.
|
|
438
|
+
*/
|
|
439
|
+
_registerTransientComponents() {
|
|
440
|
+
if (this._transientComponents.length > 0) {
|
|
441
|
+
for (const e of this._transientComponents)
|
|
442
|
+
e.register();
|
|
443
|
+
this._transientComponents.length = 0;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* @internal
|
|
448
|
+
* Add a component to the scene.
|
|
449
|
+
* Note that the ccomponent could be registered on th next frame if this is called after
|
|
450
|
+
* the register component stage.
|
|
451
|
+
* @param component Defines the component to add to the scene
|
|
452
|
+
*/
|
|
453
|
+
_addComponent(e) {
|
|
454
|
+
this._components.push(e), this._transientComponents.push(e);
|
|
455
|
+
const t = e;
|
|
456
|
+
t.addFromContainer && t.serialize && this._serializableComponents.push(t);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* @internal
|
|
460
|
+
* Gets a component from the scene.
|
|
461
|
+
* @param name defines the name of the component to retrieve
|
|
462
|
+
* @returns the component or null if not present
|
|
463
|
+
*/
|
|
464
|
+
_getComponent(e) {
|
|
465
|
+
for (const t of this._components)
|
|
466
|
+
if (t.name === e)
|
|
467
|
+
return t;
|
|
468
|
+
return null;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Creates a new Scene
|
|
472
|
+
* @param engine defines the engine to use to render this scene
|
|
473
|
+
* @param options defines the scene options
|
|
474
|
+
*/
|
|
475
|
+
constructor(e, t) {
|
|
476
|
+
super(), this._inputManager = new m(this), this.cameraToUseForPointers = null, this._isScene = !0, this._blockEntityCollection = !1, this.autoClear = !0, this.autoClearDepthAndStencil = !0, this.clearColor = new G(0.2, 0.2, 0.3, 1), this.ambientColor = new D(0, 0, 0), this.environmentIntensity = 1, this._performancePriority = M.BackwardCompatible, this.onScenePerformancePriorityChangedObservable = new h(), this._forceWireframe = !1, this._skipFrustumClipping = !1, this._forcePointsCloud = !1, this.animationsEnabled = !0, this._animationPropertiesOverride = null, this.useConstantAnimationDeltaTime = !1, this.constantlyUpdateMeshUnderPointer = !1, this.hoverCursor = "pointer", this.defaultCursor = "", this.doNotHandleCursors = !1, this.preventDefaultOnPointerDown = !0, this.preventDefaultOnPointerUp = !0, this.metadata = null, this.reservedDataStore = null, this.disableOfflineSupportExceptionRules = new Array(), this.onDisposeObservable = new h(), this._onDisposeObserver = null, this.onBeforeRenderObservable = new h(), this._onBeforeRenderObserver = null, this.onAfterRenderObservable = new h(), this.onAfterRenderCameraObservable = new h(), this._onAfterRenderObserver = null, this.onBeforeAnimationsObservable = new h(), this.onAfterAnimationsObservable = new h(), this.onBeforeDrawPhaseObservable = new h(), this.onAfterDrawPhaseObservable = new h(), this.onReadyObservable = new h(), this.onBeforeCameraRenderObservable = new h(), this._onBeforeCameraRenderObserver = null, this.onAfterCameraRenderObservable = new h(), this._onAfterCameraRenderObserver = null, this.onBeforeActiveMeshesEvaluationObservable = new h(), this.onAfterActiveMeshesEvaluationObservable = new h(), this.onBeforeParticlesRenderingObservable = new h(), this.onAfterParticlesRenderingObservable = new h(), this.onDataLoadedObservable = new h(), this.onNewCameraAddedObservable = new h(), this.onCameraRemovedObservable = new h(), this.onNewLightAddedObservable = new h(), this.onLightRemovedObservable = new h(), this.onNewGeometryAddedObservable = new h(), this.onGeometryRemovedObservable = new h(), this.onNewTransformNodeAddedObservable = new h(), this.onTransformNodeRemovedObservable = new h(), this.onNewMeshAddedObservable = new h(), this.onMeshRemovedObservable = new h(), this.onNewSkeletonAddedObservable = new h(), this.onSkeletonRemovedObservable = new h(), this.onNewMaterialAddedObservable = new h(), this.onNewMultiMaterialAddedObservable = new h(), this.onMaterialRemovedObservable = new h(), this.onMultiMaterialRemovedObservable = new h(), this.onNewTextureAddedObservable = new h(), this.onTextureRemovedObservable = new h(), this.onBeforeRenderTargetsRenderObservable = new h(), this.onAfterRenderTargetsRenderObservable = new h(), this.onBeforeStepObservable = new h(), this.onAfterStepObservable = new h(), this.onActiveCameraChanged = new h(), this.onActiveCamerasChanged = new h(), this.onBeforeRenderingGroupObservable = new h(), this.onAfterRenderingGroupObservable = new h(), this.onMeshImportedObservable = new h(), this.onAnimationFileImportedObservable = new h(), this._registeredForLateAnimationBindings = new v(256), this._pointerPickingConfiguration = new K(), this.onPrePointerObservable = new h(), this.onPointerObservable = new h(), this.onPreKeyboardObservable = new h(), this.onKeyboardObservable = new h(), this._useRightHandedSystem = !1, this._timeAccumulator = 0, this._currentStepId = 0, this._currentInternalStep = 0, this._fogEnabled = !0, this._fogMode = c.FOGMODE_NONE, this.fogColor = new D(0.2, 0.2, 0.3), this.fogDensity = 0.1, this.fogStart = 0, this.fogEnd = 1e3, this.needsPreviousWorldMatrices = !1, this._shadowsEnabled = !0, this._lightsEnabled = !0, this._unObserveActiveCameras = null, this._texturesEnabled = !0, this.physicsEnabled = !0, this.particlesEnabled = !0, this.spritesEnabled = !0, this._skeletonsEnabled = !0, this.lensFlaresEnabled = !0, this.collisionsEnabled = !0, this.gravity = new y(0, -9.807, 0), this.postProcessesEnabled = !0, this.renderTargetsEnabled = !0, this.dumpNextRenderTargets = !1, this.customRenderTargets = new Array(), this.importedMeshesFiles = new Array(), this.probesEnabled = !0, this._meshesForIntersections = new v(256), this.proceduralTexturesEnabled = !0, this._totalVertices = new O(), this._activeIndices = new O(), this._activeParticles = new O(), this._activeBones = new O(), this._animationTime = 0, this.animationTimeScale = 1, this._renderId = 0, this._frameId = 0, this._executeWhenReadyTimeoutId = null, this._intermediateRendering = !1, this._defaultFrameBufferCleared = !1, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1, this._toBeDisposed = new Array(256), this._activeRequests = new Array(), this._pendingData = new Array(), this._isDisposed = !1, this.dispatchAllSubMeshesOfActiveMeshes = !1, this._activeMeshes = new x(256), this._processedMaterials = new x(256), this._renderTargets = new v(256), this._materialsRenderTargets = new v(256), this._activeParticleSystems = new x(256), this._activeSkeletons = new v(32), this._softwareSkinnedMeshes = new v(32), this._activeAnimatables = new Array(), this._transformMatrix = F.Zero(), this.requireLightSorting = !1, this._components = [], this._serializableComponents = [], this._transientComponents = [], this._beforeCameraUpdateStage = d.Create(), this._beforeClearStage = d.Create(), this._beforeRenderTargetClearStage = d.Create(), this._gatherRenderTargetsStage = d.Create(), this._gatherActiveCameraRenderTargetsStage = d.Create(), this._isReadyForMeshStage = d.Create(), this._beforeEvaluateActiveMeshStage = d.Create(), this._evaluateSubMeshStage = d.Create(), this._preActiveMeshStage = d.Create(), this._cameraDrawRenderTargetStage = d.Create(), this._beforeCameraDrawStage = d.Create(), this._beforeRenderTargetDrawStage = d.Create(), this._beforeRenderingGroupDrawStage = d.Create(), this._beforeRenderingMeshStage = d.Create(), this._afterRenderingMeshStage = d.Create(), this._afterRenderingGroupDrawStage = d.Create(), this._afterCameraDrawStage = d.Create(), this._afterCameraPostProcessStage = d.Create(), this._afterRenderTargetDrawStage = d.Create(), this._afterRenderTargetPostProcessStage = d.Create(), this._afterRenderStage = d.Create(), this._pointerMoveStage = d.Create(), this._pointerDownStage = d.Create(), this._pointerUpStage = d.Create(), this._geometriesByUniqueId = null, this._defaultMeshCandidates = {
|
|
477
|
+
data: [],
|
|
478
|
+
length: 0
|
|
479
|
+
}, this._defaultSubMeshCandidates = {
|
|
480
|
+
data: [],
|
|
481
|
+
length: 0
|
|
482
|
+
}, this._preventFreeActiveMeshesAndRenderingGroups = !1, this._activeMeshesFrozen = !1, this._activeMeshesFrozenButKeepClipping = !1, this._skipEvaluateActiveMeshesCompletely = !1, this._allowPostProcessClearColor = !0, this.getDeterministicFrameTime = () => this._engine.getTimeStep(), this._registeredActions = 0, this._blockMaterialDirtyMechanism = !1, this._perfCollector = null, this.activeCameras = new Array();
|
|
483
|
+
const i = Object.assign({ useGeometryUniqueIdsMap: !0, useMaterialMeshMap: !0, useClonedMeshMap: !0, virtual: !1 }, t);
|
|
484
|
+
this._engine = e || R.LastCreatedEngine, i.virtual ? this._engine._virtualScenes.push(this) : (R._LastCreatedScene = this, this._engine.scenes.push(this)), this._uid = null, this._renderingManager = new L(this), B && (this.postProcessManager = new B(this)), q() && this.attachControl(), this._createUbo(), S && (this._imageProcessingConfiguration = new S()), this.setDefaultCandidateProviders(), i.useGeometryUniqueIdsMap && (this._geometriesByUniqueId = {}), this.useMaterialMeshMap = i.useMaterialMeshMap, this.useClonedMeshMap = i.useClonedMeshMap, (!t || !t.virtual) && this._engine.onNewSceneAddedObservable.notifyObservers(this);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Gets a string identifying the name of the class
|
|
488
|
+
* @returns "Scene" string
|
|
489
|
+
*/
|
|
490
|
+
getClassName() {
|
|
491
|
+
return "Scene";
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* @internal
|
|
495
|
+
*/
|
|
496
|
+
_getDefaultMeshCandidates() {
|
|
497
|
+
return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* @internal
|
|
501
|
+
*/
|
|
502
|
+
_getDefaultSubMeshCandidates(e) {
|
|
503
|
+
return this._defaultSubMeshCandidates.data = e.subMeshes, this._defaultSubMeshCandidates.length = e.subMeshes.length, this._defaultSubMeshCandidates;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Sets the default candidate providers for the scene.
|
|
507
|
+
* This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates
|
|
508
|
+
* and getCollidingSubMeshCandidates to their default function
|
|
509
|
+
*/
|
|
510
|
+
setDefaultCandidateProviders() {
|
|
511
|
+
this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this), this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this);
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Gets the mesh that is currently under the pointer
|
|
515
|
+
*/
|
|
516
|
+
get meshUnderPointer() {
|
|
517
|
+
return this._inputManager.meshUnderPointer;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Gets or sets the current on-screen X position of the pointer
|
|
521
|
+
*/
|
|
522
|
+
get pointerX() {
|
|
523
|
+
return this._inputManager.pointerX;
|
|
524
|
+
}
|
|
525
|
+
set pointerX(e) {
|
|
526
|
+
this._inputManager.pointerX = e;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Gets or sets the current on-screen Y position of the pointer
|
|
530
|
+
*/
|
|
531
|
+
get pointerY() {
|
|
532
|
+
return this._inputManager.pointerY;
|
|
533
|
+
}
|
|
534
|
+
set pointerY(e) {
|
|
535
|
+
this._inputManager.pointerY = e;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Gets the cached material (ie. the latest rendered one)
|
|
539
|
+
* @returns the cached material
|
|
540
|
+
*/
|
|
541
|
+
getCachedMaterial() {
|
|
542
|
+
return this._cachedMaterial;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Gets the cached effect (ie. the latest rendered one)
|
|
546
|
+
* @returns the cached effect
|
|
547
|
+
*/
|
|
548
|
+
getCachedEffect() {
|
|
549
|
+
return this._cachedEffect;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Gets the cached visibility state (ie. the latest rendered one)
|
|
553
|
+
* @returns the cached visibility state
|
|
554
|
+
*/
|
|
555
|
+
getCachedVisibility() {
|
|
556
|
+
return this._cachedVisibility;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Gets a boolean indicating if the current material / effect / visibility must be bind again
|
|
560
|
+
* @param material defines the current material
|
|
561
|
+
* @param effect defines the current effect
|
|
562
|
+
* @param visibility defines the current visibility state
|
|
563
|
+
* @returns true if one parameter is not cached
|
|
564
|
+
*/
|
|
565
|
+
isCachedMaterialInvalid(e, t, i = 1) {
|
|
566
|
+
return this._cachedEffect !== t || this._cachedMaterial !== e || this._cachedVisibility !== i;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Gets the engine associated with the scene
|
|
570
|
+
* @returns an Engine
|
|
571
|
+
*/
|
|
572
|
+
getEngine() {
|
|
573
|
+
return this._engine;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Gets the total number of vertices rendered per frame
|
|
577
|
+
* @returns the total number of vertices rendered per frame
|
|
578
|
+
*/
|
|
579
|
+
getTotalVertices() {
|
|
580
|
+
return this._totalVertices.current;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Gets the performance counter for total vertices
|
|
584
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
|
|
585
|
+
*/
|
|
586
|
+
get totalVerticesPerfCounter() {
|
|
587
|
+
return this._totalVertices;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Gets the total number of active indices rendered per frame (You can deduce the number of rendered triangles by dividing this number by 3)
|
|
591
|
+
* @returns the total number of active indices rendered per frame
|
|
592
|
+
*/
|
|
593
|
+
getActiveIndices() {
|
|
594
|
+
return this._activeIndices.current;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Gets the performance counter for active indices
|
|
598
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
|
|
599
|
+
*/
|
|
600
|
+
get totalActiveIndicesPerfCounter() {
|
|
601
|
+
return this._activeIndices;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Gets the total number of active particles rendered per frame
|
|
605
|
+
* @returns the total number of active particles rendered per frame
|
|
606
|
+
*/
|
|
607
|
+
getActiveParticles() {
|
|
608
|
+
return this._activeParticles.current;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Gets the performance counter for active particles
|
|
612
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
|
|
613
|
+
*/
|
|
614
|
+
get activeParticlesPerfCounter() {
|
|
615
|
+
return this._activeParticles;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Gets the total number of active bones rendered per frame
|
|
619
|
+
* @returns the total number of active bones rendered per frame
|
|
620
|
+
*/
|
|
621
|
+
getActiveBones() {
|
|
622
|
+
return this._activeBones.current;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Gets the performance counter for active bones
|
|
626
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
|
|
627
|
+
*/
|
|
628
|
+
get activeBonesPerfCounter() {
|
|
629
|
+
return this._activeBones;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Gets the array of active meshes
|
|
633
|
+
* @returns an array of AbstractMesh
|
|
634
|
+
*/
|
|
635
|
+
getActiveMeshes() {
|
|
636
|
+
return this._activeMeshes;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
|
|
640
|
+
* @returns a number
|
|
641
|
+
*/
|
|
642
|
+
getAnimationRatio() {
|
|
643
|
+
return this._animationRatio !== void 0 ? this._animationRatio : 1;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Gets an unique Id for the current render phase
|
|
647
|
+
* @returns a number
|
|
648
|
+
*/
|
|
649
|
+
getRenderId() {
|
|
650
|
+
return this._renderId;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Gets an unique Id for the current frame
|
|
654
|
+
* @returns a number
|
|
655
|
+
*/
|
|
656
|
+
getFrameId() {
|
|
657
|
+
return this._frameId;
|
|
658
|
+
}
|
|
659
|
+
/** Call this function if you want to manually increment the render Id*/
|
|
660
|
+
incrementRenderId() {
|
|
661
|
+
this._renderId++;
|
|
662
|
+
}
|
|
663
|
+
_createUbo() {
|
|
664
|
+
this.setSceneUniformBuffer(this.createSceneUniformBuffer());
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Use this method to simulate a pointer move on a mesh
|
|
668
|
+
* The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
|
|
669
|
+
* @param pickResult pickingInfo of the object wished to simulate pointer event on
|
|
670
|
+
* @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
|
|
671
|
+
* @returns the current scene
|
|
672
|
+
*/
|
|
673
|
+
simulatePointerMove(e, t) {
|
|
674
|
+
return this._inputManager.simulatePointerMove(e, t), this;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Use this method to simulate a pointer down on a mesh
|
|
678
|
+
* The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
|
|
679
|
+
* @param pickResult pickingInfo of the object wished to simulate pointer event on
|
|
680
|
+
* @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
|
|
681
|
+
* @returns the current scene
|
|
682
|
+
*/
|
|
683
|
+
simulatePointerDown(e, t) {
|
|
684
|
+
return this._inputManager.simulatePointerDown(e, t), this;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Use this method to simulate a pointer up on a mesh
|
|
688
|
+
* The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
|
|
689
|
+
* @param pickResult pickingInfo of the object wished to simulate pointer event on
|
|
690
|
+
* @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
|
|
691
|
+
* @param doubleTap indicates that the pointer up event should be considered as part of a double click (false by default)
|
|
692
|
+
* @returns the current scene
|
|
693
|
+
*/
|
|
694
|
+
simulatePointerUp(e, t, i) {
|
|
695
|
+
return this._inputManager.simulatePointerUp(e, t, i), this;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)
|
|
699
|
+
* @param pointerId defines the pointer id to use in a multi-touch scenario (0 by default)
|
|
700
|
+
* @returns true if the pointer was captured
|
|
701
|
+
*/
|
|
702
|
+
isPointerCaptured(e = 0) {
|
|
703
|
+
return this._inputManager.isPointerCaptured(e);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp
|
|
707
|
+
* @param attachUp defines if you want to attach events to pointerup
|
|
708
|
+
* @param attachDown defines if you want to attach events to pointerdown
|
|
709
|
+
* @param attachMove defines if you want to attach events to pointermove
|
|
710
|
+
*/
|
|
711
|
+
attachControl(e = !0, t = !0, i = !0) {
|
|
712
|
+
this._inputManager.attachControl(e, t, i);
|
|
713
|
+
}
|
|
714
|
+
/** Detaches all event handlers*/
|
|
715
|
+
detachControl() {
|
|
716
|
+
this._inputManager.detachControl();
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
|
|
720
|
+
* Delay loaded resources are not taking in account
|
|
721
|
+
* @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: true)
|
|
722
|
+
* @returns true if all required resources are ready
|
|
723
|
+
*/
|
|
724
|
+
isReady(e = !0) {
|
|
725
|
+
var t, i, r;
|
|
726
|
+
if (this._isDisposed)
|
|
727
|
+
return !1;
|
|
728
|
+
let s;
|
|
729
|
+
const n = this.getEngine(), l = n.currentRenderPassId;
|
|
730
|
+
n.currentRenderPassId = (i = (t = this.activeCamera) === null || t === void 0 ? void 0 : t.renderPassId) !== null && i !== void 0 ? i : l;
|
|
731
|
+
let a = !0;
|
|
732
|
+
for (this._pendingData.length > 0 && (a = !1), (r = this.prePassRenderer) === null || r === void 0 || r.update(), e && (this._processedMaterials.reset(), this._materialsRenderTargets.reset()), s = 0; s < this.meshes.length; s++) {
|
|
733
|
+
const o = this.meshes[s];
|
|
734
|
+
if (!o.subMeshes || o.subMeshes.length === 0)
|
|
735
|
+
continue;
|
|
736
|
+
if (!o.isReady(!0)) {
|
|
737
|
+
a = !1;
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
const u = o.hasThinInstances || o.getClassName() === "InstancedMesh" || o.getClassName() === "InstancedLinesMesh" || n.getCaps().instancedArrays && o.instances.length > 0;
|
|
741
|
+
for (const A of this._isReadyForMeshStage)
|
|
742
|
+
A.action(o, u) || (a = !1);
|
|
743
|
+
if (!e)
|
|
744
|
+
continue;
|
|
745
|
+
const g = o.material || this.defaultMaterial;
|
|
746
|
+
if (g)
|
|
747
|
+
if (g._storeEffectOnSubMeshes)
|
|
748
|
+
for (const A of o.subMeshes) {
|
|
749
|
+
const p = A.getMaterial();
|
|
750
|
+
p && p.hasRenderTargetTextures && p.getRenderTargetTextures != null && this._processedMaterials.indexOf(p) === -1 && (this._processedMaterials.push(p), this._materialsRenderTargets.concatWithNoDuplicate(p.getRenderTargetTextures()));
|
|
751
|
+
}
|
|
752
|
+
else
|
|
753
|
+
g.hasRenderTargetTextures && g.getRenderTargetTextures != null && this._processedMaterials.indexOf(g) === -1 && (this._processedMaterials.push(g), this._materialsRenderTargets.concatWithNoDuplicate(g.getRenderTargetTextures()));
|
|
754
|
+
}
|
|
755
|
+
if (e)
|
|
756
|
+
for (s = 0; s < this._materialsRenderTargets.length; ++s)
|
|
757
|
+
this._materialsRenderTargets.data[s].isReadyForRendering() || (a = !1);
|
|
758
|
+
for (s = 0; s < this.geometries.length; s++)
|
|
759
|
+
this.geometries[s].delayLoadState === 2 && (a = !1);
|
|
760
|
+
if (this.activeCameras && this.activeCameras.length > 0)
|
|
761
|
+
for (const o of this.activeCameras)
|
|
762
|
+
o.isReady(!0) || (a = !1);
|
|
763
|
+
else
|
|
764
|
+
this.activeCamera && (this.activeCamera.isReady(!0) || (a = !1));
|
|
765
|
+
for (const o of this.particleSystems)
|
|
766
|
+
o.isReady() || (a = !1);
|
|
767
|
+
if (this.layers)
|
|
768
|
+
for (const o of this.layers)
|
|
769
|
+
o.isReady() || (a = !1);
|
|
770
|
+
return n.areAllEffectsReady() || (a = !1), n.currentRenderPassId = l, a;
|
|
771
|
+
}
|
|
772
|
+
/** Resets all cached information relative to material (including effect and visibility) */
|
|
773
|
+
resetCachedMaterial() {
|
|
774
|
+
this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Registers a function to be called before every frame render
|
|
778
|
+
* @param func defines the function to register
|
|
779
|
+
*/
|
|
780
|
+
registerBeforeRender(e) {
|
|
781
|
+
this.onBeforeRenderObservable.add(e);
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Unregisters a function called before every frame render
|
|
785
|
+
* @param func defines the function to unregister
|
|
786
|
+
*/
|
|
787
|
+
unregisterBeforeRender(e) {
|
|
788
|
+
this.onBeforeRenderObservable.removeCallback(e);
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Registers a function to be called after every frame render
|
|
792
|
+
* @param func defines the function to register
|
|
793
|
+
*/
|
|
794
|
+
registerAfterRender(e) {
|
|
795
|
+
this.onAfterRenderObservable.add(e);
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Unregisters a function called after every frame render
|
|
799
|
+
* @param func defines the function to unregister
|
|
800
|
+
*/
|
|
801
|
+
unregisterAfterRender(e) {
|
|
802
|
+
this.onAfterRenderObservable.removeCallback(e);
|
|
803
|
+
}
|
|
804
|
+
_executeOnceBeforeRender(e) {
|
|
805
|
+
const t = () => {
|
|
806
|
+
e(), setTimeout(() => {
|
|
807
|
+
this.unregisterBeforeRender(t);
|
|
808
|
+
});
|
|
809
|
+
};
|
|
810
|
+
this.registerBeforeRender(t);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* The provided function will run before render once and will be disposed afterwards.
|
|
814
|
+
* A timeout delay can be provided so that the function will be executed in N ms.
|
|
815
|
+
* The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.
|
|
816
|
+
* @param func The function to be executed.
|
|
817
|
+
* @param timeout optional delay in ms
|
|
818
|
+
*/
|
|
819
|
+
executeOnceBeforeRender(e, t) {
|
|
820
|
+
t !== void 0 ? setTimeout(() => {
|
|
821
|
+
this._executeOnceBeforeRender(e);
|
|
822
|
+
}, t) : this._executeOnceBeforeRender(e);
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* This function can help adding any object to the list of data awaited to be ready in order to check for a complete scene loading.
|
|
826
|
+
* @param data defines the object to wait for
|
|
827
|
+
*/
|
|
828
|
+
addPendingData(e) {
|
|
829
|
+
this._pendingData.push(e);
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Remove a pending data from the loading list which has previously been added with addPendingData.
|
|
833
|
+
* @param data defines the object to remove from the pending list
|
|
834
|
+
*/
|
|
835
|
+
removePendingData(e) {
|
|
836
|
+
const t = this.isLoading, i = this._pendingData.indexOf(e);
|
|
837
|
+
i !== -1 && this._pendingData.splice(i, 1), t && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Returns the number of items waiting to be loaded
|
|
841
|
+
* @returns the number of items waiting to be loaded
|
|
842
|
+
*/
|
|
843
|
+
getWaitingItemsCount() {
|
|
844
|
+
return this._pendingData.length;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Returns a boolean indicating if the scene is still loading data
|
|
848
|
+
*/
|
|
849
|
+
get isLoading() {
|
|
850
|
+
return this._pendingData.length > 0;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Registers a function to be executed when the scene is ready
|
|
854
|
+
* @param func - the function to be executed
|
|
855
|
+
* @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
|
|
856
|
+
*/
|
|
857
|
+
executeWhenReady(e, t = !1) {
|
|
858
|
+
this.onReadyObservable.addOnce(e), this._executeWhenReadyTimeoutId === null && this._checkIsReady(t);
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Returns a promise that resolves when the scene is ready
|
|
862
|
+
* @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
|
|
863
|
+
* @returns A promise that resolves when the scene is ready
|
|
864
|
+
*/
|
|
865
|
+
whenReadyAsync(e = !1) {
|
|
866
|
+
return new Promise((t) => {
|
|
867
|
+
this.executeWhenReady(() => {
|
|
868
|
+
t();
|
|
869
|
+
}, e);
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* @internal
|
|
874
|
+
*/
|
|
875
|
+
_checkIsReady(e = !1) {
|
|
876
|
+
if (this._registerTransientComponents(), this.isReady(e)) {
|
|
877
|
+
this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), this._executeWhenReadyTimeoutId = null;
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
if (this._isDisposed) {
|
|
881
|
+
this.onReadyObservable.clear(), this._executeWhenReadyTimeoutId = null;
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
this._executeWhenReadyTimeoutId = setTimeout(() => {
|
|
885
|
+
this.incrementRenderId(), this._checkIsReady(e);
|
|
886
|
+
}, 100);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Gets all animatable attached to the scene
|
|
890
|
+
*/
|
|
891
|
+
get animatables() {
|
|
892
|
+
return this._activeAnimatables;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Resets the last animation time frame.
|
|
896
|
+
* Useful to override when animations start running when loading a scene for the first time.
|
|
897
|
+
*/
|
|
898
|
+
resetLastAnimationTimeFrame() {
|
|
899
|
+
this._animationTimeLast = N.Now;
|
|
900
|
+
}
|
|
901
|
+
// Matrix
|
|
902
|
+
/**
|
|
903
|
+
* Gets the current view matrix
|
|
904
|
+
* @returns a Matrix
|
|
905
|
+
*/
|
|
906
|
+
getViewMatrix() {
|
|
907
|
+
return this._viewMatrix;
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Gets the current projection matrix
|
|
911
|
+
* @returns a Matrix
|
|
912
|
+
*/
|
|
913
|
+
getProjectionMatrix() {
|
|
914
|
+
return this._projectionMatrix;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Gets the current transform matrix
|
|
918
|
+
* @returns a Matrix made of View * Projection
|
|
919
|
+
*/
|
|
920
|
+
getTransformMatrix() {
|
|
921
|
+
return this._transformMatrix;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Sets the current transform matrix
|
|
925
|
+
* @param viewL defines the View matrix to use
|
|
926
|
+
* @param projectionL defines the Projection matrix to use
|
|
927
|
+
* @param viewR defines the right View matrix to use (if provided)
|
|
928
|
+
* @param projectionR defines the right Projection matrix to use (if provided)
|
|
929
|
+
*/
|
|
930
|
+
setTransformMatrix(e, t, i, r) {
|
|
931
|
+
!i && !r && this._multiviewSceneUbo && (this._multiviewSceneUbo.dispose(), this._multiviewSceneUbo = null), !(this._viewUpdateFlag === e.updateFlag && this._projectionUpdateFlag === t.updateFlag) && (this._viewUpdateFlag = e.updateFlag, this._projectionUpdateFlag = t.updateFlag, this._viewMatrix = e, this._projectionMatrix = t, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? k.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = k.GetPlanes(this._transformMatrix), this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo ? this._updateMultiviewUbo(i, r) : this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix), this._sceneUbo.updateMatrix("view", this._viewMatrix), this._sceneUbo.updateMatrix("projection", this._projectionMatrix)));
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Gets the uniform buffer used to store scene data
|
|
935
|
+
* @returns a UniformBuffer
|
|
936
|
+
*/
|
|
937
|
+
getSceneUniformBuffer() {
|
|
938
|
+
return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Creates a scene UBO
|
|
942
|
+
* @param name name of the uniform buffer (optional, for debugging purpose only)
|
|
943
|
+
* @returns a new ubo
|
|
944
|
+
*/
|
|
945
|
+
createSceneUniformBuffer(e) {
|
|
946
|
+
const t = new U(this._engine, void 0, !1, e ?? "scene");
|
|
947
|
+
return t.addUniform("viewProjection", 16), t.addUniform("view", 16), t.addUniform("projection", 16), t.addUniform("vEyePosition", 4), t;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Sets the scene ubo
|
|
951
|
+
* @param ubo the ubo to set for the scene
|
|
952
|
+
*/
|
|
953
|
+
setSceneUniformBuffer(e) {
|
|
954
|
+
this._sceneUbo = e, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Gets an unique (relatively to the current scene) Id
|
|
958
|
+
* @returns an unique number for the scene
|
|
959
|
+
*/
|
|
960
|
+
getUniqueId() {
|
|
961
|
+
return V.UniqueId;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Add a mesh to the list of scene's meshes
|
|
965
|
+
* @param newMesh defines the mesh to add
|
|
966
|
+
* @param recursive if all child meshes should also be added to the scene
|
|
967
|
+
*/
|
|
968
|
+
addMesh(e, t = !1) {
|
|
969
|
+
this._blockEntityCollection || (this.meshes.push(e), e._resyncLightSources(), e.parent || e._addToSceneRootNodes(), this.onNewMeshAddedObservable.notifyObservers(e), t && e.getChildMeshes().forEach((i) => {
|
|
970
|
+
this.addMesh(i);
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Remove a mesh for the list of scene's meshes
|
|
975
|
+
* @param toRemove defines the mesh to remove
|
|
976
|
+
* @param recursive if all child meshes should also be removed from the scene
|
|
977
|
+
* @returns the index where the mesh was in the mesh list
|
|
978
|
+
*/
|
|
979
|
+
removeMesh(e, t = !1) {
|
|
980
|
+
const i = this.meshes.indexOf(e);
|
|
981
|
+
return i !== -1 && (this.meshes[i] = this.meshes[this.meshes.length - 1], this.meshes.pop(), e.parent || e._removeFromSceneRootNodes()), this._inputManager._invalidateMesh(e), this.onMeshRemovedObservable.notifyObservers(e), t && e.getChildMeshes().forEach((r) => {
|
|
982
|
+
this.removeMesh(r);
|
|
983
|
+
}), i;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Add a transform node to the list of scene's transform nodes
|
|
987
|
+
* @param newTransformNode defines the transform node to add
|
|
988
|
+
*/
|
|
989
|
+
addTransformNode(e) {
|
|
990
|
+
this._blockEntityCollection || e.getScene() === this && e._indexInSceneTransformNodesArray !== -1 || (e._indexInSceneTransformNodesArray = this.transformNodes.length, this.transformNodes.push(e), e.parent || e._addToSceneRootNodes(), this.onNewTransformNodeAddedObservable.notifyObservers(e));
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Remove a transform node for the list of scene's transform nodes
|
|
994
|
+
* @param toRemove defines the transform node to remove
|
|
995
|
+
* @returns the index where the transform node was in the transform node list
|
|
996
|
+
*/
|
|
997
|
+
removeTransformNode(e) {
|
|
998
|
+
const t = e._indexInSceneTransformNodesArray;
|
|
999
|
+
if (t !== -1) {
|
|
1000
|
+
if (t !== this.transformNodes.length - 1) {
|
|
1001
|
+
const i = this.transformNodes[this.transformNodes.length - 1];
|
|
1002
|
+
this.transformNodes[t] = i, i._indexInSceneTransformNodesArray = t;
|
|
1003
|
+
}
|
|
1004
|
+
e._indexInSceneTransformNodesArray = -1, this.transformNodes.pop(), e.parent || e._removeFromSceneRootNodes();
|
|
1005
|
+
}
|
|
1006
|
+
return this.onTransformNodeRemovedObservable.notifyObservers(e), t;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Remove a skeleton for the list of scene's skeletons
|
|
1010
|
+
* @param toRemove defines the skeleton to remove
|
|
1011
|
+
* @returns the index where the skeleton was in the skeleton list
|
|
1012
|
+
*/
|
|
1013
|
+
removeSkeleton(e) {
|
|
1014
|
+
const t = this.skeletons.indexOf(e);
|
|
1015
|
+
return t !== -1 && (this.skeletons.splice(t, 1), this.onSkeletonRemovedObservable.notifyObservers(e), this._executeActiveContainerCleanup(this._activeSkeletons)), t;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Remove a morph target for the list of scene's morph targets
|
|
1019
|
+
* @param toRemove defines the morph target to remove
|
|
1020
|
+
* @returns the index where the morph target was in the morph target list
|
|
1021
|
+
*/
|
|
1022
|
+
removeMorphTargetManager(e) {
|
|
1023
|
+
const t = this.morphTargetManagers.indexOf(e);
|
|
1024
|
+
return t !== -1 && this.morphTargetManagers.splice(t, 1), t;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Remove a light for the list of scene's lights
|
|
1028
|
+
* @param toRemove defines the light to remove
|
|
1029
|
+
* @returns the index where the light was in the light list
|
|
1030
|
+
*/
|
|
1031
|
+
removeLight(e) {
|
|
1032
|
+
const t = this.lights.indexOf(e);
|
|
1033
|
+
if (t !== -1) {
|
|
1034
|
+
for (const i of this.meshes)
|
|
1035
|
+
i._removeLightSource(e, !1);
|
|
1036
|
+
this.lights.splice(t, 1), this.sortLightsByPriority(), e.parent || e._removeFromSceneRootNodes();
|
|
1037
|
+
}
|
|
1038
|
+
return this.onLightRemovedObservable.notifyObservers(e), t;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Remove a camera for the list of scene's cameras
|
|
1042
|
+
* @param toRemove defines the camera to remove
|
|
1043
|
+
* @returns the index where the camera was in the camera list
|
|
1044
|
+
*/
|
|
1045
|
+
removeCamera(e) {
|
|
1046
|
+
const t = this.cameras.indexOf(e);
|
|
1047
|
+
if (t !== -1 && (this.cameras.splice(t, 1), e.parent || e._removeFromSceneRootNodes()), this.activeCameras) {
|
|
1048
|
+
const i = this.activeCameras.indexOf(e);
|
|
1049
|
+
i !== -1 && this.activeCameras.splice(i, 1);
|
|
1050
|
+
}
|
|
1051
|
+
return this.activeCamera === e && (this.cameras.length > 0 ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(e), t;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Remove a particle system for the list of scene's particle systems
|
|
1055
|
+
* @param toRemove defines the particle system to remove
|
|
1056
|
+
* @returns the index where the particle system was in the particle system list
|
|
1057
|
+
*/
|
|
1058
|
+
removeParticleSystem(e) {
|
|
1059
|
+
const t = this.particleSystems.indexOf(e);
|
|
1060
|
+
return t !== -1 && (this.particleSystems.splice(t, 1), this._executeActiveContainerCleanup(this._activeParticleSystems)), t;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Remove a animation for the list of scene's animations
|
|
1064
|
+
* @param toRemove defines the animation to remove
|
|
1065
|
+
* @returns the index where the animation was in the animation list
|
|
1066
|
+
*/
|
|
1067
|
+
removeAnimation(e) {
|
|
1068
|
+
const t = this.animations.indexOf(e);
|
|
1069
|
+
return t !== -1 && this.animations.splice(t, 1), t;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Will stop the animation of the given target
|
|
1073
|
+
* @param target - the target
|
|
1074
|
+
* @param animationName - the name of the animation to stop (all animations will be stopped if both this and targetMask are empty)
|
|
1075
|
+
* @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
|
|
1076
|
+
*/
|
|
1077
|
+
stopAnimation(e, t, i) {
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Removes the given animation group from this scene.
|
|
1081
|
+
* @param toRemove The animation group to remove
|
|
1082
|
+
* @returns The index of the removed animation group
|
|
1083
|
+
*/
|
|
1084
|
+
removeAnimationGroup(e) {
|
|
1085
|
+
const t = this.animationGroups.indexOf(e);
|
|
1086
|
+
return t !== -1 && this.animationGroups.splice(t, 1), t;
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Removes the given multi-material from this scene.
|
|
1090
|
+
* @param toRemove The multi-material to remove
|
|
1091
|
+
* @returns The index of the removed multi-material
|
|
1092
|
+
*/
|
|
1093
|
+
removeMultiMaterial(e) {
|
|
1094
|
+
const t = this.multiMaterials.indexOf(e);
|
|
1095
|
+
return t !== -1 && this.multiMaterials.splice(t, 1), this.onMultiMaterialRemovedObservable.notifyObservers(e), t;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Removes the given material from this scene.
|
|
1099
|
+
* @param toRemove The material to remove
|
|
1100
|
+
* @returns The index of the removed material
|
|
1101
|
+
*/
|
|
1102
|
+
removeMaterial(e) {
|
|
1103
|
+
const t = e._indexInSceneMaterialArray;
|
|
1104
|
+
if (t !== -1 && t < this.materials.length) {
|
|
1105
|
+
if (t !== this.materials.length - 1) {
|
|
1106
|
+
const i = this.materials[this.materials.length - 1];
|
|
1107
|
+
this.materials[t] = i, i._indexInSceneMaterialArray = t;
|
|
1108
|
+
}
|
|
1109
|
+
e._indexInSceneMaterialArray = -1, this.materials.pop();
|
|
1110
|
+
}
|
|
1111
|
+
return this.onMaterialRemovedObservable.notifyObservers(e), t;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Removes the given action manager from this scene.
|
|
1115
|
+
* @deprecated
|
|
1116
|
+
* @param toRemove The action manager to remove
|
|
1117
|
+
* @returns The index of the removed action manager
|
|
1118
|
+
*/
|
|
1119
|
+
removeActionManager(e) {
|
|
1120
|
+
const t = this.actionManagers.indexOf(e);
|
|
1121
|
+
return t !== -1 && this.actionManagers.splice(t, 1), t;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Removes the given texture from this scene.
|
|
1125
|
+
* @param toRemove The texture to remove
|
|
1126
|
+
* @returns The index of the removed texture
|
|
1127
|
+
*/
|
|
1128
|
+
removeTexture(e) {
|
|
1129
|
+
const t = this.textures.indexOf(e);
|
|
1130
|
+
return t !== -1 && this.textures.splice(t, 1), this.onTextureRemovedObservable.notifyObservers(e), t;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Adds the given light to this scene
|
|
1134
|
+
* @param newLight The light to add
|
|
1135
|
+
*/
|
|
1136
|
+
addLight(e) {
|
|
1137
|
+
if (!this._blockEntityCollection) {
|
|
1138
|
+
this.lights.push(e), this.sortLightsByPriority(), e.parent || e._addToSceneRootNodes();
|
|
1139
|
+
for (const t of this.meshes)
|
|
1140
|
+
t.lightSources.indexOf(e) === -1 && (t.lightSources.push(e), t._resyncLightSources());
|
|
1141
|
+
this.onNewLightAddedObservable.notifyObservers(e);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Sorts the list list based on light priorities
|
|
1146
|
+
*/
|
|
1147
|
+
sortLightsByPriority() {
|
|
1148
|
+
this.requireLightSorting && this.lights.sort(X.CompareLightsPriority);
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Adds the given camera to this scene
|
|
1152
|
+
* @param newCamera The camera to add
|
|
1153
|
+
*/
|
|
1154
|
+
addCamera(e) {
|
|
1155
|
+
this._blockEntityCollection || (this.cameras.push(e), this.onNewCameraAddedObservable.notifyObservers(e), e.parent || e._addToSceneRootNodes());
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Adds the given skeleton to this scene
|
|
1159
|
+
* @param newSkeleton The skeleton to add
|
|
1160
|
+
*/
|
|
1161
|
+
addSkeleton(e) {
|
|
1162
|
+
this._blockEntityCollection || (this.skeletons.push(e), this.onNewSkeletonAddedObservable.notifyObservers(e));
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Adds the given particle system to this scene
|
|
1166
|
+
* @param newParticleSystem The particle system to add
|
|
1167
|
+
*/
|
|
1168
|
+
addParticleSystem(e) {
|
|
1169
|
+
this._blockEntityCollection || this.particleSystems.push(e);
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Adds the given animation to this scene
|
|
1173
|
+
* @param newAnimation The animation to add
|
|
1174
|
+
*/
|
|
1175
|
+
addAnimation(e) {
|
|
1176
|
+
this._blockEntityCollection || this.animations.push(e);
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Adds the given animation group to this scene.
|
|
1180
|
+
* @param newAnimationGroup The animation group to add
|
|
1181
|
+
*/
|
|
1182
|
+
addAnimationGroup(e) {
|
|
1183
|
+
this._blockEntityCollection || this.animationGroups.push(e);
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Adds the given multi-material to this scene
|
|
1187
|
+
* @param newMultiMaterial The multi-material to add
|
|
1188
|
+
*/
|
|
1189
|
+
addMultiMaterial(e) {
|
|
1190
|
+
this._blockEntityCollection || (this.multiMaterials.push(e), this.onNewMultiMaterialAddedObservable.notifyObservers(e));
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Adds the given material to this scene
|
|
1194
|
+
* @param newMaterial The material to add
|
|
1195
|
+
*/
|
|
1196
|
+
addMaterial(e) {
|
|
1197
|
+
this._blockEntityCollection || e.getScene() === this && e._indexInSceneMaterialArray !== -1 || (e._indexInSceneMaterialArray = this.materials.length, this.materials.push(e), this.onNewMaterialAddedObservable.notifyObservers(e));
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Adds the given morph target to this scene
|
|
1201
|
+
* @param newMorphTargetManager The morph target to add
|
|
1202
|
+
*/
|
|
1203
|
+
addMorphTargetManager(e) {
|
|
1204
|
+
this._blockEntityCollection || this.morphTargetManagers.push(e);
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Adds the given geometry to this scene
|
|
1208
|
+
* @param newGeometry The geometry to add
|
|
1209
|
+
*/
|
|
1210
|
+
addGeometry(e) {
|
|
1211
|
+
this._blockEntityCollection || (this._geometriesByUniqueId && (this._geometriesByUniqueId[e.uniqueId] = this.geometries.length), this.geometries.push(e));
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Adds the given action manager to this scene
|
|
1215
|
+
* @deprecated
|
|
1216
|
+
* @param newActionManager The action manager to add
|
|
1217
|
+
*/
|
|
1218
|
+
addActionManager(e) {
|
|
1219
|
+
this.actionManagers.push(e);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Adds the given texture to this scene.
|
|
1223
|
+
* @param newTexture The texture to add
|
|
1224
|
+
*/
|
|
1225
|
+
addTexture(e) {
|
|
1226
|
+
this._blockEntityCollection || (this.textures.push(e), this.onNewTextureAddedObservable.notifyObservers(e));
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Switch active camera
|
|
1230
|
+
* @param newCamera defines the new active camera
|
|
1231
|
+
* @param attachControl defines if attachControl must be called for the new active camera (default: true)
|
|
1232
|
+
*/
|
|
1233
|
+
switchActiveCamera(e, t = !0) {
|
|
1234
|
+
this._engine.getInputElement() && (this.activeCamera && this.activeCamera.detachControl(), this.activeCamera = e, t && e.attachControl());
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* sets the active camera of the scene using its Id
|
|
1238
|
+
* @param id defines the camera's Id
|
|
1239
|
+
* @returns the new active camera or null if none found.
|
|
1240
|
+
*/
|
|
1241
|
+
setActiveCameraById(e) {
|
|
1242
|
+
const t = this.getCameraById(e);
|
|
1243
|
+
return t ? (this.activeCamera = t, t) : null;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* sets the active camera of the scene using its name
|
|
1247
|
+
* @param name defines the camera's name
|
|
1248
|
+
* @returns the new active camera or null if none found.
|
|
1249
|
+
*/
|
|
1250
|
+
setActiveCameraByName(e) {
|
|
1251
|
+
const t = this.getCameraByName(e);
|
|
1252
|
+
return t ? (this.activeCamera = t, t) : null;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* get an animation group using its name
|
|
1256
|
+
* @param name defines the material's name
|
|
1257
|
+
* @returns the animation group or null if none found.
|
|
1258
|
+
*/
|
|
1259
|
+
getAnimationGroupByName(e) {
|
|
1260
|
+
for (let t = 0; t < this.animationGroups.length; t++)
|
|
1261
|
+
if (this.animationGroups[t].name === e)
|
|
1262
|
+
return this.animationGroups[t];
|
|
1263
|
+
return null;
|
|
1264
|
+
}
|
|
1265
|
+
_getMaterial(e, t) {
|
|
1266
|
+
for (let i = 0; i < this.materials.length; i++) {
|
|
1267
|
+
const r = this.materials[i];
|
|
1268
|
+
if (t(r))
|
|
1269
|
+
return r;
|
|
1270
|
+
}
|
|
1271
|
+
if (e)
|
|
1272
|
+
for (let i = 0; i < this.multiMaterials.length; i++) {
|
|
1273
|
+
const r = this.multiMaterials[i];
|
|
1274
|
+
if (t(r))
|
|
1275
|
+
return r;
|
|
1276
|
+
}
|
|
1277
|
+
return null;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Get a material using its unique id
|
|
1281
|
+
* @param uniqueId defines the material's unique id
|
|
1282
|
+
* @param allowMultiMaterials determines whether multimaterials should be considered
|
|
1283
|
+
* @returns the material or null if none found.
|
|
1284
|
+
*/
|
|
1285
|
+
getMaterialByUniqueID(e, t = !1) {
|
|
1286
|
+
return this._getMaterial(t, (i) => i.uniqueId === e);
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* get a material using its id
|
|
1290
|
+
* @param id defines the material's Id
|
|
1291
|
+
* @param allowMultiMaterials determines whether multimaterials should be considered
|
|
1292
|
+
* @returns the material or null if none found.
|
|
1293
|
+
*/
|
|
1294
|
+
getMaterialById(e, t = !1) {
|
|
1295
|
+
return this._getMaterial(t, (i) => i.id === e);
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Gets a material using its name
|
|
1299
|
+
* @param name defines the material's name
|
|
1300
|
+
* @param allowMultiMaterials determines whether multimaterials should be considered
|
|
1301
|
+
* @returns the material or null if none found.
|
|
1302
|
+
*/
|
|
1303
|
+
getMaterialByName(e, t = !1) {
|
|
1304
|
+
return this._getMaterial(t, (i) => i.name === e);
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Gets a last added material using a given id
|
|
1308
|
+
* @param id defines the material's id
|
|
1309
|
+
* @param allowMultiMaterials determines whether multimaterials should be considered
|
|
1310
|
+
* @returns the last material with the given id or null if none found.
|
|
1311
|
+
*/
|
|
1312
|
+
getLastMaterialById(e, t = !1) {
|
|
1313
|
+
for (let i = this.materials.length - 1; i >= 0; i--)
|
|
1314
|
+
if (this.materials[i].id === e)
|
|
1315
|
+
return this.materials[i];
|
|
1316
|
+
if (t) {
|
|
1317
|
+
for (let i = this.multiMaterials.length - 1; i >= 0; i--)
|
|
1318
|
+
if (this.multiMaterials[i].id === e)
|
|
1319
|
+
return this.multiMaterials[i];
|
|
1320
|
+
}
|
|
1321
|
+
return null;
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Get a texture using its unique id
|
|
1325
|
+
* @param uniqueId defines the texture's unique id
|
|
1326
|
+
* @returns the texture or null if none found.
|
|
1327
|
+
*/
|
|
1328
|
+
getTextureByUniqueId(e) {
|
|
1329
|
+
for (let t = 0; t < this.textures.length; t++)
|
|
1330
|
+
if (this.textures[t].uniqueId === e)
|
|
1331
|
+
return this.textures[t];
|
|
1332
|
+
return null;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Gets a texture using its name
|
|
1336
|
+
* @param name defines the texture's name
|
|
1337
|
+
* @returns the texture or null if none found.
|
|
1338
|
+
*/
|
|
1339
|
+
getTextureByName(e) {
|
|
1340
|
+
for (let t = 0; t < this.textures.length; t++)
|
|
1341
|
+
if (this.textures[t].name === e)
|
|
1342
|
+
return this.textures[t];
|
|
1343
|
+
return null;
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Gets a camera using its Id
|
|
1347
|
+
* @param id defines the Id to look for
|
|
1348
|
+
* @returns the camera or null if not found
|
|
1349
|
+
*/
|
|
1350
|
+
getCameraById(e) {
|
|
1351
|
+
for (let t = 0; t < this.cameras.length; t++)
|
|
1352
|
+
if (this.cameras[t].id === e)
|
|
1353
|
+
return this.cameras[t];
|
|
1354
|
+
return null;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Gets a camera using its unique Id
|
|
1358
|
+
* @param uniqueId defines the unique Id to look for
|
|
1359
|
+
* @returns the camera or null if not found
|
|
1360
|
+
*/
|
|
1361
|
+
getCameraByUniqueId(e) {
|
|
1362
|
+
for (let t = 0; t < this.cameras.length; t++)
|
|
1363
|
+
if (this.cameras[t].uniqueId === e)
|
|
1364
|
+
return this.cameras[t];
|
|
1365
|
+
return null;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Gets a camera using its name
|
|
1369
|
+
* @param name defines the camera's name
|
|
1370
|
+
* @returns the camera or null if none found.
|
|
1371
|
+
*/
|
|
1372
|
+
getCameraByName(e) {
|
|
1373
|
+
for (let t = 0; t < this.cameras.length; t++)
|
|
1374
|
+
if (this.cameras[t].name === e)
|
|
1375
|
+
return this.cameras[t];
|
|
1376
|
+
return null;
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Gets a bone using its Id
|
|
1380
|
+
* @param id defines the bone's Id
|
|
1381
|
+
* @returns the bone or null if not found
|
|
1382
|
+
*/
|
|
1383
|
+
getBoneById(e) {
|
|
1384
|
+
for (let t = 0; t < this.skeletons.length; t++) {
|
|
1385
|
+
const i = this.skeletons[t];
|
|
1386
|
+
for (let r = 0; r < i.bones.length; r++)
|
|
1387
|
+
if (i.bones[r].id === e)
|
|
1388
|
+
return i.bones[r];
|
|
1389
|
+
}
|
|
1390
|
+
return null;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Gets a bone using its id
|
|
1394
|
+
* @param name defines the bone's name
|
|
1395
|
+
* @returns the bone or null if not found
|
|
1396
|
+
*/
|
|
1397
|
+
getBoneByName(e) {
|
|
1398
|
+
for (let t = 0; t < this.skeletons.length; t++) {
|
|
1399
|
+
const i = this.skeletons[t];
|
|
1400
|
+
for (let r = 0; r < i.bones.length; r++)
|
|
1401
|
+
if (i.bones[r].name === e)
|
|
1402
|
+
return i.bones[r];
|
|
1403
|
+
}
|
|
1404
|
+
return null;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* Gets a light node using its name
|
|
1408
|
+
* @param name defines the the light's name
|
|
1409
|
+
* @returns the light or null if none found.
|
|
1410
|
+
*/
|
|
1411
|
+
getLightByName(e) {
|
|
1412
|
+
for (let t = 0; t < this.lights.length; t++)
|
|
1413
|
+
if (this.lights[t].name === e)
|
|
1414
|
+
return this.lights[t];
|
|
1415
|
+
return null;
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Gets a light node using its Id
|
|
1419
|
+
* @param id defines the light's Id
|
|
1420
|
+
* @returns the light or null if none found.
|
|
1421
|
+
*/
|
|
1422
|
+
getLightById(e) {
|
|
1423
|
+
for (let t = 0; t < this.lights.length; t++)
|
|
1424
|
+
if (this.lights[t].id === e)
|
|
1425
|
+
return this.lights[t];
|
|
1426
|
+
return null;
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Gets a light node using its scene-generated unique Id
|
|
1430
|
+
* @param uniqueId defines the light's unique Id
|
|
1431
|
+
* @returns the light or null if none found.
|
|
1432
|
+
*/
|
|
1433
|
+
getLightByUniqueId(e) {
|
|
1434
|
+
for (let t = 0; t < this.lights.length; t++)
|
|
1435
|
+
if (this.lights[t].uniqueId === e)
|
|
1436
|
+
return this.lights[t];
|
|
1437
|
+
return null;
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Gets a particle system by Id
|
|
1441
|
+
* @param id defines the particle system Id
|
|
1442
|
+
* @returns the corresponding system or null if none found
|
|
1443
|
+
*/
|
|
1444
|
+
getParticleSystemById(e) {
|
|
1445
|
+
for (let t = 0; t < this.particleSystems.length; t++)
|
|
1446
|
+
if (this.particleSystems[t].id === e)
|
|
1447
|
+
return this.particleSystems[t];
|
|
1448
|
+
return null;
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Gets a geometry using its Id
|
|
1452
|
+
* @param id defines the geometry's Id
|
|
1453
|
+
* @returns the geometry or null if none found.
|
|
1454
|
+
*/
|
|
1455
|
+
getGeometryById(e) {
|
|
1456
|
+
for (let t = 0; t < this.geometries.length; t++)
|
|
1457
|
+
if (this.geometries[t].id === e)
|
|
1458
|
+
return this.geometries[t];
|
|
1459
|
+
return null;
|
|
1460
|
+
}
|
|
1461
|
+
_getGeometryByUniqueId(e) {
|
|
1462
|
+
if (this._geometriesByUniqueId) {
|
|
1463
|
+
const t = this._geometriesByUniqueId[e];
|
|
1464
|
+
if (t !== void 0)
|
|
1465
|
+
return this.geometries[t];
|
|
1466
|
+
} else
|
|
1467
|
+
for (let t = 0; t < this.geometries.length; t++)
|
|
1468
|
+
if (this.geometries[t].uniqueId === e)
|
|
1469
|
+
return this.geometries[t];
|
|
1470
|
+
return null;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Add a new geometry to this scene
|
|
1474
|
+
* @param geometry defines the geometry to be added to the scene.
|
|
1475
|
+
* @param force defines if the geometry must be pushed even if a geometry with this id already exists
|
|
1476
|
+
* @returns a boolean defining if the geometry was added or not
|
|
1477
|
+
*/
|
|
1478
|
+
pushGeometry(e, t) {
|
|
1479
|
+
return !t && this._getGeometryByUniqueId(e.uniqueId) ? !1 : (this.addGeometry(e), this.onNewGeometryAddedObservable.notifyObservers(e), !0);
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Removes an existing geometry
|
|
1483
|
+
* @param geometry defines the geometry to be removed from the scene
|
|
1484
|
+
* @returns a boolean defining if the geometry was removed or not
|
|
1485
|
+
*/
|
|
1486
|
+
removeGeometry(e) {
|
|
1487
|
+
let t;
|
|
1488
|
+
if (this._geometriesByUniqueId) {
|
|
1489
|
+
if (t = this._geometriesByUniqueId[e.uniqueId], t === void 0)
|
|
1490
|
+
return !1;
|
|
1491
|
+
} else if (t = this.geometries.indexOf(e), t < 0)
|
|
1492
|
+
return !1;
|
|
1493
|
+
if (t !== this.geometries.length - 1) {
|
|
1494
|
+
const i = this.geometries[this.geometries.length - 1];
|
|
1495
|
+
i && (this.geometries[t] = i, this._geometriesByUniqueId && (this._geometriesByUniqueId[i.uniqueId] = t));
|
|
1496
|
+
}
|
|
1497
|
+
return this._geometriesByUniqueId && (this._geometriesByUniqueId[e.uniqueId] = void 0), this.geometries.pop(), this.onGeometryRemovedObservable.notifyObservers(e), !0;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Gets the list of geometries attached to the scene
|
|
1501
|
+
* @returns an array of Geometry
|
|
1502
|
+
*/
|
|
1503
|
+
getGeometries() {
|
|
1504
|
+
return this.geometries;
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* Gets the first added mesh found of a given Id
|
|
1508
|
+
* @param id defines the Id to search for
|
|
1509
|
+
* @returns the mesh found or null if not found at all
|
|
1510
|
+
*/
|
|
1511
|
+
getMeshById(e) {
|
|
1512
|
+
for (let t = 0; t < this.meshes.length; t++)
|
|
1513
|
+
if (this.meshes[t].id === e)
|
|
1514
|
+
return this.meshes[t];
|
|
1515
|
+
return null;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Gets a list of meshes using their Id
|
|
1519
|
+
* @param id defines the Id to search for
|
|
1520
|
+
* @returns a list of meshes
|
|
1521
|
+
*/
|
|
1522
|
+
getMeshesById(e) {
|
|
1523
|
+
return this.meshes.filter(function(t) {
|
|
1524
|
+
return t.id === e;
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Gets the first added transform node found of a given Id
|
|
1529
|
+
* @param id defines the Id to search for
|
|
1530
|
+
* @returns the found transform node or null if not found at all.
|
|
1531
|
+
*/
|
|
1532
|
+
getTransformNodeById(e) {
|
|
1533
|
+
for (let t = 0; t < this.transformNodes.length; t++)
|
|
1534
|
+
if (this.transformNodes[t].id === e)
|
|
1535
|
+
return this.transformNodes[t];
|
|
1536
|
+
return null;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Gets a transform node with its auto-generated unique Id
|
|
1540
|
+
* @param uniqueId defines the unique Id to search for
|
|
1541
|
+
* @returns the found transform node or null if not found at all.
|
|
1542
|
+
*/
|
|
1543
|
+
getTransformNodeByUniqueId(e) {
|
|
1544
|
+
for (let t = 0; t < this.transformNodes.length; t++)
|
|
1545
|
+
if (this.transformNodes[t].uniqueId === e)
|
|
1546
|
+
return this.transformNodes[t];
|
|
1547
|
+
return null;
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Gets a list of transform nodes using their Id
|
|
1551
|
+
* @param id defines the Id to search for
|
|
1552
|
+
* @returns a list of transform nodes
|
|
1553
|
+
*/
|
|
1554
|
+
getTransformNodesById(e) {
|
|
1555
|
+
return this.transformNodes.filter(function(t) {
|
|
1556
|
+
return t.id === e;
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* Gets a mesh with its auto-generated unique Id
|
|
1561
|
+
* @param uniqueId defines the unique Id to search for
|
|
1562
|
+
* @returns the found mesh or null if not found at all.
|
|
1563
|
+
*/
|
|
1564
|
+
getMeshByUniqueId(e) {
|
|
1565
|
+
for (let t = 0; t < this.meshes.length; t++)
|
|
1566
|
+
if (this.meshes[t].uniqueId === e)
|
|
1567
|
+
return this.meshes[t];
|
|
1568
|
+
return null;
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* Gets a the last added mesh using a given Id
|
|
1572
|
+
* @param id defines the Id to search for
|
|
1573
|
+
* @returns the found mesh or null if not found at all.
|
|
1574
|
+
*/
|
|
1575
|
+
getLastMeshById(e) {
|
|
1576
|
+
for (let t = this.meshes.length - 1; t >= 0; t--)
|
|
1577
|
+
if (this.meshes[t].id === e)
|
|
1578
|
+
return this.meshes[t];
|
|
1579
|
+
return null;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Gets a the last transform node using a given Id
|
|
1583
|
+
* @param id defines the Id to search for
|
|
1584
|
+
* @returns the found mesh or null if not found at all.
|
|
1585
|
+
*/
|
|
1586
|
+
getLastTransformNodeById(e) {
|
|
1587
|
+
for (let t = this.transformNodes.length - 1; t >= 0; t--)
|
|
1588
|
+
if (this.transformNodes[t].id === e)
|
|
1589
|
+
return this.transformNodes[t];
|
|
1590
|
+
return null;
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Gets a the last added node (Mesh, Camera, Light) using a given Id
|
|
1594
|
+
* @param id defines the Id to search for
|
|
1595
|
+
* @returns the found node or null if not found at all
|
|
1596
|
+
*/
|
|
1597
|
+
getLastEntryById(e) {
|
|
1598
|
+
let t;
|
|
1599
|
+
for (t = this.meshes.length - 1; t >= 0; t--)
|
|
1600
|
+
if (this.meshes[t].id === e)
|
|
1601
|
+
return this.meshes[t];
|
|
1602
|
+
for (t = this.transformNodes.length - 1; t >= 0; t--)
|
|
1603
|
+
if (this.transformNodes[t].id === e)
|
|
1604
|
+
return this.transformNodes[t];
|
|
1605
|
+
for (t = this.cameras.length - 1; t >= 0; t--)
|
|
1606
|
+
if (this.cameras[t].id === e)
|
|
1607
|
+
return this.cameras[t];
|
|
1608
|
+
for (t = this.lights.length - 1; t >= 0; t--)
|
|
1609
|
+
if (this.lights[t].id === e)
|
|
1610
|
+
return this.lights[t];
|
|
1611
|
+
return null;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Gets a node (Mesh, Camera, Light) using a given Id
|
|
1615
|
+
* @param id defines the Id to search for
|
|
1616
|
+
* @returns the found node or null if not found at all
|
|
1617
|
+
*/
|
|
1618
|
+
getNodeById(e) {
|
|
1619
|
+
const t = this.getMeshById(e);
|
|
1620
|
+
if (t)
|
|
1621
|
+
return t;
|
|
1622
|
+
const i = this.getTransformNodeById(e);
|
|
1623
|
+
if (i)
|
|
1624
|
+
return i;
|
|
1625
|
+
const r = this.getLightById(e);
|
|
1626
|
+
if (r)
|
|
1627
|
+
return r;
|
|
1628
|
+
const s = this.getCameraById(e);
|
|
1629
|
+
if (s)
|
|
1630
|
+
return s;
|
|
1631
|
+
const n = this.getBoneById(e);
|
|
1632
|
+
return n || null;
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Gets a node (Mesh, Camera, Light) using a given name
|
|
1636
|
+
* @param name defines the name to search for
|
|
1637
|
+
* @returns the found node or null if not found at all.
|
|
1638
|
+
*/
|
|
1639
|
+
getNodeByName(e) {
|
|
1640
|
+
const t = this.getMeshByName(e);
|
|
1641
|
+
if (t)
|
|
1642
|
+
return t;
|
|
1643
|
+
const i = this.getTransformNodeByName(e);
|
|
1644
|
+
if (i)
|
|
1645
|
+
return i;
|
|
1646
|
+
const r = this.getLightByName(e);
|
|
1647
|
+
if (r)
|
|
1648
|
+
return r;
|
|
1649
|
+
const s = this.getCameraByName(e);
|
|
1650
|
+
if (s)
|
|
1651
|
+
return s;
|
|
1652
|
+
const n = this.getBoneByName(e);
|
|
1653
|
+
return n || null;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Gets a mesh using a given name
|
|
1657
|
+
* @param name defines the name to search for
|
|
1658
|
+
* @returns the found mesh or null if not found at all.
|
|
1659
|
+
*/
|
|
1660
|
+
getMeshByName(e) {
|
|
1661
|
+
for (let t = 0; t < this.meshes.length; t++)
|
|
1662
|
+
if (this.meshes[t].name === e)
|
|
1663
|
+
return this.meshes[t];
|
|
1664
|
+
return null;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Gets a transform node using a given name
|
|
1668
|
+
* @param name defines the name to search for
|
|
1669
|
+
* @returns the found transform node or null if not found at all.
|
|
1670
|
+
*/
|
|
1671
|
+
getTransformNodeByName(e) {
|
|
1672
|
+
for (let t = 0; t < this.transformNodes.length; t++)
|
|
1673
|
+
if (this.transformNodes[t].name === e)
|
|
1674
|
+
return this.transformNodes[t];
|
|
1675
|
+
return null;
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Gets a skeleton using a given Id (if many are found, this function will pick the last one)
|
|
1679
|
+
* @param id defines the Id to search for
|
|
1680
|
+
* @returns the found skeleton or null if not found at all.
|
|
1681
|
+
*/
|
|
1682
|
+
getLastSkeletonById(e) {
|
|
1683
|
+
for (let t = this.skeletons.length - 1; t >= 0; t--)
|
|
1684
|
+
if (this.skeletons[t].id === e)
|
|
1685
|
+
return this.skeletons[t];
|
|
1686
|
+
return null;
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Gets a skeleton using a given auto generated unique id
|
|
1690
|
+
* @param uniqueId defines the unique id to search for
|
|
1691
|
+
* @returns the found skeleton or null if not found at all.
|
|
1692
|
+
*/
|
|
1693
|
+
getSkeletonByUniqueId(e) {
|
|
1694
|
+
for (let t = 0; t < this.skeletons.length; t++)
|
|
1695
|
+
if (this.skeletons[t].uniqueId === e)
|
|
1696
|
+
return this.skeletons[t];
|
|
1697
|
+
return null;
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Gets a skeleton using a given id (if many are found, this function will pick the first one)
|
|
1701
|
+
* @param id defines the id to search for
|
|
1702
|
+
* @returns the found skeleton or null if not found at all.
|
|
1703
|
+
*/
|
|
1704
|
+
getSkeletonById(e) {
|
|
1705
|
+
for (let t = 0; t < this.skeletons.length; t++)
|
|
1706
|
+
if (this.skeletons[t].id === e)
|
|
1707
|
+
return this.skeletons[t];
|
|
1708
|
+
return null;
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* Gets a skeleton using a given name
|
|
1712
|
+
* @param name defines the name to search for
|
|
1713
|
+
* @returns the found skeleton or null if not found at all.
|
|
1714
|
+
*/
|
|
1715
|
+
getSkeletonByName(e) {
|
|
1716
|
+
for (let t = 0; t < this.skeletons.length; t++)
|
|
1717
|
+
if (this.skeletons[t].name === e)
|
|
1718
|
+
return this.skeletons[t];
|
|
1719
|
+
return null;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Gets a morph target manager using a given id (if many are found, this function will pick the last one)
|
|
1723
|
+
* @param id defines the id to search for
|
|
1724
|
+
* @returns the found morph target manager or null if not found at all.
|
|
1725
|
+
*/
|
|
1726
|
+
getMorphTargetManagerById(e) {
|
|
1727
|
+
for (let t = 0; t < this.morphTargetManagers.length; t++)
|
|
1728
|
+
if (this.morphTargetManagers[t].uniqueId === e)
|
|
1729
|
+
return this.morphTargetManagers[t];
|
|
1730
|
+
return null;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Gets a morph target using a given id (if many are found, this function will pick the first one)
|
|
1734
|
+
* @param id defines the id to search for
|
|
1735
|
+
* @returns the found morph target or null if not found at all.
|
|
1736
|
+
*/
|
|
1737
|
+
getMorphTargetById(e) {
|
|
1738
|
+
for (let t = 0; t < this.morphTargetManagers.length; ++t) {
|
|
1739
|
+
const i = this.morphTargetManagers[t];
|
|
1740
|
+
for (let r = 0; r < i.numTargets; ++r) {
|
|
1741
|
+
const s = i.getTarget(r);
|
|
1742
|
+
if (s.id === e)
|
|
1743
|
+
return s;
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
return null;
|
|
1747
|
+
}
|
|
1748
|
+
/**
|
|
1749
|
+
* Gets a morph target using a given name (if many are found, this function will pick the first one)
|
|
1750
|
+
* @param name defines the name to search for
|
|
1751
|
+
* @returns the found morph target or null if not found at all.
|
|
1752
|
+
*/
|
|
1753
|
+
getMorphTargetByName(e) {
|
|
1754
|
+
for (let t = 0; t < this.morphTargetManagers.length; ++t) {
|
|
1755
|
+
const i = this.morphTargetManagers[t];
|
|
1756
|
+
for (let r = 0; r < i.numTargets; ++r) {
|
|
1757
|
+
const s = i.getTarget(r);
|
|
1758
|
+
if (s.name === e)
|
|
1759
|
+
return s;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
return null;
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Gets a post process using a given name (if many are found, this function will pick the first one)
|
|
1766
|
+
* @param name defines the name to search for
|
|
1767
|
+
* @returns the found post process or null if not found at all.
|
|
1768
|
+
*/
|
|
1769
|
+
getPostProcessByName(e) {
|
|
1770
|
+
for (let t = 0; t < this.postProcesses.length; ++t) {
|
|
1771
|
+
const i = this.postProcesses[t];
|
|
1772
|
+
if (i.name === e)
|
|
1773
|
+
return i;
|
|
1774
|
+
}
|
|
1775
|
+
return null;
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Gets a boolean indicating if the given mesh is active
|
|
1779
|
+
* @param mesh defines the mesh to look for
|
|
1780
|
+
* @returns true if the mesh is in the active list
|
|
1781
|
+
*/
|
|
1782
|
+
isActiveMesh(e) {
|
|
1783
|
+
return this._activeMeshes.indexOf(e) !== -1;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Return a unique id as a string which can serve as an identifier for the scene
|
|
1787
|
+
*/
|
|
1788
|
+
get uid() {
|
|
1789
|
+
return this._uid || (this._uid = C.RandomId()), this._uid;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Add an externally attached data from its key.
|
|
1793
|
+
* This method call will fail and return false, if such key already exists.
|
|
1794
|
+
* If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.
|
|
1795
|
+
* @param key the unique key that identifies the data
|
|
1796
|
+
* @param data the data object to associate to the key for this Engine instance
|
|
1797
|
+
* @returns true if no such key were already present and the data was added successfully, false otherwise
|
|
1798
|
+
*/
|
|
1799
|
+
addExternalData(e, t) {
|
|
1800
|
+
return this._externalData || (this._externalData = new P()), this._externalData.add(e, t);
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Get an externally attached data from its key
|
|
1804
|
+
* @param key the unique key that identifies the data
|
|
1805
|
+
* @returns the associated data, if present (can be null), or undefined if not present
|
|
1806
|
+
*/
|
|
1807
|
+
getExternalData(e) {
|
|
1808
|
+
return this._externalData ? this._externalData.get(e) : null;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Get an externally attached data from its key, create it using a factory if it's not already present
|
|
1812
|
+
* @param key the unique key that identifies the data
|
|
1813
|
+
* @param factory the factory that will be called to create the instance if and only if it doesn't exists
|
|
1814
|
+
* @returns the associated data, can be null if the factory returned null.
|
|
1815
|
+
*/
|
|
1816
|
+
getOrAddExternalDataWithFactory(e, t) {
|
|
1817
|
+
return this._externalData || (this._externalData = new P()), this._externalData.getOrAddWithFactory(e, t);
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Remove an externally attached data from the Engine instance
|
|
1821
|
+
* @param key the unique key that identifies the data
|
|
1822
|
+
* @returns true if the data was successfully removed, false if it doesn't exist
|
|
1823
|
+
*/
|
|
1824
|
+
removeExternalData(e) {
|
|
1825
|
+
return this._externalData.remove(e);
|
|
1826
|
+
}
|
|
1827
|
+
_evaluateSubMesh(e, t, i, r) {
|
|
1828
|
+
if (r || e.isInFrustum(this._frustumPlanes)) {
|
|
1829
|
+
for (const n of this._evaluateSubMeshStage)
|
|
1830
|
+
n.action(t, e);
|
|
1831
|
+
const s = e.getMaterial();
|
|
1832
|
+
s != null && (s.hasRenderTargetTextures && s.getRenderTargetTextures != null && this._processedMaterials.indexOf(s) === -1 && (this._processedMaterials.push(s), this._materialsRenderTargets.concatWithNoDuplicate(s.getRenderTargetTextures())), this._renderingManager.dispatch(e, t, s));
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Clear the processed materials smart array preventing retention point in material dispose.
|
|
1837
|
+
*/
|
|
1838
|
+
freeProcessedMaterials() {
|
|
1839
|
+
this._processedMaterials.dispose();
|
|
1840
|
+
}
|
|
1841
|
+
/** Gets or sets a boolean blocking all the calls to freeActiveMeshes and freeRenderingGroups
|
|
1842
|
+
* It can be used in order to prevent going through methods freeRenderingGroups and freeActiveMeshes several times to improve performance
|
|
1843
|
+
* when disposing several meshes in a row or a hierarchy of meshes.
|
|
1844
|
+
* When used, it is the responsibility of the user to blockfreeActiveMeshesAndRenderingGroups back to false.
|
|
1845
|
+
*/
|
|
1846
|
+
get blockfreeActiveMeshesAndRenderingGroups() {
|
|
1847
|
+
return this._preventFreeActiveMeshesAndRenderingGroups;
|
|
1848
|
+
}
|
|
1849
|
+
set blockfreeActiveMeshesAndRenderingGroups(e) {
|
|
1850
|
+
this._preventFreeActiveMeshesAndRenderingGroups !== e && (e && (this.freeActiveMeshes(), this.freeRenderingGroups()), this._preventFreeActiveMeshesAndRenderingGroups = e);
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Clear the active meshes smart array preventing retention point in mesh dispose.
|
|
1854
|
+
*/
|
|
1855
|
+
freeActiveMeshes() {
|
|
1856
|
+
if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras))
|
|
1857
|
+
for (let e = 0; e < this.activeCameras.length; e++) {
|
|
1858
|
+
const t = this.activeCameras[e];
|
|
1859
|
+
t && t._activeMeshes && t._activeMeshes.dispose();
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Clear the info related to rendering groups preventing retention points during dispose.
|
|
1864
|
+
*/
|
|
1865
|
+
freeRenderingGroups() {
|
|
1866
|
+
if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures))
|
|
1867
|
+
for (let e = 0; e < this.textures.length; e++) {
|
|
1868
|
+
const t = this.textures[e];
|
|
1869
|
+
t && t.renderList && t.freeRenderingGroups();
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
/** @internal */
|
|
1873
|
+
_isInIntermediateRendering() {
|
|
1874
|
+
return this._intermediateRendering;
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* Use this function to stop evaluating active meshes. The current list will be keep alive between frames
|
|
1878
|
+
* @param skipEvaluateActiveMeshes defines an optional boolean indicating that the evaluate active meshes step must be completely skipped
|
|
1879
|
+
* @param onSuccess optional success callback
|
|
1880
|
+
* @param onError optional error callback
|
|
1881
|
+
* @param freezeMeshes defines if meshes should be frozen (true by default)
|
|
1882
|
+
* @param keepFrustumCulling defines if you want to keep running the frustum clipping (false by default)
|
|
1883
|
+
* @returns the current scene
|
|
1884
|
+
*/
|
|
1885
|
+
freezeActiveMeshes(e = !1, t, i, r = !0, s = !1) {
|
|
1886
|
+
return this.executeWhenReady(() => {
|
|
1887
|
+
if (!this.activeCamera) {
|
|
1888
|
+
i && i("No active camera found");
|
|
1889
|
+
return;
|
|
1890
|
+
}
|
|
1891
|
+
if (this._frustumPlanes || this.updateTransformMatrix(), this._evaluateActiveMeshes(), this._activeMeshesFrozen = !0, this._activeMeshesFrozenButKeepClipping = s, this._skipEvaluateActiveMeshesCompletely = e, r)
|
|
1892
|
+
for (let n = 0; n < this._activeMeshes.length; n++)
|
|
1893
|
+
this._activeMeshes.data[n]._freeze();
|
|
1894
|
+
t && t();
|
|
1895
|
+
}), this;
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Use this function to restart evaluating active meshes on every frame
|
|
1899
|
+
* @returns the current scene
|
|
1900
|
+
*/
|
|
1901
|
+
unfreezeActiveMeshes() {
|
|
1902
|
+
for (let e = 0; e < this.meshes.length; e++) {
|
|
1903
|
+
const t = this.meshes[e];
|
|
1904
|
+
t._internalAbstractMeshDataInfo && (t._internalAbstractMeshDataInfo._isActive = !1);
|
|
1905
|
+
}
|
|
1906
|
+
for (let e = 0; e < this._activeMeshes.length; e++)
|
|
1907
|
+
this._activeMeshes.data[e]._unFreeze();
|
|
1908
|
+
return this._activeMeshesFrozen = !1, this;
|
|
1909
|
+
}
|
|
1910
|
+
_executeActiveContainerCleanup(e) {
|
|
1911
|
+
!(this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1) && this._activeMeshesFrozen && this._activeMeshes.length || this.onBeforeRenderObservable.addOnce(() => e.dispose());
|
|
1912
|
+
}
|
|
1913
|
+
_evaluateActiveMeshes() {
|
|
1914
|
+
var e;
|
|
1915
|
+
if (this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1) {
|
|
1916
|
+
this._activeMeshes.length > 0 && ((e = this.activeCamera) === null || e === void 0 || e._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset());
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
if (this._activeMeshesFrozen && this._activeMeshes.length) {
|
|
1920
|
+
if (!this._skipEvaluateActiveMeshesCompletely) {
|
|
1921
|
+
const r = this._activeMeshes.length;
|
|
1922
|
+
for (let s = 0; s < r; s++)
|
|
1923
|
+
this._activeMeshes.data[s].computeWorldMatrix();
|
|
1924
|
+
}
|
|
1925
|
+
if (this._activeParticleSystems) {
|
|
1926
|
+
const r = this._activeParticleSystems.length;
|
|
1927
|
+
for (let s = 0; s < r; s++)
|
|
1928
|
+
this._activeParticleSystems.data[s].animate();
|
|
1929
|
+
}
|
|
1930
|
+
this._renderingManager.resetSprites();
|
|
1931
|
+
return;
|
|
1932
|
+
}
|
|
1933
|
+
if (!this.activeCamera)
|
|
1934
|
+
return;
|
|
1935
|
+
this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset(), this._materialsRenderTargets.reset();
|
|
1936
|
+
for (const r of this._beforeEvaluateActiveMeshStage)
|
|
1937
|
+
r.action();
|
|
1938
|
+
const t = this.getActiveMeshCandidates(), i = t.length;
|
|
1939
|
+
for (let r = 0; r < i; r++) {
|
|
1940
|
+
const s = t.data[r];
|
|
1941
|
+
if (s._internalAbstractMeshDataInfo._currentLODIsUpToDate = !1, s.isBlocked || (this._totalVertices.addCount(s.getTotalVertices(), !1), !s.isReady() || !s.isEnabled() || s.scaling.hasAZeroComponent))
|
|
1942
|
+
continue;
|
|
1943
|
+
s.computeWorldMatrix(), s.actionManager && s.actionManager.hasSpecificTriggers2(12, 13) && this._meshesForIntersections.pushNoDuplicate(s);
|
|
1944
|
+
let n = this.customLODSelector ? this.customLODSelector(s, this.activeCamera) : s.getLOD(this.activeCamera);
|
|
1945
|
+
if (s._internalAbstractMeshDataInfo._currentLOD = n, s._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0, n != null && (n !== s && n.billboardMode !== 0 && n.computeWorldMatrix(), s._preActivate(), s.isVisible && s.visibility > 0 && s.layerMask & this.activeCamera.layerMask && (this._skipFrustumClipping || s.alwaysSelectAsActiveMesh || s.isInFrustum(this._frustumPlanes)))) {
|
|
1946
|
+
this._activeMeshes.push(s), this.activeCamera._activeMeshes.push(s), n !== s && n._activate(this._renderId, !1);
|
|
1947
|
+
for (const l of this._preActiveMeshStage)
|
|
1948
|
+
l.action(s);
|
|
1949
|
+
s._activate(this._renderId, !1) && (s.isAnInstance ? s._internalAbstractMeshDataInfo._actAsRegularMesh && (n = s) : n._internalAbstractMeshDataInfo._onlyForInstances = !1, n._internalAbstractMeshDataInfo._isActive = !0, this._activeMesh(s, n)), s._postActivate();
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
if (this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this), this.particlesEnabled) {
|
|
1953
|
+
this.onBeforeParticlesRenderingObservable.notifyObservers(this);
|
|
1954
|
+
for (let r = 0; r < this.particleSystems.length; r++) {
|
|
1955
|
+
const s = this.particleSystems[r];
|
|
1956
|
+
if (!s.isStarted() || !s.emitter)
|
|
1957
|
+
continue;
|
|
1958
|
+
const n = s.emitter;
|
|
1959
|
+
(!n.position || n.isEnabled()) && (this._activeParticleSystems.push(s), s.animate(), this._renderingManager.dispatchParticles(s));
|
|
1960
|
+
}
|
|
1961
|
+
this.onAfterParticlesRenderingObservable.notifyObservers(this);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
_activeMesh(e, t) {
|
|
1965
|
+
this._skeletonsEnabled && t.skeleton !== null && t.skeleton !== void 0 && (this._activeSkeletons.pushNoDuplicate(t.skeleton) && (t.skeleton.prepare(), this._activeBones.addCount(t.skeleton.bones.length, !1)), t.computeBonesUsingShaders || this._softwareSkinnedMeshes.pushNoDuplicate(t));
|
|
1966
|
+
let i = e.hasInstances || e.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || t.alwaysSelectAsActiveMesh;
|
|
1967
|
+
if (t && t.subMeshes && t.subMeshes.length > 0) {
|
|
1968
|
+
const r = this.getActiveSubMeshCandidates(t), s = r.length;
|
|
1969
|
+
i = i || s === 1;
|
|
1970
|
+
for (let n = 0; n < s; n++) {
|
|
1971
|
+
const l = r.data[n];
|
|
1972
|
+
this._evaluateSubMesh(l, t, e, i);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Update the transform matrix to update from the current active camera
|
|
1978
|
+
* @param force defines a boolean used to force the update even if cache is up to date
|
|
1979
|
+
*/
|
|
1980
|
+
updateTransformMatrix(e) {
|
|
1981
|
+
if (this.activeCamera)
|
|
1982
|
+
if (this.activeCamera._renderingMultiview) {
|
|
1983
|
+
const t = this.activeCamera._rigCameras[0], i = this.activeCamera._rigCameras[1];
|
|
1984
|
+
this.setTransformMatrix(t.getViewMatrix(), t.getProjectionMatrix(e), i.getViewMatrix(), i.getProjectionMatrix(e));
|
|
1985
|
+
} else
|
|
1986
|
+
this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(e));
|
|
1987
|
+
}
|
|
1988
|
+
_bindFrameBuffer(e, t = !0) {
|
|
1989
|
+
e && e._multiviewTexture ? e._multiviewTexture._bindFrameBuffer() : e && e.outputRenderTarget ? e.outputRenderTarget._bindFrameBuffer() : this._engine._currentFrameBufferIsDefaultFrameBuffer() || this._engine.restoreDefaultFramebuffer(), t && this._clearFrameBuffer(e);
|
|
1990
|
+
}
|
|
1991
|
+
_clearFrameBuffer(e) {
|
|
1992
|
+
if (!(e && e._multiviewTexture))
|
|
1993
|
+
if (e && e.outputRenderTarget && !e._renderingMultiview) {
|
|
1994
|
+
const t = e.outputRenderTarget;
|
|
1995
|
+
t.onClearObservable.hasObservers() ? t.onClearObservable.notifyObservers(this._engine) : t.skipInitialClear || (this.autoClear && this._engine.clear(t.clearColor || this.clearColor, !t._cleared, !0, !0), t._cleared = !0);
|
|
1996
|
+
} else
|
|
1997
|
+
this._defaultFrameBufferCleared ? this._engine.clear(null, !1, !0, !0) : (this._defaultFrameBufferCleared = !0, this._clear());
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* @internal
|
|
2001
|
+
*/
|
|
2002
|
+
_renderForCamera(e, t, i = !0) {
|
|
2003
|
+
var r, s, n;
|
|
2004
|
+
if (e && e._skipRendering)
|
|
2005
|
+
return;
|
|
2006
|
+
const l = this._engine;
|
|
2007
|
+
if (this._activeCamera = e, !this.activeCamera)
|
|
2008
|
+
throw new Error("Active camera not set");
|
|
2009
|
+
if (l.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, !this.prePass && i) {
|
|
2010
|
+
let o = !0;
|
|
2011
|
+
e._renderingMultiview && e.outputRenderTarget && (o = e.outputRenderTarget.skipInitialClear, this.autoClear && (this._defaultFrameBufferCleared = !1, e.outputRenderTarget.skipInitialClear = !1)), this._bindFrameBuffer(this._activeCamera), e._renderingMultiview && e.outputRenderTarget && (e.outputRenderTarget.skipInitialClear = o);
|
|
2012
|
+
}
|
|
2013
|
+
this.updateTransformMatrix(), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();
|
|
2014
|
+
for (let o = 0; o < this._softwareSkinnedMeshes.length; o++) {
|
|
2015
|
+
const u = this._softwareSkinnedMeshes.data[o];
|
|
2016
|
+
u.applySkeleton(u.skeleton);
|
|
2017
|
+
}
|
|
2018
|
+
this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets), e.customRenderTargets && e.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(e.customRenderTargets), t && t.customRenderTargets && t.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(t.customRenderTargets), this.environmentTexture && this.environmentTexture.isRenderTarget && this._renderTargets.pushNoDuplicate(this.environmentTexture);
|
|
2019
|
+
for (const o of this._gatherActiveCameraRenderTargetsStage)
|
|
2020
|
+
o.action(this._renderTargets);
|
|
2021
|
+
let a = !1;
|
|
2022
|
+
if (this.renderTargetsEnabled) {
|
|
2023
|
+
if (this._intermediateRendering = !0, this._renderTargets.length > 0) {
|
|
2024
|
+
C.StartPerformanceCounter("Render targets", this._renderTargets.length > 0);
|
|
2025
|
+
for (let o = 0; o < this._renderTargets.length; o++) {
|
|
2026
|
+
const u = this._renderTargets.data[o];
|
|
2027
|
+
if (u._shouldRender()) {
|
|
2028
|
+
this._renderId++;
|
|
2029
|
+
const g = u.activeCamera && u.activeCamera !== this.activeCamera;
|
|
2030
|
+
u.render(g, this.dumpNextRenderTargets), a = !0;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
C.EndPerformanceCounter("Render targets", this._renderTargets.length > 0), this._renderId++;
|
|
2034
|
+
}
|
|
2035
|
+
for (const o of this._cameraDrawRenderTargetStage)
|
|
2036
|
+
a = o.action(this.activeCamera) || a;
|
|
2037
|
+
this._intermediateRendering = !1;
|
|
2038
|
+
}
|
|
2039
|
+
this._engine.currentRenderPassId = (n = (s = (r = e.outputRenderTarget) === null || r === void 0 ? void 0 : r.renderPassId) !== null && s !== void 0 ? s : e.renderPassId) !== null && n !== void 0 ? n : 0, a && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), this.postProcessManager && !e._multiviewTexture && !this.prePass && this.postProcessManager._prepareFrame();
|
|
2040
|
+
for (const o of this._beforeCameraDrawStage)
|
|
2041
|
+
o.action(this.activeCamera);
|
|
2042
|
+
this.onBeforeDrawPhaseObservable.notifyObservers(this), l.snapshotRendering && l.snapshotRenderingMode === 1 && this.finalizeSceneUbo(), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);
|
|
2043
|
+
for (const o of this._afterCameraDrawStage)
|
|
2044
|
+
o.action(this.activeCamera);
|
|
2045
|
+
if (this.postProcessManager && !e._multiviewTexture) {
|
|
2046
|
+
const o = e.outputRenderTarget ? e.outputRenderTarget.renderTarget : void 0;
|
|
2047
|
+
this.postProcessManager._finalizeFrame(e.isIntermediate, o);
|
|
2048
|
+
}
|
|
2049
|
+
for (const o of this._afterCameraPostProcessStage)
|
|
2050
|
+
o.action(this.activeCamera);
|
|
2051
|
+
this._renderTargets.reset(), this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);
|
|
2052
|
+
}
|
|
2053
|
+
_processSubCameras(e, t = !0) {
|
|
2054
|
+
if (e.cameraRigMode === 0 || e._renderingMultiview) {
|
|
2055
|
+
e._renderingMultiview && !this._multiviewSceneUbo && this._createMultiviewUbo(), this._renderForCamera(e, void 0, t), this.onAfterRenderCameraObservable.notifyObservers(e);
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
if (e._useMultiviewToSingleView)
|
|
2059
|
+
this._renderMultiviewToSingleView(e);
|
|
2060
|
+
else {
|
|
2061
|
+
this.onBeforeCameraRenderObservable.notifyObservers(e);
|
|
2062
|
+
for (let i = 0; i < e._rigCameras.length; i++)
|
|
2063
|
+
this._renderForCamera(e._rigCameras[i], e);
|
|
2064
|
+
}
|
|
2065
|
+
this._activeCamera = e, this.updateTransformMatrix(), this.onAfterRenderCameraObservable.notifyObservers(e);
|
|
2066
|
+
}
|
|
2067
|
+
_checkIntersections() {
|
|
2068
|
+
for (let e = 0; e < this._meshesForIntersections.length; e++) {
|
|
2069
|
+
const t = this._meshesForIntersections.data[e];
|
|
2070
|
+
if (t.actionManager)
|
|
2071
|
+
for (let i = 0; t.actionManager && i < t.actionManager.actions.length; i++) {
|
|
2072
|
+
const r = t.actionManager.actions[i];
|
|
2073
|
+
if (r.trigger === 12 || r.trigger === 13) {
|
|
2074
|
+
const s = r.getTriggerParameter(), n = s.mesh ? s.mesh : s, l = n.intersectsMesh(t, s.usePreciseIntersection), a = t._intersectionsInProgress.indexOf(n);
|
|
2075
|
+
l && a === -1 ? r.trigger === 12 ? (r._executeCurrent(w.CreateNew(t, void 0, n)), t._intersectionsInProgress.push(n)) : r.trigger === 13 && t._intersectionsInProgress.push(n) : !l && a > -1 && (r.trigger === 13 && r._executeCurrent(w.CreateNew(t, void 0, n)), (!t.actionManager.hasSpecificTrigger(13, (o) => {
|
|
2076
|
+
const u = o.mesh ? o.mesh : o;
|
|
2077
|
+
return n === u;
|
|
2078
|
+
}) || r.trigger === 13) && t._intersectionsInProgress.splice(a, 1));
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* @internal
|
|
2085
|
+
*/
|
|
2086
|
+
_advancePhysicsEngineStep(e) {
|
|
2087
|
+
}
|
|
2088
|
+
/** @internal */
|
|
2089
|
+
_animate() {
|
|
2090
|
+
}
|
|
2091
|
+
/** Execute all animations (for a frame) */
|
|
2092
|
+
animate() {
|
|
2093
|
+
if (this._engine.isDeterministicLockStep()) {
|
|
2094
|
+
let e = Math.max(c.MinDeltaTime, Math.min(this._engine.getDeltaTime(), c.MaxDeltaTime)) + this._timeAccumulator;
|
|
2095
|
+
const t = this._engine.getTimeStep(), i = 1e3 / t / 1e3;
|
|
2096
|
+
let r = 0;
|
|
2097
|
+
const s = this._engine.getLockstepMaxSteps();
|
|
2098
|
+
let n = Math.floor(e / t);
|
|
2099
|
+
for (n = Math.min(n, s); e > 0 && r < n; )
|
|
2100
|
+
this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = t * i, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(t), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, r++, e -= t;
|
|
2101
|
+
this._timeAccumulator = e < 0 ? 0 : e;
|
|
2102
|
+
} else {
|
|
2103
|
+
const e = this.useConstantAnimationDeltaTime ? 16 : Math.max(c.MinDeltaTime, Math.min(this._engine.getDeltaTime(), c.MaxDeltaTime));
|
|
2104
|
+
this._animationRatio = e * (60 / 1e3), this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(e);
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
_clear() {
|
|
2108
|
+
(this.autoClearDepthAndStencil || this.autoClear) && this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
|
|
2109
|
+
}
|
|
2110
|
+
_checkCameraRenderTarget(e) {
|
|
2111
|
+
var t;
|
|
2112
|
+
if (e != null && e.outputRenderTarget && !(e != null && e.isRigCamera) && (e.outputRenderTarget._cleared = !1), !((t = e == null ? void 0 : e.rigCameras) === null || t === void 0) && t.length)
|
|
2113
|
+
for (let i = 0; i < e.rigCameras.length; ++i) {
|
|
2114
|
+
const r = e.rigCameras[i].outputRenderTarget;
|
|
2115
|
+
r && (r._cleared = !1);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Resets the draw wrappers cache of all meshes
|
|
2120
|
+
* @param passId If provided, releases only the draw wrapper corresponding to this render pass id
|
|
2121
|
+
*/
|
|
2122
|
+
resetDrawCache(e) {
|
|
2123
|
+
if (this.meshes)
|
|
2124
|
+
for (const t of this.meshes)
|
|
2125
|
+
t.resetDrawCache(e);
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* Render the scene
|
|
2129
|
+
* @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
|
|
2130
|
+
* @param ignoreAnimations defines a boolean indicating if animations should not be executed (false by default)
|
|
2131
|
+
*/
|
|
2132
|
+
render(e = !0, t = !1) {
|
|
2133
|
+
var i, r, s;
|
|
2134
|
+
if (this.isDisposed)
|
|
2135
|
+
return;
|
|
2136
|
+
this.onReadyObservable.hasObservers() && this._executeWhenReadyTimeoutId === null && this._checkIsReady(), this._frameId++, this._defaultFrameBufferCleared = !1, this._checkCameraRenderTarget(this.activeCamera), !((i = this.activeCameras) === null || i === void 0) && i.length && this.activeCameras.forEach(this._checkCameraRenderTarget), this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(11), t || this.animate();
|
|
2137
|
+
for (const a of this._beforeCameraUpdateStage)
|
|
2138
|
+
a.action();
|
|
2139
|
+
if (e) {
|
|
2140
|
+
if (this.activeCameras && this.activeCameras.length > 0)
|
|
2141
|
+
for (let a = 0; a < this.activeCameras.length; a++) {
|
|
2142
|
+
const o = this.activeCameras[a];
|
|
2143
|
+
if (o.update(), o.cameraRigMode !== 0)
|
|
2144
|
+
for (let u = 0; u < o._rigCameras.length; u++)
|
|
2145
|
+
o._rigCameras[u].update();
|
|
2146
|
+
}
|
|
2147
|
+
else if (this.activeCamera && (this.activeCamera.update(), this.activeCamera.cameraRigMode !== 0))
|
|
2148
|
+
for (let a = 0; a < this.activeCamera._rigCameras.length; a++)
|
|
2149
|
+
this.activeCamera._rigCameras[a].update();
|
|
2150
|
+
}
|
|
2151
|
+
this.onBeforeRenderObservable.notifyObservers(this);
|
|
2152
|
+
const n = this.getEngine();
|
|
2153
|
+
this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
|
|
2154
|
+
const l = !((r = this.activeCameras) === null || r === void 0) && r.length ? this.activeCameras[0] : this.activeCamera;
|
|
2155
|
+
if (this.renderTargetsEnabled) {
|
|
2156
|
+
C.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0), this._intermediateRendering = !0;
|
|
2157
|
+
for (let a = 0; a < this.customRenderTargets.length; a++) {
|
|
2158
|
+
const o = this.customRenderTargets[a];
|
|
2159
|
+
if (o._shouldRender()) {
|
|
2160
|
+
if (this._renderId++, this.activeCamera = o.activeCamera || this.activeCamera, !this.activeCamera)
|
|
2161
|
+
throw new Error("Active camera not set");
|
|
2162
|
+
n.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), o.render(l !== this.activeCamera, this.dumpNextRenderTargets);
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
C.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0), this._intermediateRendering = !1, this._renderId++;
|
|
2166
|
+
}
|
|
2167
|
+
this._engine.currentRenderPassId = (s = l == null ? void 0 : l.renderPassId) !== null && s !== void 0 ? s : 0, this.activeCamera = l, this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
2168
|
+
for (const a of this._beforeClearStage)
|
|
2169
|
+
a.action();
|
|
2170
|
+
this._clearFrameBuffer(this.activeCamera);
|
|
2171
|
+
for (const a of this._gatherRenderTargetsStage)
|
|
2172
|
+
a.action(this._renderTargets);
|
|
2173
|
+
if (this.activeCameras && this.activeCameras.length > 0)
|
|
2174
|
+
for (let a = 0; a < this.activeCameras.length; a++)
|
|
2175
|
+
this._processSubCameras(this.activeCameras[a], a > 0);
|
|
2176
|
+
else {
|
|
2177
|
+
if (!this.activeCamera)
|
|
2178
|
+
throw new Error("No camera defined");
|
|
2179
|
+
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
2180
|
+
}
|
|
2181
|
+
this._checkIntersections();
|
|
2182
|
+
for (const a of this._afterRenderStage)
|
|
2183
|
+
a.action();
|
|
2184
|
+
if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {
|
|
2185
|
+
for (let a = 0; a < this._toBeDisposed.length; a++) {
|
|
2186
|
+
const o = this._toBeDisposed[a];
|
|
2187
|
+
o && o.dispose();
|
|
2188
|
+
}
|
|
2189
|
+
this._toBeDisposed.length = 0;
|
|
2190
|
+
}
|
|
2191
|
+
this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0), this._engine.restoreDefaultFramebuffer();
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Freeze all materials
|
|
2195
|
+
* A frozen material will not be updatable but should be faster to render
|
|
2196
|
+
* Note: multimaterials will not be frozen, but their submaterials will
|
|
2197
|
+
*/
|
|
2198
|
+
freezeMaterials() {
|
|
2199
|
+
for (let e = 0; e < this.materials.length; e++)
|
|
2200
|
+
this.materials[e].freeze();
|
|
2201
|
+
}
|
|
2202
|
+
/**
|
|
2203
|
+
* Unfreeze all materials
|
|
2204
|
+
* A frozen material will not be updatable but should be faster to render
|
|
2205
|
+
*/
|
|
2206
|
+
unfreezeMaterials() {
|
|
2207
|
+
for (let e = 0; e < this.materials.length; e++)
|
|
2208
|
+
this.materials[e].unfreeze();
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Releases all held resources
|
|
2212
|
+
*/
|
|
2213
|
+
dispose() {
|
|
2214
|
+
if (this.isDisposed)
|
|
2215
|
+
return;
|
|
2216
|
+
this.beforeRender = null, this.afterRender = null, this.metadata = null, this.skeletons.length = 0, this.morphTargetManagers.length = 0, this._transientComponents.length = 0, this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._preActiveMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderTargetDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderTargetDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear(), this.importedMeshesFiles = new Array(), this.stopAllAnimations && this.stopAllAnimations(), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this.activeCameras = null, this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._materialsRenderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed.length = 0;
|
|
2217
|
+
const e = this._activeRequests.slice();
|
|
2218
|
+
for (const s of e)
|
|
2219
|
+
s.abort();
|
|
2220
|
+
this._activeRequests.length = 0;
|
|
2221
|
+
try {
|
|
2222
|
+
this.onDisposeObservable.notifyObservers(this);
|
|
2223
|
+
} catch (s) {
|
|
2224
|
+
console.error("An error occurred while calling onDisposeObservable!", s);
|
|
2225
|
+
}
|
|
2226
|
+
if (this.detachControl(), this._engine.getInputElement())
|
|
2227
|
+
for (let s = 0; s < this.cameras.length; s++)
|
|
2228
|
+
this.cameras[s].detachControl();
|
|
2229
|
+
this._disposeList(this.animationGroups), this._disposeList(this.lights), this._disposeList(this.meshes, (s) => s.dispose(!0)), this._disposeList(this.transformNodes, (s) => s.dispose(!0));
|
|
2230
|
+
const i = this.cameras;
|
|
2231
|
+
this._disposeList(i), this._defaultMaterial && this._defaultMaterial.dispose(), this._disposeList(this.multiMaterials), this._disposeList(this.materials), this._disposeList(this.particleSystems), this._disposeList(this.postProcesses), this._disposeList(this.textures), this._disposeList(this.morphTargetManagers), this._sceneUbo.dispose(), this._multiviewSceneUbo && this._multiviewSceneUbo.dispose(), this.postProcessManager.dispose(), this._disposeList(this._components);
|
|
2232
|
+
let r = this._engine.scenes.indexOf(this);
|
|
2233
|
+
r > -1 && this._engine.scenes.splice(r, 1), R._LastCreatedScene === this && (this._engine.scenes.length > 0 ? R._LastCreatedScene = this._engine.scenes[this._engine.scenes.length - 1] : R._LastCreatedScene = null), r = this._engine._virtualScenes.indexOf(this), r > -1 && this._engine._virtualScenes.splice(r, 1), this._engine.wipeCaches(!0), this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onAfterRenderCameraObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewSkeletonAddedObservable.clear(), this.onSkeletonRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onNewMultiMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onMultiMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.onActiveCameraChanged.clear(), this.onScenePerformancePriorityChangedObservable.clear(), this._isDisposed = !0;
|
|
2234
|
+
}
|
|
2235
|
+
_disposeList(e, t) {
|
|
2236
|
+
const i = e.slice(0);
|
|
2237
|
+
t = t ?? ((r) => r.dispose());
|
|
2238
|
+
for (const r of i)
|
|
2239
|
+
t(r);
|
|
2240
|
+
e.length = 0;
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* Gets if the scene is already disposed
|
|
2244
|
+
*/
|
|
2245
|
+
get isDisposed() {
|
|
2246
|
+
return this._isDisposed;
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Call this function to reduce memory footprint of the scene.
|
|
2250
|
+
* Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
|
|
2251
|
+
*/
|
|
2252
|
+
clearCachedVertexData() {
|
|
2253
|
+
for (let e = 0; e < this.meshes.length; e++) {
|
|
2254
|
+
const i = this.meshes[e].geometry;
|
|
2255
|
+
i && i.clearCachedData();
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* This function will remove the local cached buffer data from texture.
|
|
2260
|
+
* It will save memory but will prevent the texture from being rebuilt
|
|
2261
|
+
*/
|
|
2262
|
+
cleanCachedTextureBuffer() {
|
|
2263
|
+
for (const e of this.textures)
|
|
2264
|
+
e._buffer && (e._buffer = null);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Get the world extend vectors with an optional filter
|
|
2268
|
+
*
|
|
2269
|
+
* @param filterPredicate the predicate - which meshes should be included when calculating the world size
|
|
2270
|
+
* @returns {{ min: Vector3; max: Vector3 }} min and max vectors
|
|
2271
|
+
*/
|
|
2272
|
+
getWorldExtends(e) {
|
|
2273
|
+
const t = new y(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), i = new y(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
2274
|
+
return e = e || (() => !0), this.meshes.filter(e).forEach((r) => {
|
|
2275
|
+
if (r.computeWorldMatrix(!0), !r.subMeshes || r.subMeshes.length === 0 || r.infiniteDistance)
|
|
2276
|
+
return;
|
|
2277
|
+
const s = r.getBoundingInfo(), n = s.boundingBox.minimumWorld, l = s.boundingBox.maximumWorld;
|
|
2278
|
+
y.CheckExtends(n, t, i), y.CheckExtends(l, t, i);
|
|
2279
|
+
}), {
|
|
2280
|
+
min: t,
|
|
2281
|
+
max: i
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
// Picking
|
|
2285
|
+
/**
|
|
2286
|
+
* Creates a ray that can be used to pick in the scene
|
|
2287
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
2288
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
2289
|
+
* @param world defines the world matrix to use if you want to pick in object space (instead of world space)
|
|
2290
|
+
* @param camera defines the camera to use for the picking
|
|
2291
|
+
* @param cameraViewSpace defines if picking will be done in view space (false by default)
|
|
2292
|
+
* @returns a Ray
|
|
2293
|
+
*/
|
|
2294
|
+
createPickingRay(e, t, i, r, s = !1) {
|
|
2295
|
+
throw f("Ray");
|
|
2296
|
+
}
|
|
2297
|
+
/**
|
|
2298
|
+
* Creates a ray that can be used to pick in the scene
|
|
2299
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
2300
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
2301
|
+
* @param world defines the world matrix to use if you want to pick in object space (instead of world space)
|
|
2302
|
+
* @param result defines the ray where to store the picking ray
|
|
2303
|
+
* @param camera defines the camera to use for the picking
|
|
2304
|
+
* @param cameraViewSpace defines if picking will be done in view space (false by default)
|
|
2305
|
+
* @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
|
|
2306
|
+
* @returns the current scene
|
|
2307
|
+
*/
|
|
2308
|
+
createPickingRayToRef(e, t, i, r, s, n = !1, l = !1) {
|
|
2309
|
+
throw f("Ray");
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* Creates a ray that can be used to pick in the scene
|
|
2313
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
2314
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
2315
|
+
* @param camera defines the camera to use for the picking
|
|
2316
|
+
* @returns a Ray
|
|
2317
|
+
*/
|
|
2318
|
+
createPickingRayInCameraSpace(e, t, i) {
|
|
2319
|
+
throw f("Ray");
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Creates a ray that can be used to pick in the scene
|
|
2323
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
2324
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
2325
|
+
* @param result defines the ray where to store the picking ray
|
|
2326
|
+
* @param camera defines the camera to use for the picking
|
|
2327
|
+
* @returns the current scene
|
|
2328
|
+
*/
|
|
2329
|
+
createPickingRayInCameraSpaceToRef(e, t, i, r) {
|
|
2330
|
+
throw f("Ray");
|
|
2331
|
+
}
|
|
2332
|
+
/** @internal */
|
|
2333
|
+
get _pickingAvailable() {
|
|
2334
|
+
return !1;
|
|
2335
|
+
}
|
|
2336
|
+
/** Launch a ray to try to pick a mesh in the scene
|
|
2337
|
+
* @param x position on screen
|
|
2338
|
+
* @param y position on screen
|
|
2339
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
|
|
2340
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
2341
|
+
* @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
2342
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
2343
|
+
* @returns a PickingInfo
|
|
2344
|
+
*/
|
|
2345
|
+
pick(e, t, i, r, s, n) {
|
|
2346
|
+
return new I();
|
|
2347
|
+
}
|
|
2348
|
+
/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
|
|
2349
|
+
* @param x position on screen
|
|
2350
|
+
* @param y position on screen
|
|
2351
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
|
|
2352
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
2353
|
+
* @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
2354
|
+
* @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)
|
|
2355
|
+
*/
|
|
2356
|
+
pickWithBoundingInfo(e, t, i, r, s) {
|
|
2357
|
+
return new I();
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
|
|
2361
|
+
* irrespective of orientation.
|
|
2362
|
+
* @param ray The ray to use to pick meshes
|
|
2363
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true
|
|
2364
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
2365
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
2366
|
+
* @returns a PickingInfo
|
|
2367
|
+
*/
|
|
2368
|
+
pickWithRay(e, t, i, r) {
|
|
2369
|
+
throw f("Ray");
|
|
2370
|
+
}
|
|
2371
|
+
/**
|
|
2372
|
+
* Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
|
|
2373
|
+
* irrespective of orientation.
|
|
2374
|
+
* @param x X position on screen
|
|
2375
|
+
* @param y Y position on screen
|
|
2376
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
|
|
2377
|
+
* @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
2378
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
2379
|
+
* @returns an array of PickingInfo
|
|
2380
|
+
*/
|
|
2381
|
+
multiPick(e, t, i, r, s) {
|
|
2382
|
+
throw f("Ray");
|
|
2383
|
+
}
|
|
2384
|
+
/**
|
|
2385
|
+
* Launch a ray to try to pick a mesh in the scene
|
|
2386
|
+
* @param ray Ray to use
|
|
2387
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
|
|
2388
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
2389
|
+
* @returns an array of PickingInfo
|
|
2390
|
+
*/
|
|
2391
|
+
multiPickWithRay(e, t, i) {
|
|
2392
|
+
throw f("Ray");
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Force the value of meshUnderPointer
|
|
2396
|
+
* @param mesh defines the mesh to use
|
|
2397
|
+
* @param pointerId optional pointer id when using more than one pointer
|
|
2398
|
+
* @param pickResult optional pickingInfo data used to find mesh
|
|
2399
|
+
*/
|
|
2400
|
+
setPointerOverMesh(e, t, i) {
|
|
2401
|
+
this._inputManager.setPointerOverMesh(e, t, i);
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Gets the mesh under the pointer
|
|
2405
|
+
* @returns a Mesh or null if no mesh is under the pointer
|
|
2406
|
+
*/
|
|
2407
|
+
getPointerOverMesh() {
|
|
2408
|
+
return this._inputManager.getPointerOverMesh();
|
|
2409
|
+
}
|
|
2410
|
+
// Misc.
|
|
2411
|
+
/** @internal */
|
|
2412
|
+
_rebuildGeometries() {
|
|
2413
|
+
for (const e of this.geometries)
|
|
2414
|
+
e._rebuild();
|
|
2415
|
+
for (const e of this.meshes)
|
|
2416
|
+
e._rebuild();
|
|
2417
|
+
this.postProcessManager && this.postProcessManager._rebuild();
|
|
2418
|
+
for (const e of this._components)
|
|
2419
|
+
e.rebuild();
|
|
2420
|
+
for (const e of this.particleSystems)
|
|
2421
|
+
e.rebuild();
|
|
2422
|
+
if (this.spriteManagers)
|
|
2423
|
+
for (const e of this.spriteManagers)
|
|
2424
|
+
e.rebuild();
|
|
2425
|
+
}
|
|
2426
|
+
/** @internal */
|
|
2427
|
+
_rebuildTextures() {
|
|
2428
|
+
for (const e of this.textures)
|
|
2429
|
+
e._rebuild();
|
|
2430
|
+
this.markAllMaterialsAsDirty(1);
|
|
2431
|
+
}
|
|
2432
|
+
// Tags
|
|
2433
|
+
_getByTags(e, t, i) {
|
|
2434
|
+
if (t === void 0)
|
|
2435
|
+
return e;
|
|
2436
|
+
const r = [];
|
|
2437
|
+
i = i || ((s) => {
|
|
2438
|
+
});
|
|
2439
|
+
for (const s in e) {
|
|
2440
|
+
const n = e[s];
|
|
2441
|
+
T && T.MatchesQuery(n, t) && (r.push(n), i(n));
|
|
2442
|
+
}
|
|
2443
|
+
return r;
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Get a list of meshes by tags
|
|
2447
|
+
* @param tagsQuery defines the tags query to use
|
|
2448
|
+
* @param forEach defines a predicate used to filter results
|
|
2449
|
+
* @returns an array of Mesh
|
|
2450
|
+
*/
|
|
2451
|
+
getMeshesByTags(e, t) {
|
|
2452
|
+
return this._getByTags(this.meshes, e, t);
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* Get a list of cameras by tags
|
|
2456
|
+
* @param tagsQuery defines the tags query to use
|
|
2457
|
+
* @param forEach defines a predicate used to filter results
|
|
2458
|
+
* @returns an array of Camera
|
|
2459
|
+
*/
|
|
2460
|
+
getCamerasByTags(e, t) {
|
|
2461
|
+
return this._getByTags(this.cameras, e, t);
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* Get a list of lights by tags
|
|
2465
|
+
* @param tagsQuery defines the tags query to use
|
|
2466
|
+
* @param forEach defines a predicate used to filter results
|
|
2467
|
+
* @returns an array of Light
|
|
2468
|
+
*/
|
|
2469
|
+
getLightsByTags(e, t) {
|
|
2470
|
+
return this._getByTags(this.lights, e, t);
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Get a list of materials by tags
|
|
2474
|
+
* @param tagsQuery defines the tags query to use
|
|
2475
|
+
* @param forEach defines a predicate used to filter results
|
|
2476
|
+
* @returns an array of Material
|
|
2477
|
+
*/
|
|
2478
|
+
getMaterialByTags(e, t) {
|
|
2479
|
+
return this._getByTags(this.materials, e, t).concat(this._getByTags(this.multiMaterials, e, t));
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* Get a list of transform nodes by tags
|
|
2483
|
+
* @param tagsQuery defines the tags query to use
|
|
2484
|
+
* @param forEach defines a predicate used to filter results
|
|
2485
|
+
* @returns an array of TransformNode
|
|
2486
|
+
*/
|
|
2487
|
+
getTransformNodesByTags(e, t) {
|
|
2488
|
+
return this._getByTags(this.transformNodes, e, t);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Overrides the default sort function applied in the rendering group to prepare the meshes.
|
|
2492
|
+
* This allowed control for front to back rendering or reversly depending of the special needs.
|
|
2493
|
+
*
|
|
2494
|
+
* @param renderingGroupId The rendering group id corresponding to its index
|
|
2495
|
+
* @param opaqueSortCompareFn The opaque queue comparison function use to sort.
|
|
2496
|
+
* @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
|
|
2497
|
+
* @param transparentSortCompareFn The transparent queue comparison function use to sort.
|
|
2498
|
+
*/
|
|
2499
|
+
setRenderingOrder(e, t = null, i = null, r = null) {
|
|
2500
|
+
this._renderingManager.setRenderingOrder(e, t, i, r);
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
2504
|
+
*
|
|
2505
|
+
* @param renderingGroupId The rendering group id corresponding to its index
|
|
2506
|
+
* @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
2507
|
+
* @param depth Automatically clears depth between groups if true and autoClear is true.
|
|
2508
|
+
* @param stencil Automatically clears stencil between groups if true and autoClear is true.
|
|
2509
|
+
*/
|
|
2510
|
+
setRenderingAutoClearDepthStencil(e, t, i = !0, r = !0) {
|
|
2511
|
+
this._renderingManager.setRenderingAutoClearDepthStencil(e, t, i, r);
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* Gets the current auto clear configuration for one rendering group of the rendering
|
|
2515
|
+
* manager.
|
|
2516
|
+
* @param index the rendering group index to get the information for
|
|
2517
|
+
* @returns The auto clear setup for the requested rendering group
|
|
2518
|
+
*/
|
|
2519
|
+
getAutoClearDepthStencilSetup(e) {
|
|
2520
|
+
return this._renderingManager.getAutoClearDepthStencilSetup(e);
|
|
2521
|
+
}
|
|
2522
|
+
/** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
|
|
2523
|
+
get blockMaterialDirtyMechanism() {
|
|
2524
|
+
return this._blockMaterialDirtyMechanism;
|
|
2525
|
+
}
|
|
2526
|
+
set blockMaterialDirtyMechanism(e) {
|
|
2527
|
+
this._blockMaterialDirtyMechanism !== e && (this._blockMaterialDirtyMechanism = e, e || this.markAllMaterialsAsDirty(63));
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Will flag all materials as dirty to trigger new shader compilation
|
|
2531
|
+
* @param flag defines the flag used to specify which material part must be marked as dirty
|
|
2532
|
+
* @param predicate If not null, it will be used to specify if a material has to be marked as dirty
|
|
2533
|
+
*/
|
|
2534
|
+
markAllMaterialsAsDirty(e, t) {
|
|
2535
|
+
if (!this._blockMaterialDirtyMechanism)
|
|
2536
|
+
for (const i of this.materials)
|
|
2537
|
+
t && !t(i) || i.markAsDirty(e);
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* @internal
|
|
2541
|
+
*/
|
|
2542
|
+
_loadFile(e, t, i, r, s, n, l) {
|
|
2543
|
+
const a = W(e, t, i, r ? this.offlineProvider : void 0, s, n, l);
|
|
2544
|
+
return this._activeRequests.push(a), a.onCompleteObservable.add((o) => {
|
|
2545
|
+
this._activeRequests.splice(this._activeRequests.indexOf(o), 1);
|
|
2546
|
+
}), a;
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* @internal
|
|
2550
|
+
*/
|
|
2551
|
+
_loadFileAsync(e, t, i, r, s) {
|
|
2552
|
+
return new Promise((n, l) => {
|
|
2553
|
+
this._loadFile(e, (a) => {
|
|
2554
|
+
n(a);
|
|
2555
|
+
}, t, i, r, (a, o) => {
|
|
2556
|
+
l(o);
|
|
2557
|
+
}, s);
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
/**
|
|
2561
|
+
* @internal
|
|
2562
|
+
*/
|
|
2563
|
+
_requestFile(e, t, i, r, s, n, l) {
|
|
2564
|
+
const a = z(e, t, i, r ? this.offlineProvider : void 0, s, n, l);
|
|
2565
|
+
return this._activeRequests.push(a), a.onCompleteObservable.add((o) => {
|
|
2566
|
+
this._activeRequests.splice(this._activeRequests.indexOf(o), 1);
|
|
2567
|
+
}), a;
|
|
2568
|
+
}
|
|
2569
|
+
/**
|
|
2570
|
+
* @internal
|
|
2571
|
+
*/
|
|
2572
|
+
_requestFileAsync(e, t, i, r, s) {
|
|
2573
|
+
return new Promise((n, l) => {
|
|
2574
|
+
this._requestFile(e, (a) => {
|
|
2575
|
+
n(a);
|
|
2576
|
+
}, t, i, r, (a) => {
|
|
2577
|
+
l(a);
|
|
2578
|
+
}, s);
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* @internal
|
|
2583
|
+
*/
|
|
2584
|
+
_readFile(e, t, i, r, s) {
|
|
2585
|
+
const n = j(e, t, i, r, s);
|
|
2586
|
+
return this._activeRequests.push(n), n.onCompleteObservable.add((l) => {
|
|
2587
|
+
this._activeRequests.splice(this._activeRequests.indexOf(l), 1);
|
|
2588
|
+
}), n;
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* @internal
|
|
2592
|
+
*/
|
|
2593
|
+
_readFileAsync(e, t, i) {
|
|
2594
|
+
return new Promise((r, s) => {
|
|
2595
|
+
this._readFile(e, (n) => {
|
|
2596
|
+
r(n);
|
|
2597
|
+
}, t, i, (n) => {
|
|
2598
|
+
s(n);
|
|
2599
|
+
});
|
|
2600
|
+
});
|
|
2601
|
+
}
|
|
2602
|
+
/**
|
|
2603
|
+
* This method gets the performance collector belonging to the scene, which is generally shared with the inspector.
|
|
2604
|
+
* @returns the perf collector belonging to the scene.
|
|
2605
|
+
*/
|
|
2606
|
+
getPerfCollector() {
|
|
2607
|
+
throw f("performanceViewerSceneExtension");
|
|
2608
|
+
}
|
|
2609
|
+
// deprecated
|
|
2610
|
+
/**
|
|
2611
|
+
* Sets the active camera of the scene using its Id
|
|
2612
|
+
* @param id defines the camera's Id
|
|
2613
|
+
* @returns the new active camera or null if none found.
|
|
2614
|
+
* @deprecated Please use setActiveCameraById instead
|
|
2615
|
+
*/
|
|
2616
|
+
setActiveCameraByID(e) {
|
|
2617
|
+
return this.setActiveCameraById(e);
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* Get a material using its id
|
|
2621
|
+
* @param id defines the material's Id
|
|
2622
|
+
* @returns the material or null if none found.
|
|
2623
|
+
* @deprecated Please use getMaterialById instead
|
|
2624
|
+
*/
|
|
2625
|
+
getMaterialByID(e) {
|
|
2626
|
+
return this.getMaterialById(e);
|
|
2627
|
+
}
|
|
2628
|
+
/**
|
|
2629
|
+
* Gets a the last added material using a given id
|
|
2630
|
+
* @param id defines the material's Id
|
|
2631
|
+
* @returns the last material with the given id or null if none found.
|
|
2632
|
+
* @deprecated Please use getLastMaterialById instead
|
|
2633
|
+
*/
|
|
2634
|
+
getLastMaterialByID(e) {
|
|
2635
|
+
return this.getLastMaterialById(e);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* Get a texture using its unique id
|
|
2639
|
+
* @param uniqueId defines the texture's unique id
|
|
2640
|
+
* @returns the texture or null if none found.
|
|
2641
|
+
* @deprecated Please use getTextureByUniqueId instead
|
|
2642
|
+
*/
|
|
2643
|
+
getTextureByUniqueID(e) {
|
|
2644
|
+
return this.getTextureByUniqueId(e);
|
|
2645
|
+
}
|
|
2646
|
+
/**
|
|
2647
|
+
* Gets a camera using its Id
|
|
2648
|
+
* @param id defines the Id to look for
|
|
2649
|
+
* @returns the camera or null if not found
|
|
2650
|
+
* @deprecated Please use getCameraById instead
|
|
2651
|
+
*/
|
|
2652
|
+
getCameraByID(e) {
|
|
2653
|
+
return this.getCameraById(e);
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* Gets a camera using its unique Id
|
|
2657
|
+
* @param uniqueId defines the unique Id to look for
|
|
2658
|
+
* @returns the camera or null if not found
|
|
2659
|
+
* @deprecated Please use getCameraByUniqueId instead
|
|
2660
|
+
*/
|
|
2661
|
+
getCameraByUniqueID(e) {
|
|
2662
|
+
return this.getCameraByUniqueId(e);
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Gets a bone using its Id
|
|
2666
|
+
* @param id defines the bone's Id
|
|
2667
|
+
* @returns the bone or null if not found
|
|
2668
|
+
* @deprecated Please use getBoneById instead
|
|
2669
|
+
*/
|
|
2670
|
+
getBoneByID(e) {
|
|
2671
|
+
return this.getBoneById(e);
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Gets a light node using its Id
|
|
2675
|
+
* @param id defines the light's Id
|
|
2676
|
+
* @returns the light or null if none found.
|
|
2677
|
+
* @deprecated Please use getLightById instead
|
|
2678
|
+
*/
|
|
2679
|
+
getLightByID(e) {
|
|
2680
|
+
return this.getLightById(e);
|
|
2681
|
+
}
|
|
2682
|
+
/**
|
|
2683
|
+
* Gets a light node using its scene-generated unique Id
|
|
2684
|
+
* @param uniqueId defines the light's unique Id
|
|
2685
|
+
* @returns the light or null if none found.
|
|
2686
|
+
* @deprecated Please use getLightByUniqueId instead
|
|
2687
|
+
*/
|
|
2688
|
+
getLightByUniqueID(e) {
|
|
2689
|
+
return this.getLightByUniqueId(e);
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
* Gets a particle system by Id
|
|
2693
|
+
* @param id defines the particle system Id
|
|
2694
|
+
* @returns the corresponding system or null if none found
|
|
2695
|
+
* @deprecated Please use getParticleSystemById instead
|
|
2696
|
+
*/
|
|
2697
|
+
getParticleSystemByID(e) {
|
|
2698
|
+
return this.getParticleSystemById(e);
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* Gets a geometry using its Id
|
|
2702
|
+
* @param id defines the geometry's Id
|
|
2703
|
+
* @returns the geometry or null if none found.
|
|
2704
|
+
* @deprecated Please use getGeometryById instead
|
|
2705
|
+
*/
|
|
2706
|
+
getGeometryByID(e) {
|
|
2707
|
+
return this.getGeometryById(e);
|
|
2708
|
+
}
|
|
2709
|
+
/**
|
|
2710
|
+
* Gets the first added mesh found of a given Id
|
|
2711
|
+
* @param id defines the Id to search for
|
|
2712
|
+
* @returns the mesh found or null if not found at all
|
|
2713
|
+
* @deprecated Please use getMeshById instead
|
|
2714
|
+
*/
|
|
2715
|
+
getMeshByID(e) {
|
|
2716
|
+
return this.getMeshById(e);
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Gets a mesh with its auto-generated unique Id
|
|
2720
|
+
* @param uniqueId defines the unique Id to search for
|
|
2721
|
+
* @returns the found mesh or null if not found at all.
|
|
2722
|
+
* @deprecated Please use getMeshByUniqueId instead
|
|
2723
|
+
*/
|
|
2724
|
+
getMeshByUniqueID(e) {
|
|
2725
|
+
return this.getMeshByUniqueId(e);
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Gets a the last added mesh using a given Id
|
|
2729
|
+
* @param id defines the Id to search for
|
|
2730
|
+
* @returns the found mesh or null if not found at all.
|
|
2731
|
+
* @deprecated Please use getLastMeshById instead
|
|
2732
|
+
*/
|
|
2733
|
+
getLastMeshByID(e) {
|
|
2734
|
+
return this.getLastMeshById(e);
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* Gets a list of meshes using their Id
|
|
2738
|
+
* @param id defines the Id to search for
|
|
2739
|
+
* @returns a list of meshes
|
|
2740
|
+
* @deprecated Please use getMeshesById instead
|
|
2741
|
+
*/
|
|
2742
|
+
getMeshesByID(e) {
|
|
2743
|
+
return this.getMeshesById(e);
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Gets the first added transform node found of a given Id
|
|
2747
|
+
* @param id defines the Id to search for
|
|
2748
|
+
* @returns the found transform node or null if not found at all.
|
|
2749
|
+
* @deprecated Please use getTransformNodeById instead
|
|
2750
|
+
*/
|
|
2751
|
+
getTransformNodeByID(e) {
|
|
2752
|
+
return this.getTransformNodeById(e);
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* Gets a transform node with its auto-generated unique Id
|
|
2756
|
+
* @param uniqueId defines the unique Id to search for
|
|
2757
|
+
* @returns the found transform node or null if not found at all.
|
|
2758
|
+
* @deprecated Please use getTransformNodeByUniqueId instead
|
|
2759
|
+
*/
|
|
2760
|
+
getTransformNodeByUniqueID(e) {
|
|
2761
|
+
return this.getTransformNodeByUniqueId(e);
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Gets a list of transform nodes using their Id
|
|
2765
|
+
* @param id defines the Id to search for
|
|
2766
|
+
* @returns a list of transform nodes
|
|
2767
|
+
* @deprecated Please use getTransformNodesById instead
|
|
2768
|
+
*/
|
|
2769
|
+
getTransformNodesByID(e) {
|
|
2770
|
+
return this.getTransformNodesById(e);
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Gets a node (Mesh, Camera, Light) using a given Id
|
|
2774
|
+
* @param id defines the Id to search for
|
|
2775
|
+
* @returns the found node or null if not found at all
|
|
2776
|
+
* @deprecated Please use getNodeById instead
|
|
2777
|
+
*/
|
|
2778
|
+
getNodeByID(e) {
|
|
2779
|
+
return this.getNodeById(e);
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Gets a the last added node (Mesh, Camera, Light) using a given Id
|
|
2783
|
+
* @param id defines the Id to search for
|
|
2784
|
+
* @returns the found node or null if not found at all
|
|
2785
|
+
* @deprecated Please use getLastEntryById instead
|
|
2786
|
+
*/
|
|
2787
|
+
getLastEntryByID(e) {
|
|
2788
|
+
return this.getLastEntryById(e);
|
|
2789
|
+
}
|
|
2790
|
+
/**
|
|
2791
|
+
* Gets a skeleton using a given Id (if many are found, this function will pick the last one)
|
|
2792
|
+
* @param id defines the Id to search for
|
|
2793
|
+
* @returns the found skeleton or null if not found at all.
|
|
2794
|
+
* @deprecated Please use getLastSkeletonById instead
|
|
2795
|
+
*/
|
|
2796
|
+
getLastSkeletonByID(e) {
|
|
2797
|
+
return this.getLastSkeletonById(e);
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
c.FOGMODE_NONE = 0;
|
|
2801
|
+
c.FOGMODE_EXP = 1;
|
|
2802
|
+
c.FOGMODE_EXP2 = 2;
|
|
2803
|
+
c.FOGMODE_LINEAR = 3;
|
|
2804
|
+
c.MinDeltaTime = 1;
|
|
2805
|
+
c.MaxDeltaTime = 1e3;
|
|
2806
|
+
export {
|
|
2807
|
+
c as Scene,
|
|
2808
|
+
M as ScenePerformancePriority
|
|
2809
|
+
};
|