@spiffcommerce/preview 3.6.2-rc.4 → 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/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 +3 -2
|
@@ -0,0 +1,2526 @@
|
|
|
1
|
+
import { Observable as L } from "../Misc/observable.esm.js";
|
|
2
|
+
import { Tools as N, AsyncLoop as Y } from "../Misc/tools.esm.js";
|
|
3
|
+
import { DeepCopier as J } from "../Misc/deepCopier.esm.js";
|
|
4
|
+
import { Tags as C } from "../Misc/tags.esm.js";
|
|
5
|
+
import { runCoroutineSync as X, runCoroutineAsync as $, createYieldingScheduler as j } from "../Misc/coroutine.esm.js";
|
|
6
|
+
import { Camera as ee } from "../Cameras/camera.esm.js";
|
|
7
|
+
import { ScenePerformancePriority as te } from "../scene.esm.js";
|
|
8
|
+
import { Vector3 as w, Vector2 as W, Quaternion as U, Matrix as E } from "../Maths/math.vector.esm.js";
|
|
9
|
+
import { Color3 as ne } from "../Maths/math.color.esm.js";
|
|
10
|
+
import { Node as K } from "../node.esm.js";
|
|
11
|
+
import { VertexBuffer as d, Buffer as z } from "../Buffers/buffer.esm.js";
|
|
12
|
+
import { VertexData as P } from "./mesh.vertexData.esm.js";
|
|
13
|
+
import { Geometry as V } from "./geometry.esm.js";
|
|
14
|
+
import { AbstractMesh as ie } from "./abstractMesh.esm.js";
|
|
15
|
+
import { SubMesh as k } from "./subMesh.esm.js";
|
|
16
|
+
import { Material as T } from "../Materials/material.esm.js";
|
|
17
|
+
import { MultiMaterial as G } from "../Materials/multiMaterial.esm.js";
|
|
18
|
+
import { SceneLoaderFlags as se } from "../Loading/sceneLoaderFlags.esm.js";
|
|
19
|
+
import { SerializationHelper as q } from "../Misc/decorators.esm.js";
|
|
20
|
+
import { Logger as F } from "../Misc/logger.esm.js";
|
|
21
|
+
import { GetClass as Z, RegisterClass as re } from "../Misc/typeStore.esm.js";
|
|
22
|
+
import { _WarnImport as R } from "../Misc/devTools.esm.js";
|
|
23
|
+
import { SceneComponentConstants as H } from "../sceneComponent.esm.js";
|
|
24
|
+
import { MeshLODLevel as ae } from "./meshLODLevel.esm.js";
|
|
25
|
+
class oe {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.visibleInstances = {}, this.batchCache = new Q(), this.batchCacheReplacementModeInFrozenMode = new Q(), this.instancesBufferSize = 32 * 16 * 4;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
class Q {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.mustReturn = !1, this.visibleInstances = new Array(), this.renderSelf = new Array(), this.hardwareInstancedRendering = new Array();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class le {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.instancesCount = 0, this.matrixBuffer = null, this.previousMatrixBuffer = null, this.matrixBufferSize = 32 * 16, this.matrixData = null, this.boundingVectors = [], this.worldMatrices = null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class he {
|
|
41
|
+
constructor() {
|
|
42
|
+
this._areNormalsFrozen = !1, this._source = null, this.meshMap = null, this._preActivateId = -1, this._LODLevels = new Array(), this._useLODScreenCoverage = !1, this._effectiveMaterial = null, this._forcedInstanceCount = 0, this._overrideRenderingFillMode = null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class D extends ie {
|
|
46
|
+
/**
|
|
47
|
+
* Gets the default side orientation.
|
|
48
|
+
* @param orientation the orientation to value to attempt to get
|
|
49
|
+
* @returns the default orientation
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
static _GetDefaultSideOrientation(e) {
|
|
53
|
+
return e || D.FRONTSIDE;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
|
|
57
|
+
*/
|
|
58
|
+
get useLODScreenCoverage() {
|
|
59
|
+
return this._internalMeshDataInfo._useLODScreenCoverage;
|
|
60
|
+
}
|
|
61
|
+
set useLODScreenCoverage(e) {
|
|
62
|
+
this._internalMeshDataInfo._useLODScreenCoverage = e, this._sortLODLevels();
|
|
63
|
+
}
|
|
64
|
+
get computeBonesUsingShaders() {
|
|
65
|
+
return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
|
|
66
|
+
}
|
|
67
|
+
set computeBonesUsingShaders(e) {
|
|
68
|
+
this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== e && (e && this._internalMeshDataInfo._sourcePositions && (this.setVerticesData(d.PositionKind, this._internalMeshDataInfo._sourcePositions, !0), this._internalMeshDataInfo._sourceNormals && this.setVerticesData(d.NormalKind, this._internalMeshDataInfo._sourceNormals, !0), this._internalMeshDataInfo._sourcePositions = null, this._internalMeshDataInfo._sourceNormals = null), this._internalAbstractMeshDataInfo._computeBonesUsingShaders = e, this._markSubMeshesAsAttributesDirty());
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* An event triggered before rendering the mesh
|
|
72
|
+
*/
|
|
73
|
+
get onBeforeRenderObservable() {
|
|
74
|
+
return this._internalMeshDataInfo._onBeforeRenderObservable || (this._internalMeshDataInfo._onBeforeRenderObservable = new L()), this._internalMeshDataInfo._onBeforeRenderObservable;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* An event triggered before binding the mesh
|
|
78
|
+
*/
|
|
79
|
+
get onBeforeBindObservable() {
|
|
80
|
+
return this._internalMeshDataInfo._onBeforeBindObservable || (this._internalMeshDataInfo._onBeforeBindObservable = new L()), this._internalMeshDataInfo._onBeforeBindObservable;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* An event triggered after rendering the mesh
|
|
84
|
+
*/
|
|
85
|
+
get onAfterRenderObservable() {
|
|
86
|
+
return this._internalMeshDataInfo._onAfterRenderObservable || (this._internalMeshDataInfo._onAfterRenderObservable = new L()), this._internalMeshDataInfo._onAfterRenderObservable;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* An event triggeredbetween rendering pass when using separateCullingPass = true
|
|
90
|
+
*/
|
|
91
|
+
get onBetweenPassObservable() {
|
|
92
|
+
return this._internalMeshDataInfo._onBetweenPassObservable || (this._internalMeshDataInfo._onBetweenPassObservable = new L()), this._internalMeshDataInfo._onBetweenPassObservable;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* An event triggered before drawing the mesh
|
|
96
|
+
*/
|
|
97
|
+
get onBeforeDrawObservable() {
|
|
98
|
+
return this._internalMeshDataInfo._onBeforeDrawObservable || (this._internalMeshDataInfo._onBeforeDrawObservable = new L()), this._internalMeshDataInfo._onBeforeDrawObservable;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
|
|
102
|
+
*/
|
|
103
|
+
set onBeforeDraw(e) {
|
|
104
|
+
this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(e);
|
|
105
|
+
}
|
|
106
|
+
get hasInstances() {
|
|
107
|
+
return this.instances.length > 0;
|
|
108
|
+
}
|
|
109
|
+
get hasThinInstances() {
|
|
110
|
+
var e;
|
|
111
|
+
return ((e = this._thinInstanceDataStorage.instancesCount) !== null && e !== void 0 ? e : 0) > 0;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Gets or sets the forced number of instances to display.
|
|
115
|
+
* If 0 (default value), the number of instances is not forced and depends on the draw type
|
|
116
|
+
* (regular / instance / thin instances mesh)
|
|
117
|
+
*/
|
|
118
|
+
get forcedInstanceCount() {
|
|
119
|
+
return this._internalMeshDataInfo._forcedInstanceCount;
|
|
120
|
+
}
|
|
121
|
+
set forcedInstanceCount(e) {
|
|
122
|
+
this._internalMeshDataInfo._forcedInstanceCount = e;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Use this property to override the Material's fillMode value
|
|
126
|
+
*/
|
|
127
|
+
get overrideRenderingFillMode() {
|
|
128
|
+
return this._internalMeshDataInfo._overrideRenderingFillMode;
|
|
129
|
+
}
|
|
130
|
+
set overrideRenderingFillMode(e) {
|
|
131
|
+
this._internalMeshDataInfo._overrideRenderingFillMode = e;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets the source mesh (the one used to clone this one from)
|
|
135
|
+
*/
|
|
136
|
+
get source() {
|
|
137
|
+
return this._internalMeshDataInfo._source;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Gets the list of clones of this mesh
|
|
141
|
+
* The scene must have been constructed with useClonedMeshMap=true for this to work!
|
|
142
|
+
* Note that useClonedMeshMap=true is the default setting
|
|
143
|
+
*/
|
|
144
|
+
get cloneMeshMap() {
|
|
145
|
+
return this._internalMeshDataInfo.meshMap;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Gets or sets a boolean indicating that this mesh does not use index buffer
|
|
149
|
+
*/
|
|
150
|
+
get isUnIndexed() {
|
|
151
|
+
return this._unIndexed;
|
|
152
|
+
}
|
|
153
|
+
set isUnIndexed(e) {
|
|
154
|
+
this._unIndexed !== e && (this._unIndexed = e, this._markSubMeshesAsAttributesDirty());
|
|
155
|
+
}
|
|
156
|
+
/** Gets the array buffer used to store the instanced buffer used for instances' world matrices */
|
|
157
|
+
get worldMatrixInstancedBuffer() {
|
|
158
|
+
return this._instanceDataStorage.instancesData;
|
|
159
|
+
}
|
|
160
|
+
/** Gets the array buffer used to store the instanced buffer used for instances' previous world matrices */
|
|
161
|
+
get previousWorldMatrixInstancedBuffer() {
|
|
162
|
+
return this._instanceDataStorage.instancesPreviousData;
|
|
163
|
+
}
|
|
164
|
+
/** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
|
|
165
|
+
get manualUpdateOfWorldMatrixInstancedBuffer() {
|
|
166
|
+
return this._instanceDataStorage.manualUpdate;
|
|
167
|
+
}
|
|
168
|
+
set manualUpdateOfWorldMatrixInstancedBuffer(e) {
|
|
169
|
+
this._instanceDataStorage.manualUpdate = e;
|
|
170
|
+
}
|
|
171
|
+
/** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
|
|
172
|
+
get manualUpdateOfPreviousWorldMatrixInstancedBuffer() {
|
|
173
|
+
return this._instanceDataStorage.previousManualUpdate;
|
|
174
|
+
}
|
|
175
|
+
set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e) {
|
|
176
|
+
this._instanceDataStorage.previousManualUpdate = e;
|
|
177
|
+
}
|
|
178
|
+
/** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode) */
|
|
179
|
+
get forceWorldMatrixInstancedBufferUpdate() {
|
|
180
|
+
return this._instanceDataStorage.forceMatrixUpdates;
|
|
181
|
+
}
|
|
182
|
+
set forceWorldMatrixInstancedBufferUpdate(e) {
|
|
183
|
+
this._instanceDataStorage.forceMatrixUpdates = e;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @constructor
|
|
187
|
+
* @param name The value used by scene.getMeshByName() to do a lookup.
|
|
188
|
+
* @param scene The scene to add this mesh to.
|
|
189
|
+
* @param parent The parent of this mesh, if it has one
|
|
190
|
+
* @param source An optional Mesh from which geometry is shared, cloned.
|
|
191
|
+
* @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
|
|
192
|
+
* When false, achieved by calling a clone(), also passing False.
|
|
193
|
+
* This will make creation of children, recursive.
|
|
194
|
+
* @param clonePhysicsImpostor When cloning, include cloning mesh physics impostor, default True.
|
|
195
|
+
*/
|
|
196
|
+
constructor(e, n = null, i = null, t = null, r, s = !0) {
|
|
197
|
+
if (super(e, n), this._internalMeshDataInfo = new he(), this.delayLoadState = 0, this.instances = new Array(), this._creationDataStorage = null, this._geometry = null, this._instanceDataStorage = new oe(), this._thinInstanceDataStorage = new le(), this._shouldGenerateFlatShading = !1, this._originalBuilderSideOrientation = D.DEFAULTSIDE, this.overrideMaterialSideOrientation = null, this.ignoreCameraMaxZ = !1, n = this.getScene(), this._onBeforeDraw = (a, o, l) => {
|
|
198
|
+
a && l && (this._uniformBuffer ? this.transferToEffect(o) : l.bindOnlyWorldMatrix(o));
|
|
199
|
+
}, t) {
|
|
200
|
+
if (t._geometry && t._geometry.applyToMesh(this), J.DeepCopy(t, this, [
|
|
201
|
+
"name",
|
|
202
|
+
"material",
|
|
203
|
+
"skeleton",
|
|
204
|
+
"instances",
|
|
205
|
+
"parent",
|
|
206
|
+
"uniqueId",
|
|
207
|
+
"source",
|
|
208
|
+
"metadata",
|
|
209
|
+
"morphTargetManager",
|
|
210
|
+
"hasInstances",
|
|
211
|
+
"worldMatrixInstancedBuffer",
|
|
212
|
+
"previousWorldMatrixInstancedBuffer",
|
|
213
|
+
"hasLODLevels",
|
|
214
|
+
"geometry",
|
|
215
|
+
"isBlocked",
|
|
216
|
+
"areNormalsFrozen",
|
|
217
|
+
"facetNb",
|
|
218
|
+
"isFacetDataEnabled",
|
|
219
|
+
"lightSources",
|
|
220
|
+
"useBones",
|
|
221
|
+
"isAnInstance",
|
|
222
|
+
"collider",
|
|
223
|
+
"edgesRenderer",
|
|
224
|
+
"forward",
|
|
225
|
+
"up",
|
|
226
|
+
"right",
|
|
227
|
+
"absolutePosition",
|
|
228
|
+
"absoluteScaling",
|
|
229
|
+
"absoluteRotationQuaternion",
|
|
230
|
+
"isWorldMatrixFrozen",
|
|
231
|
+
"nonUniformScaling",
|
|
232
|
+
"behaviors",
|
|
233
|
+
"worldMatrixFromCache",
|
|
234
|
+
"hasThinInstances",
|
|
235
|
+
"cloneMeshMap",
|
|
236
|
+
"hasBoundingInfo",
|
|
237
|
+
"physicsBody",
|
|
238
|
+
"physicsImpostor"
|
|
239
|
+
], ["_poseMatrix"]), this._internalMeshDataInfo._source = t, n.useClonedMeshMap && (t._internalMeshDataInfo.meshMap || (t._internalMeshDataInfo.meshMap = {}), t._internalMeshDataInfo.meshMap[this.uniqueId] = this), this._originalBuilderSideOrientation = t._originalBuilderSideOrientation, this._creationDataStorage = t._creationDataStorage, t._ranges) {
|
|
240
|
+
const a = t._ranges;
|
|
241
|
+
for (const o in a)
|
|
242
|
+
Object.prototype.hasOwnProperty.call(a, o) && a[o] && this.createAnimationRange(o, a[o].from, a[o].to);
|
|
243
|
+
}
|
|
244
|
+
if (t.metadata && t.metadata.clone ? this.metadata = t.metadata.clone() : this.metadata = t.metadata, this._internalMetadata = t._internalMetadata, C && C.HasTags(t) && C.AddTagsTo(this, C.GetTags(t, !0)), this.setEnabled(t.isEnabled(!1)), this.parent = t.parent, this.setPivotMatrix(t.getPivotMatrix()), this.id = e + "." + t.id, this.material = t.material, !r) {
|
|
245
|
+
const a = t.getDescendants(!0);
|
|
246
|
+
for (let o = 0; o < a.length; o++) {
|
|
247
|
+
const l = a[o];
|
|
248
|
+
l.clone && l.clone(e + "." + l.name, this);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (t.morphTargetManager && (this.morphTargetManager = t.morphTargetManager), n.getPhysicsEngine) {
|
|
252
|
+
const a = n.getPhysicsEngine();
|
|
253
|
+
if (s && a)
|
|
254
|
+
if (a.getPluginVersion() === 1) {
|
|
255
|
+
const o = a.getImpostorForPhysicsObject(t);
|
|
256
|
+
o && (this.physicsImpostor = o.clone(this));
|
|
257
|
+
} else
|
|
258
|
+
a.getPluginVersion() === 2 && t.physicsBody && t.physicsBody.clone(this);
|
|
259
|
+
}
|
|
260
|
+
for (let a = 0; a < n.particleSystems.length; a++) {
|
|
261
|
+
const o = n.particleSystems[a];
|
|
262
|
+
o.emitter === t && o.clone(o.name, this);
|
|
263
|
+
}
|
|
264
|
+
this.skeleton = t.skeleton, this.refreshBoundingInfo(!0, !0), this.computeWorldMatrix(!0);
|
|
265
|
+
}
|
|
266
|
+
i !== null && (this.parent = i), this._instanceDataStorage.hardwareInstancedRendering = this.getEngine().getCaps().instancedArrays, this._internalMeshDataInfo._onMeshReadyObserverAdded = (a) => {
|
|
267
|
+
a.unregisterOnNextCall = !0, this.isReady(!0) ? this.onMeshReadyObservable.notifyObservers(this) : this._internalMeshDataInfo._checkReadinessObserver || (this._internalMeshDataInfo._checkReadinessObserver = this._scene.onBeforeRenderObservable.add(() => {
|
|
268
|
+
this.isReady(!0) && (this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), this._internalMeshDataInfo._checkReadinessObserver = null, this.onMeshReadyObservable.notifyObservers(this));
|
|
269
|
+
}));
|
|
270
|
+
}, this.onMeshReadyObservable = new L(this._internalMeshDataInfo._onMeshReadyObserverAdded), t && t.onClonedObservable.notifyObservers(this);
|
|
271
|
+
}
|
|
272
|
+
instantiateHierarchy(e = null, n, i) {
|
|
273
|
+
const t = this.getTotalVertices() === 0 || n && n.doNotInstantiate && (n.doNotInstantiate === !0 || n.doNotInstantiate(this)) ? this.clone("Clone of " + (this.name || this.id), e || this.parent, !0) : this.createInstance("instance of " + (this.name || this.id));
|
|
274
|
+
t.parent = e || this.parent, t.position = this.position.clone(), t.scaling = this.scaling.clone(), this.rotationQuaternion ? t.rotationQuaternion = this.rotationQuaternion.clone() : t.rotation = this.rotation.clone(), i && i(this, t);
|
|
275
|
+
for (const r of this.getChildTransformNodes(!0))
|
|
276
|
+
r.getClassName() === "InstancedMesh" && t.getClassName() === "Mesh" && r.sourceMesh === this ? r.instantiateHierarchy(t, {
|
|
277
|
+
doNotInstantiate: n && n.doNotInstantiate || !1,
|
|
278
|
+
newSourcedMesh: t
|
|
279
|
+
}, i) : r.instantiateHierarchy(t, n, i);
|
|
280
|
+
return t;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Gets the class name
|
|
284
|
+
* @returns the string "Mesh".
|
|
285
|
+
*/
|
|
286
|
+
getClassName() {
|
|
287
|
+
return "Mesh";
|
|
288
|
+
}
|
|
289
|
+
/** @internal */
|
|
290
|
+
get _isMesh() {
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Returns a description of this mesh
|
|
295
|
+
* @param fullDetails define if full details about this mesh must be used
|
|
296
|
+
* @returns a descriptive string representing this mesh
|
|
297
|
+
*/
|
|
298
|
+
toString(e) {
|
|
299
|
+
let n = super.toString(e);
|
|
300
|
+
if (n += ", n vertices: " + this.getTotalVertices(), n += ", parent: " + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : "NONE"), this.animations)
|
|
301
|
+
for (let i = 0; i < this.animations.length; i++)
|
|
302
|
+
n += ", animation[0]: " + this.animations[i].toString(e);
|
|
303
|
+
if (e)
|
|
304
|
+
if (this._geometry) {
|
|
305
|
+
const i = this.getIndices(), t = this.getVerticesData(d.PositionKind);
|
|
306
|
+
t && i && (n += ", flat shading: " + (t.length / 3 === i.length ? "YES" : "NO"));
|
|
307
|
+
} else
|
|
308
|
+
n += ", flat shading: UNKNOWN";
|
|
309
|
+
return n;
|
|
310
|
+
}
|
|
311
|
+
/** @internal */
|
|
312
|
+
_unBindEffect() {
|
|
313
|
+
super._unBindEffect();
|
|
314
|
+
for (const e of this.instances)
|
|
315
|
+
e._unBindEffect();
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Gets a boolean indicating if this mesh has LOD
|
|
319
|
+
*/
|
|
320
|
+
get hasLODLevels() {
|
|
321
|
+
return this._internalMeshDataInfo._LODLevels.length > 0;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Gets the list of MeshLODLevel associated with the current mesh
|
|
325
|
+
* @returns an array of MeshLODLevel
|
|
326
|
+
*/
|
|
327
|
+
getLODLevels() {
|
|
328
|
+
return this._internalMeshDataInfo._LODLevels;
|
|
329
|
+
}
|
|
330
|
+
_sortLODLevels() {
|
|
331
|
+
const e = this._internalMeshDataInfo._useLODScreenCoverage ? -1 : 1;
|
|
332
|
+
this._internalMeshDataInfo._LODLevels.sort((n, i) => n.distanceOrScreenCoverage < i.distanceOrScreenCoverage ? e : n.distanceOrScreenCoverage > i.distanceOrScreenCoverage ? -e : 0);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Add a mesh as LOD level triggered at the given distance.
|
|
336
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
337
|
+
* @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
|
|
338
|
+
* If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
|
|
339
|
+
* Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
|
|
340
|
+
* Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
|
|
341
|
+
* @param mesh The mesh to be added as LOD level (can be null)
|
|
342
|
+
* @returns This mesh (for chaining)
|
|
343
|
+
*/
|
|
344
|
+
addLODLevel(e, n) {
|
|
345
|
+
if (n && n._masterMesh)
|
|
346
|
+
return F.Warn("You cannot use a mesh as LOD level twice"), this;
|
|
347
|
+
const i = new ae(e, n);
|
|
348
|
+
return this._internalMeshDataInfo._LODLevels.push(i), n && (n._masterMesh = this), this._sortLODLevels(), this;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Returns the LOD level mesh at the passed distance or null if not found.
|
|
352
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
353
|
+
* @param distance The distance from the center of the object to show this level
|
|
354
|
+
* @returns a Mesh or `null`
|
|
355
|
+
*/
|
|
356
|
+
getLODLevelAtDistance(e) {
|
|
357
|
+
const n = this._internalMeshDataInfo;
|
|
358
|
+
for (let i = 0; i < n._LODLevels.length; i++) {
|
|
359
|
+
const t = n._LODLevels[i];
|
|
360
|
+
if (t.distanceOrScreenCoverage === e)
|
|
361
|
+
return t.mesh;
|
|
362
|
+
}
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Remove a mesh from the LOD array
|
|
367
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
368
|
+
* @param mesh defines the mesh to be removed
|
|
369
|
+
* @returns This mesh (for chaining)
|
|
370
|
+
*/
|
|
371
|
+
removeLODLevel(e) {
|
|
372
|
+
const n = this._internalMeshDataInfo;
|
|
373
|
+
for (let i = 0; i < n._LODLevels.length; i++)
|
|
374
|
+
n._LODLevels[i].mesh === e && (n._LODLevels.splice(i, 1), e && (e._masterMesh = null));
|
|
375
|
+
return this._sortLODLevels(), this;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
|
|
379
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
380
|
+
* @param camera defines the camera to use to compute distance
|
|
381
|
+
* @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
|
|
382
|
+
* @returns This mesh (for chaining)
|
|
383
|
+
*/
|
|
384
|
+
getLOD(e, n) {
|
|
385
|
+
const i = this._internalMeshDataInfo;
|
|
386
|
+
if (!i._LODLevels || i._LODLevels.length === 0)
|
|
387
|
+
return this;
|
|
388
|
+
const t = n || this.getBoundingInfo().boundingSphere, r = e.mode === ee.ORTHOGRAPHIC_CAMERA ? e.minZ : t.centerWorld.subtract(e.globalPosition).length();
|
|
389
|
+
let s = r, a = 1;
|
|
390
|
+
if (i._useLODScreenCoverage) {
|
|
391
|
+
const o = e.screenArea;
|
|
392
|
+
let l = t.radiusWorld * e.minZ / r;
|
|
393
|
+
l = l * l * Math.PI, s = l / o, a = -1;
|
|
394
|
+
}
|
|
395
|
+
if (a * i._LODLevels[i._LODLevels.length - 1].distanceOrScreenCoverage > a * s)
|
|
396
|
+
return this.onLODLevelSelection && this.onLODLevelSelection(s, this, this), this;
|
|
397
|
+
for (let o = 0; o < i._LODLevels.length; o++) {
|
|
398
|
+
const l = i._LODLevels[o];
|
|
399
|
+
if (a * l.distanceOrScreenCoverage < a * s) {
|
|
400
|
+
if (l.mesh) {
|
|
401
|
+
if (l.mesh.delayLoadState === 4)
|
|
402
|
+
return l.mesh._checkDelayState(), this;
|
|
403
|
+
if (l.mesh.delayLoadState === 2)
|
|
404
|
+
return this;
|
|
405
|
+
l.mesh._preActivate(), l.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);
|
|
406
|
+
}
|
|
407
|
+
return this.onLODLevelSelection && this.onLODLevelSelection(s, this, l.mesh), l.mesh;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return this.onLODLevelSelection && this.onLODLevelSelection(s, this, this), this;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Gets the mesh internal Geometry object
|
|
414
|
+
*/
|
|
415
|
+
get geometry() {
|
|
416
|
+
return this._geometry;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
|
|
420
|
+
* @returns the total number of vertices
|
|
421
|
+
*/
|
|
422
|
+
getTotalVertices() {
|
|
423
|
+
return this._geometry === null || this._geometry === void 0 ? 0 : this._geometry.getTotalVertices();
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Returns the content of an associated vertex buffer
|
|
427
|
+
* @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
|
|
428
|
+
* - VertexBuffer.PositionKind
|
|
429
|
+
* - VertexBuffer.UVKind
|
|
430
|
+
* - VertexBuffer.UV2Kind
|
|
431
|
+
* - VertexBuffer.UV3Kind
|
|
432
|
+
* - VertexBuffer.UV4Kind
|
|
433
|
+
* - VertexBuffer.UV5Kind
|
|
434
|
+
* - VertexBuffer.UV6Kind
|
|
435
|
+
* - VertexBuffer.ColorKind
|
|
436
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
437
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
438
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
439
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
440
|
+
* @param copyWhenShared defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
|
|
441
|
+
* @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
|
|
442
|
+
* @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
|
|
443
|
+
* @returns a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
|
|
444
|
+
*/
|
|
445
|
+
getVerticesData(e, n, i, t) {
|
|
446
|
+
var r, s;
|
|
447
|
+
if (!this._geometry)
|
|
448
|
+
return null;
|
|
449
|
+
let a = t || (s = (r = this._userInstancedBuffersStorage) === null || r === void 0 ? void 0 : r.vertexBuffers[e]) === null || s === void 0 ? void 0 : s.getFloatData(
|
|
450
|
+
this.instances.length + 1,
|
|
451
|
+
// +1 because the master mesh is not included in the instances array
|
|
452
|
+
i || n && this._geometry.meshes.length !== 1
|
|
453
|
+
);
|
|
454
|
+
return a || (a = this._geometry.getVerticesData(e, n, i)), a;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Returns the mesh VertexBuffer object from the requested `kind`
|
|
458
|
+
* @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
|
|
459
|
+
* - VertexBuffer.PositionKind
|
|
460
|
+
* - VertexBuffer.NormalKind
|
|
461
|
+
* - VertexBuffer.UVKind
|
|
462
|
+
* - VertexBuffer.UV2Kind
|
|
463
|
+
* - VertexBuffer.UV3Kind
|
|
464
|
+
* - VertexBuffer.UV4Kind
|
|
465
|
+
* - VertexBuffer.UV5Kind
|
|
466
|
+
* - VertexBuffer.UV6Kind
|
|
467
|
+
* - VertexBuffer.ColorKind
|
|
468
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
469
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
470
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
471
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
472
|
+
* @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
|
|
473
|
+
* @returns a FloatArray or null if the mesh has no vertex buffer for this kind.
|
|
474
|
+
*/
|
|
475
|
+
getVertexBuffer(e, n) {
|
|
476
|
+
var i, t;
|
|
477
|
+
return this._geometry ? (t = n || (i = this._userInstancedBuffersStorage) === null || i === void 0 ? void 0 : i.vertexBuffers[e]) !== null && t !== void 0 ? t : this._geometry.getVertexBuffer(e) : null;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Tests if a specific vertex buffer is associated with this mesh
|
|
481
|
+
* @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
|
|
482
|
+
* - VertexBuffer.PositionKind
|
|
483
|
+
* - VertexBuffer.NormalKind
|
|
484
|
+
* - VertexBuffer.UVKind
|
|
485
|
+
* - VertexBuffer.UV2Kind
|
|
486
|
+
* - VertexBuffer.UV3Kind
|
|
487
|
+
* - VertexBuffer.UV4Kind
|
|
488
|
+
* - VertexBuffer.UV5Kind
|
|
489
|
+
* - VertexBuffer.UV6Kind
|
|
490
|
+
* - VertexBuffer.ColorKind
|
|
491
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
492
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
493
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
494
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
495
|
+
* @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
|
|
496
|
+
* @returns a boolean
|
|
497
|
+
*/
|
|
498
|
+
isVerticesDataPresent(e, n) {
|
|
499
|
+
var i;
|
|
500
|
+
return this._geometry ? !n && ((i = this._userInstancedBuffersStorage) === null || i === void 0 ? void 0 : i.vertexBuffers[e]) !== void 0 || this._geometry.isVerticesDataPresent(e) : this._delayInfo ? this._delayInfo.indexOf(e) !== -1 : !1;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Returns a boolean defining if the vertex data for the requested `kind` is updatable.
|
|
504
|
+
* @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
|
|
505
|
+
* - VertexBuffer.PositionKind
|
|
506
|
+
* - VertexBuffer.UVKind
|
|
507
|
+
* - VertexBuffer.UV2Kind
|
|
508
|
+
* - VertexBuffer.UV3Kind
|
|
509
|
+
* - VertexBuffer.UV4Kind
|
|
510
|
+
* - VertexBuffer.UV5Kind
|
|
511
|
+
* - VertexBuffer.UV6Kind
|
|
512
|
+
* - VertexBuffer.ColorKind
|
|
513
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
514
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
515
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
516
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
517
|
+
* @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
|
|
518
|
+
* @returns a boolean
|
|
519
|
+
*/
|
|
520
|
+
isVertexBufferUpdatable(e, n) {
|
|
521
|
+
var i;
|
|
522
|
+
if (!this._geometry)
|
|
523
|
+
return this._delayInfo ? this._delayInfo.indexOf(e) !== -1 : !1;
|
|
524
|
+
if (!n) {
|
|
525
|
+
const t = (i = this._userInstancedBuffersStorage) === null || i === void 0 ? void 0 : i.vertexBuffers[e];
|
|
526
|
+
if (t)
|
|
527
|
+
return t.isUpdatable();
|
|
528
|
+
}
|
|
529
|
+
return this._geometry.isVertexBufferUpdatable(e);
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
|
|
533
|
+
* @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
|
|
534
|
+
* @returns an array of strings
|
|
535
|
+
*/
|
|
536
|
+
getVerticesDataKinds(e) {
|
|
537
|
+
if (!this._geometry) {
|
|
538
|
+
const i = new Array();
|
|
539
|
+
return this._delayInfo && this._delayInfo.forEach(function(t) {
|
|
540
|
+
i.push(t);
|
|
541
|
+
}), i;
|
|
542
|
+
}
|
|
543
|
+
const n = this._geometry.getVerticesDataKinds();
|
|
544
|
+
if (!e && this._userInstancedBuffersStorage)
|
|
545
|
+
for (const i in this._userInstancedBuffersStorage.vertexBuffers)
|
|
546
|
+
n.indexOf(i) === -1 && n.push(i);
|
|
547
|
+
return n;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Returns a positive integer : the total number of indices in this mesh geometry.
|
|
551
|
+
* @returns the numner of indices or zero if the mesh has no geometry.
|
|
552
|
+
*/
|
|
553
|
+
getTotalIndices() {
|
|
554
|
+
return this._geometry ? this._geometry.getTotalIndices() : 0;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
|
|
558
|
+
* @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
|
|
559
|
+
* @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
|
|
560
|
+
* @returns the indices array or an empty array if the mesh has no geometry
|
|
561
|
+
*/
|
|
562
|
+
getIndices(e, n) {
|
|
563
|
+
return this._geometry ? this._geometry.getIndices(e, n) : [];
|
|
564
|
+
}
|
|
565
|
+
get isBlocked() {
|
|
566
|
+
return this._masterMesh !== null && this._masterMesh !== void 0;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Determine if the current mesh is ready to be rendered
|
|
570
|
+
* @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
|
|
571
|
+
* @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
|
|
572
|
+
* @returns true if all associated assets are ready (material, textures, shaders)
|
|
573
|
+
*/
|
|
574
|
+
isReady(e = !1, n = !1) {
|
|
575
|
+
var i, t, r, s, a, o, l;
|
|
576
|
+
if (this.delayLoadState === 2 || !super.isReady(e))
|
|
577
|
+
return !1;
|
|
578
|
+
if (!this.subMeshes || this.subMeshes.length === 0 || !e)
|
|
579
|
+
return !0;
|
|
580
|
+
const c = this.getEngine(), u = this.getScene(), _ = n || c.getCaps().instancedArrays && (this.instances.length > 0 || this.hasThinInstances);
|
|
581
|
+
this.computeWorldMatrix();
|
|
582
|
+
const p = this.material || u.defaultMaterial;
|
|
583
|
+
if (p) {
|
|
584
|
+
if (p._storeEffectOnSubMeshes)
|
|
585
|
+
for (const I of this.subMeshes) {
|
|
586
|
+
const f = I.getMaterial();
|
|
587
|
+
if (f) {
|
|
588
|
+
if (f._storeEffectOnSubMeshes) {
|
|
589
|
+
if (!f.isReadyForSubMesh(this, I, _))
|
|
590
|
+
return !1;
|
|
591
|
+
} else if (!f.isReady(this, _))
|
|
592
|
+
return !1;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
else if (!p.isReady(this, _))
|
|
596
|
+
return !1;
|
|
597
|
+
}
|
|
598
|
+
const x = c.currentRenderPassId;
|
|
599
|
+
for (const I of this.lightSources) {
|
|
600
|
+
const f = I.getShadowGenerators();
|
|
601
|
+
if (!f)
|
|
602
|
+
continue;
|
|
603
|
+
const y = f.values();
|
|
604
|
+
for (let v = y.next(); v.done !== !0; v = y.next()) {
|
|
605
|
+
const M = v.value;
|
|
606
|
+
if (M && (!(!((i = M.getShadowMap()) === null || i === void 0) && i.renderList) || !((t = M.getShadowMap()) === null || t === void 0) && t.renderList && ((s = (r = M.getShadowMap()) === null || r === void 0 ? void 0 : r.renderList) === null || s === void 0 ? void 0 : s.indexOf(this)) !== -1)) {
|
|
607
|
+
const m = (a = M.getShadowMap().renderPassIds) !== null && a !== void 0 ? a : [c.currentRenderPassId];
|
|
608
|
+
for (let h = 0; h < m.length; ++h) {
|
|
609
|
+
c.currentRenderPassId = m[h];
|
|
610
|
+
for (const g of this.subMeshes)
|
|
611
|
+
if (!M.isReady(g, _, (l = (o = g.getMaterial()) === null || o === void 0 ? void 0 : o.needAlphaBlendingForMesh(this)) !== null && l !== void 0 ? l : !1))
|
|
612
|
+
return c.currentRenderPassId = x, !1;
|
|
613
|
+
}
|
|
614
|
+
c.currentRenderPassId = x;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
for (const I of this._internalMeshDataInfo._LODLevels)
|
|
619
|
+
if (I.mesh && !I.mesh.isReady(_))
|
|
620
|
+
return !1;
|
|
621
|
+
return !0;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Gets a boolean indicating if the normals aren't to be recomputed on next mesh `positions` array update. This property is pertinent only for updatable parametric shapes.
|
|
625
|
+
*/
|
|
626
|
+
get areNormalsFrozen() {
|
|
627
|
+
return this._internalMeshDataInfo._areNormalsFrozen;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next `positions` array update.
|
|
631
|
+
* @returns the current mesh
|
|
632
|
+
*/
|
|
633
|
+
freezeNormals() {
|
|
634
|
+
return this._internalMeshDataInfo._areNormalsFrozen = !0, this;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen
|
|
638
|
+
* @returns the current mesh
|
|
639
|
+
*/
|
|
640
|
+
unfreezeNormals() {
|
|
641
|
+
return this._internalMeshDataInfo._areNormalsFrozen = !1, this;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
|
|
645
|
+
*/
|
|
646
|
+
set overridenInstanceCount(e) {
|
|
647
|
+
this._instanceDataStorage.overridenInstanceCount = e;
|
|
648
|
+
}
|
|
649
|
+
// Methods
|
|
650
|
+
/** @internal */
|
|
651
|
+
_preActivate() {
|
|
652
|
+
const e = this._internalMeshDataInfo, n = this.getScene().getRenderId();
|
|
653
|
+
return e._preActivateId === n ? this : (e._preActivateId = n, this._instanceDataStorage.visibleInstances = null, this);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* @internal
|
|
657
|
+
*/
|
|
658
|
+
_preActivateForIntermediateRendering(e) {
|
|
659
|
+
return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = e), this;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* @internal
|
|
663
|
+
*/
|
|
664
|
+
_registerInstanceForRenderId(e, n) {
|
|
665
|
+
return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = {
|
|
666
|
+
defaultRenderId: n,
|
|
667
|
+
selfDefaultRenderId: this._renderId
|
|
668
|
+
}), this._instanceDataStorage.visibleInstances[n] || (this._instanceDataStorage.previousRenderId !== void 0 && this._instanceDataStorage.isFrozen && (this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null), this._instanceDataStorage.previousRenderId = n, this._instanceDataStorage.visibleInstances[n] = new Array()), this._instanceDataStorage.visibleInstances[n].push(e), this;
|
|
669
|
+
}
|
|
670
|
+
_afterComputeWorldMatrix() {
|
|
671
|
+
super._afterComputeWorldMatrix(), this.hasThinInstances && (this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1));
|
|
672
|
+
}
|
|
673
|
+
/** @internal */
|
|
674
|
+
_postActivate() {
|
|
675
|
+
this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup && (this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer), this.edgesRenderer.customInstances.push(this.getWorldMatrix()));
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
|
|
679
|
+
* This means the mesh underlying bounding box and sphere are recomputed.
|
|
680
|
+
* @param applySkeleton defines whether to apply the skeleton before computing the bounding info
|
|
681
|
+
* @param applyMorph defines whether to apply the morph target before computing the bounding info
|
|
682
|
+
* @returns the current mesh
|
|
683
|
+
*/
|
|
684
|
+
refreshBoundingInfo(e = !1, n = !1) {
|
|
685
|
+
if (this.hasBoundingInfo && this.getBoundingInfo().isLocked)
|
|
686
|
+
return this;
|
|
687
|
+
const i = this.geometry ? this.geometry.boundingBias : null;
|
|
688
|
+
return this._refreshBoundingInfo(this._getPositionData(e, n), i), this;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* @internal
|
|
692
|
+
*/
|
|
693
|
+
_createGlobalSubMesh(e) {
|
|
694
|
+
const n = this.getTotalVertices();
|
|
695
|
+
if (!n || !this.getIndices())
|
|
696
|
+
return null;
|
|
697
|
+
if (this.subMeshes && this.subMeshes.length > 0) {
|
|
698
|
+
const i = this.getIndices();
|
|
699
|
+
if (!i)
|
|
700
|
+
return null;
|
|
701
|
+
const t = i.length;
|
|
702
|
+
let r = !1;
|
|
703
|
+
if (e)
|
|
704
|
+
r = !0;
|
|
705
|
+
else
|
|
706
|
+
for (const s of this.subMeshes) {
|
|
707
|
+
if (s.indexStart + s.indexCount > t) {
|
|
708
|
+
r = !0;
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
if (s.verticesStart + s.verticesCount > n) {
|
|
712
|
+
r = !0;
|
|
713
|
+
break;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
if (!r)
|
|
717
|
+
return this.subMeshes[0];
|
|
718
|
+
}
|
|
719
|
+
return this.releaseSubMeshes(), new k(0, 0, n, 0, this.getTotalIndices(), this);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* This function will subdivide the mesh into multiple submeshes
|
|
723
|
+
* @param count defines the expected number of submeshes
|
|
724
|
+
*/
|
|
725
|
+
subdivide(e) {
|
|
726
|
+
if (e < 1)
|
|
727
|
+
return;
|
|
728
|
+
const n = this.getTotalIndices();
|
|
729
|
+
let i = n / e | 0, t = 0;
|
|
730
|
+
for (; i % 3 !== 0; )
|
|
731
|
+
i++;
|
|
732
|
+
this.releaseSubMeshes();
|
|
733
|
+
for (let r = 0; r < e && !(t >= n); r++)
|
|
734
|
+
k.CreateFromIndices(0, t, r === e - 1 ? n - t : i, this, void 0, !1), t += i;
|
|
735
|
+
this.refreshBoundingInfo(), this.synchronizeInstances();
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Copy a FloatArray into a specific associated vertex buffer
|
|
739
|
+
* @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
|
|
740
|
+
* - VertexBuffer.PositionKind
|
|
741
|
+
* - VertexBuffer.UVKind
|
|
742
|
+
* - VertexBuffer.UV2Kind
|
|
743
|
+
* - VertexBuffer.UV3Kind
|
|
744
|
+
* - VertexBuffer.UV4Kind
|
|
745
|
+
* - VertexBuffer.UV5Kind
|
|
746
|
+
* - VertexBuffer.UV6Kind
|
|
747
|
+
* - VertexBuffer.ColorKind
|
|
748
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
749
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
750
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
751
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
752
|
+
* @param data defines the data source
|
|
753
|
+
* @param updatable defines if the updated vertex buffer must be flagged as updatable
|
|
754
|
+
* @param stride defines the data stride size (can be null)
|
|
755
|
+
* @returns the current mesh
|
|
756
|
+
*/
|
|
757
|
+
setVerticesData(e, n, i = !1, t) {
|
|
758
|
+
if (this._geometry)
|
|
759
|
+
this._geometry.setVerticesData(e, n, i, t);
|
|
760
|
+
else {
|
|
761
|
+
const r = new P();
|
|
762
|
+
r.set(n, e);
|
|
763
|
+
const s = this.getScene();
|
|
764
|
+
new V(V.RandomId(), s, r, i, this);
|
|
765
|
+
}
|
|
766
|
+
return this;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Delete a vertex buffer associated with this mesh
|
|
770
|
+
* @param kind defines which buffer to delete (positions, indices, normals, etc). Possible `kind` values :
|
|
771
|
+
* - VertexBuffer.PositionKind
|
|
772
|
+
* - VertexBuffer.UVKind
|
|
773
|
+
* - VertexBuffer.UV2Kind
|
|
774
|
+
* - VertexBuffer.UV3Kind
|
|
775
|
+
* - VertexBuffer.UV4Kind
|
|
776
|
+
* - VertexBuffer.UV5Kind
|
|
777
|
+
* - VertexBuffer.UV6Kind
|
|
778
|
+
* - VertexBuffer.ColorKind
|
|
779
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
780
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
781
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
782
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
783
|
+
*/
|
|
784
|
+
removeVerticesData(e) {
|
|
785
|
+
this._geometry && this._geometry.removeVerticesData(e);
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Flags an associated vertex buffer as updatable
|
|
789
|
+
* @param kind defines which buffer to use (positions, indices, normals, etc). Possible `kind` values :
|
|
790
|
+
* - VertexBuffer.PositionKind
|
|
791
|
+
* - VertexBuffer.UVKind
|
|
792
|
+
* - VertexBuffer.UV2Kind
|
|
793
|
+
* - VertexBuffer.UV3Kind
|
|
794
|
+
* - VertexBuffer.UV4Kind
|
|
795
|
+
* - VertexBuffer.UV5Kind
|
|
796
|
+
* - VertexBuffer.UV6Kind
|
|
797
|
+
* - VertexBuffer.ColorKind
|
|
798
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
799
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
800
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
801
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
802
|
+
* @param updatable defines if the updated vertex buffer must be flagged as updatable
|
|
803
|
+
*/
|
|
804
|
+
markVerticesDataAsUpdatable(e, n = !0) {
|
|
805
|
+
const i = this.getVertexBuffer(e);
|
|
806
|
+
!i || i.isUpdatable() === n || this.setVerticesData(e, this.getVerticesData(e), n);
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Sets the mesh global Vertex Buffer
|
|
810
|
+
* @param buffer defines the buffer to use
|
|
811
|
+
* @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
|
|
812
|
+
* @returns the current mesh
|
|
813
|
+
*/
|
|
814
|
+
setVerticesBuffer(e, n = !0) {
|
|
815
|
+
return this._geometry || (this._geometry = V.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(e, null, n), this;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Update a specific associated vertex buffer
|
|
819
|
+
* @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
|
|
820
|
+
* - VertexBuffer.PositionKind
|
|
821
|
+
* - VertexBuffer.UVKind
|
|
822
|
+
* - VertexBuffer.UV2Kind
|
|
823
|
+
* - VertexBuffer.UV3Kind
|
|
824
|
+
* - VertexBuffer.UV4Kind
|
|
825
|
+
* - VertexBuffer.UV5Kind
|
|
826
|
+
* - VertexBuffer.UV6Kind
|
|
827
|
+
* - VertexBuffer.ColorKind
|
|
828
|
+
* - VertexBuffer.MatricesIndicesKind
|
|
829
|
+
* - VertexBuffer.MatricesIndicesExtraKind
|
|
830
|
+
* - VertexBuffer.MatricesWeightsKind
|
|
831
|
+
* - VertexBuffer.MatricesWeightsExtraKind
|
|
832
|
+
* @param data defines the data source
|
|
833
|
+
* @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
|
|
834
|
+
* @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
|
|
835
|
+
* @returns the current mesh
|
|
836
|
+
*/
|
|
837
|
+
updateVerticesData(e, n, i, t) {
|
|
838
|
+
return this._geometry ? (t ? (this.makeGeometryUnique(), this.updateVerticesData(e, n, i, !1)) : this._geometry.updateVerticesData(e, n, i), this) : this;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values.
|
|
842
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#other-shapes-updatemeshpositions
|
|
843
|
+
* @param positionFunction is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything
|
|
844
|
+
* @param computeNormals is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
|
|
845
|
+
* @returns the current mesh
|
|
846
|
+
*/
|
|
847
|
+
updateMeshPositions(e, n = !0) {
|
|
848
|
+
const i = this.getVerticesData(d.PositionKind);
|
|
849
|
+
if (!i)
|
|
850
|
+
return this;
|
|
851
|
+
if (e(i), this.updateVerticesData(d.PositionKind, i, !1, !1), n) {
|
|
852
|
+
const t = this.getIndices(), r = this.getVerticesData(d.NormalKind);
|
|
853
|
+
if (!r)
|
|
854
|
+
return this;
|
|
855
|
+
P.ComputeNormals(i, t, r), this.updateVerticesData(d.NormalKind, r, !1, !1);
|
|
856
|
+
}
|
|
857
|
+
return this;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Creates a un-shared specific occurence of the geometry for the mesh.
|
|
861
|
+
* @returns the current mesh
|
|
862
|
+
*/
|
|
863
|
+
makeGeometryUnique() {
|
|
864
|
+
if (!this._geometry)
|
|
865
|
+
return this;
|
|
866
|
+
if (this._geometry.meshes.length === 1)
|
|
867
|
+
return this;
|
|
868
|
+
const e = this._geometry, n = this._geometry.copy(V.RandomId());
|
|
869
|
+
return e.releaseForMesh(this, !0), n.applyToMesh(this), this;
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Set the index buffer of this mesh
|
|
873
|
+
* @param indices defines the source data
|
|
874
|
+
* @param totalVertices defines the total number of vertices referenced by this index data (can be null)
|
|
875
|
+
* @param updatable defines if the updated index buffer must be flagged as updatable (default is false)
|
|
876
|
+
* @returns the current mesh
|
|
877
|
+
*/
|
|
878
|
+
setIndices(e, n = null, i = !1) {
|
|
879
|
+
if (this._geometry)
|
|
880
|
+
this._geometry.setIndices(e, n, i);
|
|
881
|
+
else {
|
|
882
|
+
const t = new P();
|
|
883
|
+
t.indices = e;
|
|
884
|
+
const r = this.getScene();
|
|
885
|
+
new V(V.RandomId(), r, t, i, this);
|
|
886
|
+
}
|
|
887
|
+
return this;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Update the current index buffer
|
|
891
|
+
* @param indices defines the source data
|
|
892
|
+
* @param offset defines the offset in the index buffer where to store the new data (can be null)
|
|
893
|
+
* @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
|
|
894
|
+
* @returns the current mesh
|
|
895
|
+
*/
|
|
896
|
+
updateIndices(e, n, i = !1) {
|
|
897
|
+
return this._geometry ? (this._geometry.updateIndices(e, n, i), this) : this;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Invert the geometry to move from a right handed system to a left handed one.
|
|
901
|
+
* @returns the current mesh
|
|
902
|
+
*/
|
|
903
|
+
toLeftHanded() {
|
|
904
|
+
return this._geometry ? (this._geometry.toLeftHanded(), this) : this;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* @internal
|
|
908
|
+
*/
|
|
909
|
+
_bind(e, n, i, t = !0) {
|
|
910
|
+
if (!this._geometry)
|
|
911
|
+
return this;
|
|
912
|
+
const r = this.getScene().getEngine();
|
|
913
|
+
this.morphTargetManager && this.morphTargetManager.isUsingTextureForTargets && this.morphTargetManager._bind(n);
|
|
914
|
+
let s;
|
|
915
|
+
if (this._unIndexed)
|
|
916
|
+
s = null;
|
|
917
|
+
else
|
|
918
|
+
switch (this._getRenderingFillMode(i)) {
|
|
919
|
+
case T.PointFillMode:
|
|
920
|
+
s = null;
|
|
921
|
+
break;
|
|
922
|
+
case T.WireFrameFillMode:
|
|
923
|
+
s = e._getLinesIndexBuffer(this.getIndices(), r);
|
|
924
|
+
break;
|
|
925
|
+
default:
|
|
926
|
+
case T.TriangleFillMode:
|
|
927
|
+
s = this._geometry.getIndexBuffer();
|
|
928
|
+
break;
|
|
929
|
+
}
|
|
930
|
+
return !t || !this._userInstancedBuffersStorage || this.hasThinInstances ? this._geometry._bind(n, s) : this._geometry._bind(n, s, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects), this;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* @internal
|
|
934
|
+
*/
|
|
935
|
+
_draw(e, n, i) {
|
|
936
|
+
if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())
|
|
937
|
+
return this;
|
|
938
|
+
this._internalMeshDataInfo._onBeforeDrawObservable && this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);
|
|
939
|
+
const r = this.getScene().getEngine();
|
|
940
|
+
return this._unIndexed || n == T.PointFillMode ? r.drawArraysType(n, e.verticesStart, e.verticesCount, this.forcedInstanceCount || i) : n == T.WireFrameFillMode ? r.drawElementsType(n, 0, e._linesIndexCount, this.forcedInstanceCount || i) : r.drawElementsType(n, e.indexStart, e.indexCount, this.forcedInstanceCount || i), this;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Registers for this mesh a javascript function called just before the rendering process
|
|
944
|
+
* @param func defines the function to call before rendering this mesh
|
|
945
|
+
* @returns the current mesh
|
|
946
|
+
*/
|
|
947
|
+
registerBeforeRender(e) {
|
|
948
|
+
return this.onBeforeRenderObservable.add(e), this;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Disposes a previously registered javascript function called before the rendering
|
|
952
|
+
* @param func defines the function to remove
|
|
953
|
+
* @returns the current mesh
|
|
954
|
+
*/
|
|
955
|
+
unregisterBeforeRender(e) {
|
|
956
|
+
return this.onBeforeRenderObservable.removeCallback(e), this;
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Registers for this mesh a javascript function called just after the rendering is complete
|
|
960
|
+
* @param func defines the function to call after rendering this mesh
|
|
961
|
+
* @returns the current mesh
|
|
962
|
+
*/
|
|
963
|
+
registerAfterRender(e) {
|
|
964
|
+
return this.onAfterRenderObservable.add(e), this;
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Disposes a previously registered javascript function called after the rendering.
|
|
968
|
+
* @param func defines the function to remove
|
|
969
|
+
* @returns the current mesh
|
|
970
|
+
*/
|
|
971
|
+
unregisterAfterRender(e) {
|
|
972
|
+
return this.onAfterRenderObservable.removeCallback(e), this;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* @internal
|
|
976
|
+
*/
|
|
977
|
+
_getInstancesRenderList(e, n = !1) {
|
|
978
|
+
if (this._instanceDataStorage.isFrozen) {
|
|
979
|
+
if (n)
|
|
980
|
+
return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e] = !1, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[e] = !0, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;
|
|
981
|
+
if (this._instanceDataStorage.previousBatch)
|
|
982
|
+
return this._instanceDataStorage.previousBatch;
|
|
983
|
+
}
|
|
984
|
+
const i = this.getScene(), t = i._isInIntermediateRendering(), r = t ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances, s = this._instanceDataStorage.batchCache;
|
|
985
|
+
if (s.mustReturn = !1, s.renderSelf[e] = n || !r && this.isEnabled() && this.isVisible, s.visibleInstances[e] = null, this._instanceDataStorage.visibleInstances && !n) {
|
|
986
|
+
const a = this._instanceDataStorage.visibleInstances, o = i.getRenderId(), l = t ? a.intermediateDefaultRenderId : a.defaultRenderId;
|
|
987
|
+
s.visibleInstances[e] = a[o], !s.visibleInstances[e] && l && (s.visibleInstances[e] = a[l]);
|
|
988
|
+
}
|
|
989
|
+
return s.hardwareInstancedRendering[e] = !n && this._instanceDataStorage.hardwareInstancedRendering && s.visibleInstances[e] !== null && s.visibleInstances[e] !== void 0, this._instanceDataStorage.previousBatch = s, s;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* @internal
|
|
993
|
+
*/
|
|
994
|
+
_renderWithInstances(e, n, i, t, r) {
|
|
995
|
+
var s;
|
|
996
|
+
const a = i.visibleInstances[e._id], o = a ? a.length : 0, l = this._instanceDataStorage, c = l.instancesBufferSize;
|
|
997
|
+
let u = l.instancesBuffer, _ = l.instancesPreviousBuffer;
|
|
998
|
+
const x = (o + 1) * 16 * 4;
|
|
999
|
+
for (; l.instancesBufferSize < x; )
|
|
1000
|
+
l.instancesBufferSize *= 2;
|
|
1001
|
+
(!l.instancesData || c != l.instancesBufferSize) && (l.instancesData = new Float32Array(l.instancesBufferSize / 4)), (this._scene.needsPreviousWorldMatrices && !l.instancesPreviousData || c != l.instancesBufferSize) && (l.instancesPreviousData = new Float32Array(l.instancesBufferSize / 4));
|
|
1002
|
+
let I = 0, f = 0;
|
|
1003
|
+
const y = i.renderSelf[e._id], v = !u || c !== l.instancesBufferSize || this._scene.needsPreviousWorldMatrices && !l.instancesPreviousBuffer;
|
|
1004
|
+
if (!this._instanceDataStorage.manualUpdate && (!l.isFrozen || v)) {
|
|
1005
|
+
const M = this.getWorldMatrix();
|
|
1006
|
+
if (y && (this._scene.needsPreviousWorldMatrices && (l.masterMeshPreviousWorldMatrix ? (l.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData, I), l.masterMeshPreviousWorldMatrix.copyFrom(M)) : (l.masterMeshPreviousWorldMatrix = M.clone(), l.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData, I))), M.copyToArray(l.instancesData, I), I += 16, f++), a) {
|
|
1007
|
+
if (D.INSTANCEDMESH_SORT_TRANSPARENT && this._scene.activeCamera && (!((s = e.getMaterial()) === null || s === void 0) && s.needAlphaBlendingForMesh(e.getRenderingMesh()))) {
|
|
1008
|
+
const S = this._scene.activeCamera.globalPosition;
|
|
1009
|
+
for (let m = 0; m < a.length; m++) {
|
|
1010
|
+
const h = a[m];
|
|
1011
|
+
h._distanceToCamera = w.Distance(h.getBoundingInfo().boundingSphere.centerWorld, S);
|
|
1012
|
+
}
|
|
1013
|
+
a.sort((m, h) => m._distanceToCamera > h._distanceToCamera ? -1 : m._distanceToCamera < h._distanceToCamera ? 1 : 0);
|
|
1014
|
+
}
|
|
1015
|
+
for (let S = 0; S < a.length; S++) {
|
|
1016
|
+
const m = a[S], h = m.getWorldMatrix();
|
|
1017
|
+
h.copyToArray(l.instancesData, I), this._scene.needsPreviousWorldMatrices && (m._previousWorldMatrix ? (m._previousWorldMatrix.copyToArray(l.instancesPreviousData, I), m._previousWorldMatrix.copyFrom(h)) : (m._previousWorldMatrix = h.clone(), m._previousWorldMatrix.copyToArray(l.instancesPreviousData, I))), I += 16, f++;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
} else
|
|
1021
|
+
f = (y ? 1 : 0) + o;
|
|
1022
|
+
return v ? (u && u.dispose(), _ && _.dispose(), u = new z(r, l.instancesData, !0, 16, !1, !0), l.instancesBuffer = u, this._userInstancedBuffersStorage || (this._userInstancedBuffersStorage = {
|
|
1023
|
+
data: {},
|
|
1024
|
+
vertexBuffers: {},
|
|
1025
|
+
strides: {},
|
|
1026
|
+
sizes: {},
|
|
1027
|
+
vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : void 0
|
|
1028
|
+
}), this._userInstancedBuffersStorage.vertexBuffers.world0 = u.createVertexBuffer("world0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.world1 = u.createVertexBuffer("world1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.world2 = u.createVertexBuffer("world2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.world3 = u.createVertexBuffer("world3", 12, 4), this._scene.needsPreviousWorldMatrices && (_ = new z(r, l.instancesPreviousData, !0, 16, !1, !0), l.instancesPreviousBuffer = _, this._userInstancedBuffersStorage.vertexBuffers.previousWorld0 = _.createVertexBuffer("previousWorld0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld1 = _.createVertexBuffer("previousWorld1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld2 = _.createVertexBuffer("previousWorld2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld3 = _.createVertexBuffer("previousWorld3", 12, 4)), this._invalidateInstanceVertexArrayObject()) : (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && (u.updateDirectly(l.instancesData, 0, f), this._scene.needsPreviousWorldMatrices && (!this._instanceDataStorage.manualUpdate || this._instanceDataStorage.previousManualUpdate) && _.updateDirectly(l.instancesPreviousData, 0, f)), this._processInstancedBuffers(a, y), this.getScene()._activeIndices.addCount(e.indexCount * f, !1), r._currentDrawContext && (r._currentDrawContext.useInstancing = !0), this._bind(e, t, n), this._draw(e, n, f), this._scene.needsPreviousWorldMatrices && !v && this._instanceDataStorage.manualUpdate && (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && !this._instanceDataStorage.previousManualUpdate && _.updateDirectly(l.instancesData, 0, f), r.unbindInstanceAttributes(), this;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* @internal
|
|
1032
|
+
*/
|
|
1033
|
+
_renderWithThinInstances(e, n, i, t) {
|
|
1034
|
+
var r, s;
|
|
1035
|
+
const a = (s = (r = this._thinInstanceDataStorage) === null || r === void 0 ? void 0 : r.instancesCount) !== null && s !== void 0 ? s : 0;
|
|
1036
|
+
this.getScene()._activeIndices.addCount(e.indexCount * a, !1), t._currentDrawContext && (t._currentDrawContext.useInstancing = !0), this._bind(e, i, n), this._draw(e, n, a), this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && this._thinInstanceDataStorage.matrixData && (this._thinInstanceDataStorage.previousMatrixBuffer ? this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, a) : this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", this._thinInstanceDataStorage.matrixData, !1)), t.unbindInstanceAttributes();
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* @internal
|
|
1040
|
+
*/
|
|
1041
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1042
|
+
_processInstancedBuffers(e, n) {
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* @internal
|
|
1046
|
+
*/
|
|
1047
|
+
_processRendering(e, n, i, t, r, s, a, o) {
|
|
1048
|
+
const l = this.getScene(), c = l.getEngine();
|
|
1049
|
+
if (t = this._getRenderingFillMode(t), s && n.getRenderingMesh().hasThinInstances)
|
|
1050
|
+
return this._renderWithThinInstances(n, t, i, c), this;
|
|
1051
|
+
if (s)
|
|
1052
|
+
this._renderWithInstances(n, t, r, i, c);
|
|
1053
|
+
else {
|
|
1054
|
+
c._currentDrawContext && (c._currentDrawContext.useInstancing = !1);
|
|
1055
|
+
let u = 0;
|
|
1056
|
+
r.renderSelf[n._id] && (a && a(!1, e.getWorldMatrix(), o), u++, this._draw(n, t, this._instanceDataStorage.overridenInstanceCount));
|
|
1057
|
+
const _ = r.visibleInstances[n._id];
|
|
1058
|
+
if (_) {
|
|
1059
|
+
const p = _.length;
|
|
1060
|
+
u += p;
|
|
1061
|
+
for (let x = 0; x < p; x++) {
|
|
1062
|
+
const f = _[x].getWorldMatrix();
|
|
1063
|
+
a && a(!0, f, o), this._draw(n, t);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
l._activeIndices.addCount(n.indexCount * u, !1);
|
|
1067
|
+
}
|
|
1068
|
+
return this;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* @internal
|
|
1072
|
+
*/
|
|
1073
|
+
_rebuild(e = !1) {
|
|
1074
|
+
if (this._instanceDataStorage.instancesBuffer && (e && this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null), this._userInstancedBuffersStorage) {
|
|
1075
|
+
for (const n in this._userInstancedBuffersStorage.vertexBuffers) {
|
|
1076
|
+
const i = this._userInstancedBuffersStorage.vertexBuffers[n];
|
|
1077
|
+
i && (e && i.dispose(), this._userInstancedBuffersStorage.vertexBuffers[n] = null);
|
|
1078
|
+
}
|
|
1079
|
+
this._userInstancedBuffersStorage.vertexArrayObjects && (this._userInstancedBuffersStorage.vertexArrayObjects = {});
|
|
1080
|
+
}
|
|
1081
|
+
this._internalMeshDataInfo._effectiveMaterial = null, super._rebuild(e);
|
|
1082
|
+
}
|
|
1083
|
+
/** @internal */
|
|
1084
|
+
_freeze() {
|
|
1085
|
+
if (this.subMeshes) {
|
|
1086
|
+
for (let e = 0; e < this.subMeshes.length; e++)
|
|
1087
|
+
this._getInstancesRenderList(e);
|
|
1088
|
+
this._internalMeshDataInfo._effectiveMaterial = null, this._instanceDataStorage.isFrozen = !0;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
/** @internal */
|
|
1092
|
+
_unFreeze() {
|
|
1093
|
+
this._instanceDataStorage.isFrozen = !1, this._instanceDataStorage.previousBatch = null;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager
|
|
1097
|
+
* @param subMesh defines the subMesh to render
|
|
1098
|
+
* @param enableAlphaMode defines if alpha mode can be changed
|
|
1099
|
+
* @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering
|
|
1100
|
+
* @returns the current mesh
|
|
1101
|
+
*/
|
|
1102
|
+
render(e, n, i) {
|
|
1103
|
+
var t, r, s;
|
|
1104
|
+
const a = this.getScene();
|
|
1105
|
+
if (this._internalAbstractMeshDataInfo._isActiveIntermediate ? this._internalAbstractMeshDataInfo._isActiveIntermediate = !1 : this._internalAbstractMeshDataInfo._isActive = !1, this._checkOcclusionQuery() && !this._occlusionDataStorage.forceRenderingWhenOccluded)
|
|
1106
|
+
return this;
|
|
1107
|
+
const o = this._getInstancesRenderList(e._id, !!i);
|
|
1108
|
+
if (o.mustReturn)
|
|
1109
|
+
return this;
|
|
1110
|
+
if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())
|
|
1111
|
+
return this;
|
|
1112
|
+
const l = a.getEngine();
|
|
1113
|
+
let c = 0, u = null;
|
|
1114
|
+
this.ignoreCameraMaxZ && a.activeCamera && !a._isInIntermediateRendering() && (c = a.activeCamera.maxZ, u = a.activeCamera, a.activeCamera.maxZ = 0, a.updateTransformMatrix(!0)), this._internalMeshDataInfo._onBeforeRenderObservable && this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
|
|
1115
|
+
const _ = e.getRenderingMesh(), p = o.hardwareInstancedRendering[e._id] || _.hasThinInstances || !!this._userInstancedBuffersStorage && !e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh, x = this._instanceDataStorage, I = e.getMaterial();
|
|
1116
|
+
if (!I)
|
|
1117
|
+
return u && (u.maxZ = c, a.updateTransformMatrix(!0)), this;
|
|
1118
|
+
if (!x.isFrozen || !this._internalMeshDataInfo._effectiveMaterial || this._internalMeshDataInfo._effectiveMaterial !== I) {
|
|
1119
|
+
if (I._storeEffectOnSubMeshes) {
|
|
1120
|
+
if (!I.isReadyForSubMesh(this, e, p))
|
|
1121
|
+
return u && (u.maxZ = c, a.updateTransformMatrix(!0)), this;
|
|
1122
|
+
} else if (!I.isReady(this, p))
|
|
1123
|
+
return u && (u.maxZ = c, a.updateTransformMatrix(!0)), this;
|
|
1124
|
+
this._internalMeshDataInfo._effectiveMaterial = I;
|
|
1125
|
+
} else if (I._storeEffectOnSubMeshes && !(!((t = e.effect) === null || t === void 0) && t._wasPreviouslyReady) || !I._storeEffectOnSubMeshes && !(!((r = I.getEffect()) === null || r === void 0) && r._wasPreviouslyReady))
|
|
1126
|
+
return u && (u.maxZ = c, a.updateTransformMatrix(!0)), this;
|
|
1127
|
+
n && l.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);
|
|
1128
|
+
let f;
|
|
1129
|
+
this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes ? f = e._drawWrapper : f = this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();
|
|
1130
|
+
const y = (s = f == null ? void 0 : f.effect) !== null && s !== void 0 ? s : null;
|
|
1131
|
+
for (const B of a._beforeRenderingMeshStage)
|
|
1132
|
+
B.action(this, e, o, y);
|
|
1133
|
+
if (!f || !y)
|
|
1134
|
+
return u && (u.maxZ = c, a.updateTransformMatrix(!0)), this;
|
|
1135
|
+
const v = i || this;
|
|
1136
|
+
let M;
|
|
1137
|
+
if (!x.isFrozen && (this._internalMeshDataInfo._effectiveMaterial.backFaceCulling || this.overrideMaterialSideOrientation !== null)) {
|
|
1138
|
+
const B = v._getWorldMatrixDeterminant();
|
|
1139
|
+
M = this.overrideMaterialSideOrientation, M == null && (M = this._internalMeshDataInfo._effectiveMaterial.sideOrientation), B < 0 && (M = M === T.ClockWiseSideOrientation ? T.CounterClockWiseSideOrientation : T.ClockWiseSideOrientation), x.sideOrientation = M;
|
|
1140
|
+
} else
|
|
1141
|
+
M = x.sideOrientation;
|
|
1142
|
+
const S = this._internalMeshDataInfo._effectiveMaterial._preBind(f, M);
|
|
1143
|
+
this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite && l.setDepthWrite(!0);
|
|
1144
|
+
const m = this._internalMeshDataInfo._effectiveMaterial, h = m.fillMode;
|
|
1145
|
+
this._internalMeshDataInfo._onBeforeBindObservable && this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this), p || this._bind(e, y, h, !1);
|
|
1146
|
+
const g = v.getWorldMatrix();
|
|
1147
|
+
m._storeEffectOnSubMeshes ? m.bindForSubMesh(g, this, e) : m.bind(g, this), !m.backFaceCulling && m.separateCullingPass && (l.setState(!0, m.zOffset, !1, !S, m.cullBackFaces, m.stencil, m.zOffsetUnits), this._processRendering(this, e, y, h, o, p, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), l.setState(!0, m.zOffset, !1, S, m.cullBackFaces, m.stencil, m.zOffsetUnits), this._internalMeshDataInfo._onBetweenPassObservable && this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)), this._processRendering(this, e, y, h, o, p, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), this._internalMeshDataInfo._effectiveMaterial.unbind();
|
|
1148
|
+
for (const B of a._afterRenderingMeshStage)
|
|
1149
|
+
B.action(this, e, o, y);
|
|
1150
|
+
return this._internalMeshDataInfo._onAfterRenderObservable && this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this), u && (u.maxZ = c, a.updateTransformMatrix(!0)), a.performancePriority === te.Aggressive && !x.isFrozen && this._freeze(), this;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Renormalize the mesh and patch it up if there are no weights
|
|
1154
|
+
* Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1.
|
|
1155
|
+
* However in the case of zero weights then we set just a single influence to 1.
|
|
1156
|
+
* We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version.
|
|
1157
|
+
*/
|
|
1158
|
+
cleanMatrixWeights() {
|
|
1159
|
+
this.isVerticesDataPresent(d.MatricesWeightsKind) && (this.isVerticesDataPresent(d.MatricesWeightsExtraKind) ? this._normalizeSkinWeightsAndExtra() : this._normalizeSkinFourWeights());
|
|
1160
|
+
}
|
|
1161
|
+
// faster 4 weight version.
|
|
1162
|
+
_normalizeSkinFourWeights() {
|
|
1163
|
+
const e = this.getVerticesData(d.MatricesWeightsKind), n = e.length;
|
|
1164
|
+
for (let i = 0; i < n; i += 4) {
|
|
1165
|
+
const t = e[i] + e[i + 1] + e[i + 2] + e[i + 3];
|
|
1166
|
+
if (t === 0)
|
|
1167
|
+
e[i] = 1;
|
|
1168
|
+
else {
|
|
1169
|
+
const r = 1 / t;
|
|
1170
|
+
e[i] *= r, e[i + 1] *= r, e[i + 2] *= r, e[i + 3] *= r;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
this.setVerticesData(d.MatricesWeightsKind, e);
|
|
1174
|
+
}
|
|
1175
|
+
// handle special case of extra verts. (in theory gltf can handle 12 influences)
|
|
1176
|
+
_normalizeSkinWeightsAndExtra() {
|
|
1177
|
+
const e = this.getVerticesData(d.MatricesWeightsExtraKind), n = this.getVerticesData(d.MatricesWeightsKind), i = n.length;
|
|
1178
|
+
for (let t = 0; t < i; t += 4) {
|
|
1179
|
+
let r = n[t] + n[t + 1] + n[t + 2] + n[t + 3];
|
|
1180
|
+
if (r += e[t] + e[t + 1] + e[t + 2] + e[t + 3], r === 0)
|
|
1181
|
+
n[t] = 1;
|
|
1182
|
+
else {
|
|
1183
|
+
const s = 1 / r;
|
|
1184
|
+
n[t] *= s, n[t + 1] *= s, n[t + 2] *= s, n[t + 3] *= s, e[t] *= s, e[t + 1] *= s, e[t + 2] *= s, e[t + 3] *= s;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
this.setVerticesData(d.MatricesWeightsKind, n), this.setVerticesData(d.MatricesWeightsKind, e);
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights,
|
|
1191
|
+
* or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let
|
|
1192
|
+
* the user know there was an issue with importing the mesh
|
|
1193
|
+
* @returns a validation object with skinned, valid and report string
|
|
1194
|
+
*/
|
|
1195
|
+
validateSkinning() {
|
|
1196
|
+
const e = this.getVerticesData(d.MatricesWeightsExtraKind), n = this.getVerticesData(d.MatricesWeightsKind);
|
|
1197
|
+
if (n === null || this.skeleton == null)
|
|
1198
|
+
return { skinned: !1, valid: !0, report: "not skinned" };
|
|
1199
|
+
const i = n.length;
|
|
1200
|
+
let t = 0, r = 0, s = 0, a = 0;
|
|
1201
|
+
const o = e === null ? 4 : 8, l = new Array();
|
|
1202
|
+
for (let f = 0; f <= o; f++)
|
|
1203
|
+
l[f] = 0;
|
|
1204
|
+
const c = 1e-3;
|
|
1205
|
+
for (let f = 0; f < i; f += 4) {
|
|
1206
|
+
let y = n[f], v = y, M = v === 0 ? 0 : 1;
|
|
1207
|
+
for (let S = 1; S < o; S++) {
|
|
1208
|
+
const m = S < 4 ? n[f + S] : e[f + S - 4];
|
|
1209
|
+
m > y && t++, m !== 0 && M++, v += m, y = m;
|
|
1210
|
+
}
|
|
1211
|
+
if (l[M]++, M > s && (s = M), v === 0)
|
|
1212
|
+
r++;
|
|
1213
|
+
else {
|
|
1214
|
+
const S = 1 / v;
|
|
1215
|
+
let m = 0;
|
|
1216
|
+
for (let h = 0; h < o; h++)
|
|
1217
|
+
h < 4 ? m += Math.abs(n[f + h] - n[f + h] * S) : m += Math.abs(e[f + h - 4] - e[f + h - 4] * S);
|
|
1218
|
+
m > c && a++;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
const u = this.skeleton.bones.length, _ = this.getVerticesData(d.MatricesIndicesKind), p = this.getVerticesData(d.MatricesIndicesExtraKind);
|
|
1222
|
+
let x = 0;
|
|
1223
|
+
for (let f = 0; f < i; f += 4)
|
|
1224
|
+
for (let y = 0; y < o; y++) {
|
|
1225
|
+
const v = y < 4 ? _[f + y] : p[f + y - 4];
|
|
1226
|
+
(v >= u || v < 0) && x++;
|
|
1227
|
+
}
|
|
1228
|
+
const I = "Number of Weights = " + i / 4 + `
|
|
1229
|
+
Maximum influences = ` + s + `
|
|
1230
|
+
Missing Weights = ` + r + `
|
|
1231
|
+
Not Sorted = ` + t + `
|
|
1232
|
+
Not Normalized = ` + a + `
|
|
1233
|
+
WeightCounts = [` + l + `]
|
|
1234
|
+
Number of bones = ` + u + `
|
|
1235
|
+
Bad Bone Indices = ` + x;
|
|
1236
|
+
return { skinned: !0, valid: r === 0 && a === 0 && x === 0, report: I };
|
|
1237
|
+
}
|
|
1238
|
+
/** @internal */
|
|
1239
|
+
_checkDelayState() {
|
|
1240
|
+
const e = this.getScene();
|
|
1241
|
+
return this._geometry ? this._geometry.load(e) : this.delayLoadState === 4 && (this.delayLoadState = 2, this._queueLoad(e)), this;
|
|
1242
|
+
}
|
|
1243
|
+
_queueLoad(e) {
|
|
1244
|
+
e.addPendingData(this);
|
|
1245
|
+
const n = this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1;
|
|
1246
|
+
return N.LoadFile(this.delayLoadingFile, (i) => {
|
|
1247
|
+
i instanceof ArrayBuffer ? this._delayLoadingFunction(i, this) : this._delayLoadingFunction(JSON.parse(i), this), this.instances.forEach((t) => {
|
|
1248
|
+
t.refreshBoundingInfo(), t._syncSubMeshes();
|
|
1249
|
+
}), this.delayLoadState = 1, e.removePendingData(this);
|
|
1250
|
+
}, () => {
|
|
1251
|
+
}, e.offlineProvider, n), this;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Returns `true` if the mesh is within the frustum defined by the passed array of planes.
|
|
1255
|
+
* A mesh is in the frustum if its bounding box intersects the frustum
|
|
1256
|
+
* @param frustumPlanes defines the frustum to test
|
|
1257
|
+
* @returns true if the mesh is in the frustum planes
|
|
1258
|
+
*/
|
|
1259
|
+
isInFrustum(e) {
|
|
1260
|
+
return this.delayLoadState === 2 || !super.isInFrustum(e) ? !1 : (this._checkDelayState(), !0);
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Sets the mesh material by the material or multiMaterial `id` property
|
|
1264
|
+
* @param id is a string identifying the material or the multiMaterial
|
|
1265
|
+
* @returns the current mesh
|
|
1266
|
+
*/
|
|
1267
|
+
setMaterialById(e) {
|
|
1268
|
+
const n = this.getScene().materials;
|
|
1269
|
+
let i;
|
|
1270
|
+
for (i = n.length - 1; i > -1; i--)
|
|
1271
|
+
if (n[i].id === e)
|
|
1272
|
+
return this.material = n[i], this;
|
|
1273
|
+
const t = this.getScene().multiMaterials;
|
|
1274
|
+
for (i = t.length - 1; i > -1; i--)
|
|
1275
|
+
if (t[i].id === e)
|
|
1276
|
+
return this.material = t[i], this;
|
|
1277
|
+
return this;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Returns as a new array populated with the mesh material and/or skeleton, if any.
|
|
1281
|
+
* @returns an array of IAnimatable
|
|
1282
|
+
*/
|
|
1283
|
+
getAnimatables() {
|
|
1284
|
+
const e = new Array();
|
|
1285
|
+
return this.material && e.push(this.material), this.skeleton && e.push(this.skeleton), e;
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Modifies the mesh geometry according to the passed transformation matrix.
|
|
1289
|
+
* This method returns nothing, but it really modifies the mesh even if it's originally not set as updatable.
|
|
1290
|
+
* The mesh normals are modified using the same transformation.
|
|
1291
|
+
* Note that, under the hood, this method sets a new VertexBuffer each call.
|
|
1292
|
+
* @param transform defines the transform matrix to use
|
|
1293
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
|
|
1294
|
+
* @returns the current mesh
|
|
1295
|
+
*/
|
|
1296
|
+
bakeTransformIntoVertices(e) {
|
|
1297
|
+
if (!this.isVerticesDataPresent(d.PositionKind))
|
|
1298
|
+
return this;
|
|
1299
|
+
const n = this.subMeshes.splice(0);
|
|
1300
|
+
this._resetPointsArrayCache();
|
|
1301
|
+
let i = this.getVerticesData(d.PositionKind);
|
|
1302
|
+
const t = w.Zero();
|
|
1303
|
+
let r;
|
|
1304
|
+
for (r = 0; r < i.length; r += 3)
|
|
1305
|
+
w.TransformCoordinatesFromFloatsToRef(i[r], i[r + 1], i[r + 2], e, t).toArray(i, r);
|
|
1306
|
+
if (this.setVerticesData(d.PositionKind, i, this.getVertexBuffer(d.PositionKind).isUpdatable()), this.isVerticesDataPresent(d.NormalKind)) {
|
|
1307
|
+
for (i = this.getVerticesData(d.NormalKind), r = 0; r < i.length; r += 3)
|
|
1308
|
+
w.TransformNormalFromFloatsToRef(i[r], i[r + 1], i[r + 2], e, t).normalize().toArray(i, r);
|
|
1309
|
+
this.setVerticesData(d.NormalKind, i, this.getVertexBuffer(d.NormalKind).isUpdatable());
|
|
1310
|
+
}
|
|
1311
|
+
return e.determinant() < 0 && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = n, this;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Modifies the mesh geometry according to its own current World Matrix.
|
|
1315
|
+
* The mesh World Matrix is then reset.
|
|
1316
|
+
* This method returns nothing but really modifies the mesh even if it's originally not set as updatable.
|
|
1317
|
+
* Note that, under the hood, this method sets a new VertexBuffer each call.
|
|
1318
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
|
|
1319
|
+
* @param bakeIndependentlyOfChildren indicates whether to preserve all child nodes' World Matrix during baking
|
|
1320
|
+
* @returns the current mesh
|
|
1321
|
+
*/
|
|
1322
|
+
bakeCurrentTransformIntoVertices(e = !0) {
|
|
1323
|
+
return this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.resetLocalMatrix(e), this;
|
|
1324
|
+
}
|
|
1325
|
+
// Cache
|
|
1326
|
+
/** @internal */
|
|
1327
|
+
get _positions() {
|
|
1328
|
+
return this._internalAbstractMeshDataInfo._positions ? this._internalAbstractMeshDataInfo._positions : this._geometry ? this._geometry._positions : null;
|
|
1329
|
+
}
|
|
1330
|
+
/** @internal */
|
|
1331
|
+
_resetPointsArrayCache() {
|
|
1332
|
+
return this._geometry && this._geometry._resetPointsArrayCache(), this;
|
|
1333
|
+
}
|
|
1334
|
+
/** @internal */
|
|
1335
|
+
_generatePointsArray() {
|
|
1336
|
+
return this._geometry ? this._geometry._generatePointsArray() : !1;
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Returns a new Mesh object generated from the current mesh properties.
|
|
1340
|
+
* This method must not get confused with createInstance()
|
|
1341
|
+
* @param name is a string, the name given to the new mesh
|
|
1342
|
+
* @param newParent can be any Node object (default `null`)
|
|
1343
|
+
* @param doNotCloneChildren allows/denies the recursive cloning of the original mesh children if any (default `false`)
|
|
1344
|
+
* @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
|
|
1345
|
+
* @returns a new mesh
|
|
1346
|
+
*/
|
|
1347
|
+
clone(e = "", n = null, i, t = !0) {
|
|
1348
|
+
return new D(e, this.getScene(), n, this, i, t);
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Releases resources associated with this mesh.
|
|
1352
|
+
* @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
|
|
1353
|
+
* @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
|
|
1354
|
+
*/
|
|
1355
|
+
dispose(e, n = !1) {
|
|
1356
|
+
this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0);
|
|
1357
|
+
const i = this._internalMeshDataInfo;
|
|
1358
|
+
if (i._onBeforeDrawObservable && i._onBeforeDrawObservable.clear(), i._onBeforeBindObservable && i._onBeforeBindObservable.clear(), i._onBeforeRenderObservable && i._onBeforeRenderObservable.clear(), i._onAfterRenderObservable && i._onAfterRenderObservable.clear(), i._onBetweenPassObservable && i._onBetweenPassObservable.clear(), this._scene.useClonedMeshMap) {
|
|
1359
|
+
if (i.meshMap)
|
|
1360
|
+
for (const t in i.meshMap) {
|
|
1361
|
+
const r = i.meshMap[t];
|
|
1362
|
+
r && (r._internalMeshDataInfo._source = null, i.meshMap[t] = void 0);
|
|
1363
|
+
}
|
|
1364
|
+
i._source && i._source._internalMeshDataInfo.meshMap && (i._source._internalMeshDataInfo.meshMap[this.uniqueId] = void 0);
|
|
1365
|
+
} else {
|
|
1366
|
+
const t = this.getScene().meshes;
|
|
1367
|
+
for (const r of t) {
|
|
1368
|
+
const s = r;
|
|
1369
|
+
s._internalMeshDataInfo && s._internalMeshDataInfo._source && s._internalMeshDataInfo._source === this && (s._internalMeshDataInfo._source = null);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
i._source = null, this._instanceDataStorage.visibleInstances = {}, this._disposeInstanceSpecificData(), this._disposeThinInstanceSpecificData(), this._internalMeshDataInfo._checkReadinessObserver && this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), super.dispose(e, n);
|
|
1373
|
+
}
|
|
1374
|
+
/** @internal */
|
|
1375
|
+
_disposeInstanceSpecificData() {
|
|
1376
|
+
}
|
|
1377
|
+
/** @internal */
|
|
1378
|
+
_disposeThinInstanceSpecificData() {
|
|
1379
|
+
}
|
|
1380
|
+
/** @internal */
|
|
1381
|
+
_invalidateInstanceVertexArrayObject() {
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Modifies the mesh geometry according to a displacement map.
|
|
1385
|
+
* A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
|
|
1386
|
+
* The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
|
|
1387
|
+
* @param url is a string, the URL from the image file is to be downloaded.
|
|
1388
|
+
* @param minHeight is the lower limit of the displacement.
|
|
1389
|
+
* @param maxHeight is the upper limit of the displacement.
|
|
1390
|
+
* @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
|
|
1391
|
+
* @param uvOffset is an optional vector2 used to offset UV.
|
|
1392
|
+
* @param uvScale is an optional vector2 used to scale UV.
|
|
1393
|
+
* @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
|
|
1394
|
+
* @returns the Mesh.
|
|
1395
|
+
*/
|
|
1396
|
+
applyDisplacementMap(e, n, i, t, r, s, a = !1) {
|
|
1397
|
+
const o = this.getScene(), l = (c) => {
|
|
1398
|
+
const u = c.width, _ = c.height, x = this.getEngine().createCanvas(u, _).getContext("2d");
|
|
1399
|
+
x.drawImage(c, 0, 0);
|
|
1400
|
+
const I = x.getImageData(0, 0, u, _).data;
|
|
1401
|
+
this.applyDisplacementMapFromBuffer(I, u, _, n, i, r, s, a), t && t(this);
|
|
1402
|
+
};
|
|
1403
|
+
return N.LoadImage(e, l, () => {
|
|
1404
|
+
}, o.offlineProvider), this;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* Modifies the mesh geometry according to a displacementMap buffer.
|
|
1408
|
+
* A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
|
|
1409
|
+
* The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
|
|
1410
|
+
* @param buffer is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel.
|
|
1411
|
+
* @param heightMapWidth is the width of the buffer image.
|
|
1412
|
+
* @param heightMapHeight is the height of the buffer image.
|
|
1413
|
+
* @param minHeight is the lower limit of the displacement.
|
|
1414
|
+
* @param maxHeight is the upper limit of the displacement.
|
|
1415
|
+
* @param uvOffset is an optional vector2 used to offset UV.
|
|
1416
|
+
* @param uvScale is an optional vector2 used to scale UV.
|
|
1417
|
+
* @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
|
|
1418
|
+
* @returns the Mesh.
|
|
1419
|
+
*/
|
|
1420
|
+
applyDisplacementMapFromBuffer(e, n, i, t, r, s, a, o = !1) {
|
|
1421
|
+
if (!this.isVerticesDataPresent(d.PositionKind) || !this.isVerticesDataPresent(d.NormalKind) || !this.isVerticesDataPresent(d.UVKind))
|
|
1422
|
+
return F.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"), this;
|
|
1423
|
+
const l = this.getVerticesData(d.PositionKind, !0, !0), c = this.getVerticesData(d.NormalKind), u = this.getVerticesData(d.UVKind);
|
|
1424
|
+
let _ = w.Zero();
|
|
1425
|
+
const p = w.Zero(), x = W.Zero();
|
|
1426
|
+
s = s || W.Zero(), a = a || new W(1, 1);
|
|
1427
|
+
for (let I = 0; I < l.length; I += 3) {
|
|
1428
|
+
w.FromArrayToRef(l, I, _), w.FromArrayToRef(c, I, p), W.FromArrayToRef(u, I / 3 * 2, x);
|
|
1429
|
+
const f = Math.abs(x.x * a.x + s.x % 1) * (n - 1) % n | 0, y = Math.abs(x.y * a.y + s.y % 1) * (i - 1) % i | 0, v = (f + y * n) * 4, M = e[v] / 255, S = e[v + 1] / 255, m = e[v + 2] / 255, h = M * 0.3 + S * 0.59 + m * 0.11;
|
|
1430
|
+
p.normalize(), p.scaleInPlace(t + (r - t) * h), _ = _.add(p), _.toArray(l, I);
|
|
1431
|
+
}
|
|
1432
|
+
return P.ComputeNormals(l, this.getIndices(), c), o ? (this.setVerticesData(d.PositionKind, l), this.setVerticesData(d.NormalKind, c), this.setVerticesData(d.UVKind, u)) : (this.updateVerticesData(d.PositionKind, l), this.updateVerticesData(d.NormalKind, c)), this;
|
|
1433
|
+
}
|
|
1434
|
+
_getFlattenedNormals(e, n) {
|
|
1435
|
+
const i = new Float32Array(e.length * 3);
|
|
1436
|
+
let t = 0;
|
|
1437
|
+
const r = this.overrideMaterialSideOrientation === (this._scene.useRightHandedSystem ? 1 : 0);
|
|
1438
|
+
for (let s = 0; s < e.length; s += 3) {
|
|
1439
|
+
const a = w.FromArray(n, e[s] * 3), o = w.FromArray(n, e[s + 1] * 3), l = w.FromArray(n, e[s + 2] * 3), c = a.subtract(o), u = l.subtract(o), _ = w.Normalize(w.Cross(c, u));
|
|
1440
|
+
r && _.scaleInPlace(-1);
|
|
1441
|
+
for (let p = 0; p < 3; p++)
|
|
1442
|
+
i[t++] = _.x, i[t++] = _.y, i[t++] = _.z;
|
|
1443
|
+
}
|
|
1444
|
+
return i;
|
|
1445
|
+
}
|
|
1446
|
+
_convertToUnIndexedMesh(e = !1) {
|
|
1447
|
+
const n = this.getVerticesDataKinds(), i = this.getIndices(), t = {}, r = (a, o) => {
|
|
1448
|
+
const l = new Float32Array(i.length * o);
|
|
1449
|
+
let c = 0;
|
|
1450
|
+
for (let u = 0; u < i.length; u++)
|
|
1451
|
+
for (let _ = 0; _ < o; _++)
|
|
1452
|
+
l[c++] = a[i[u] * o + _];
|
|
1453
|
+
return l;
|
|
1454
|
+
}, s = this.geometry ? this.subMeshes.slice(0) : [];
|
|
1455
|
+
for (const a of n)
|
|
1456
|
+
t[a] = this.getVerticesData(a);
|
|
1457
|
+
for (const a of n) {
|
|
1458
|
+
const o = this.getVertexBuffer(a), l = o.getStrideSize();
|
|
1459
|
+
if (e && a === d.NormalKind) {
|
|
1460
|
+
const c = this._getFlattenedNormals(i, t[d.PositionKind]);
|
|
1461
|
+
this.setVerticesData(d.NormalKind, c, o.isUpdatable(), l);
|
|
1462
|
+
} else
|
|
1463
|
+
this.setVerticesData(a, r(t[a], l), o.isUpdatable(), l);
|
|
1464
|
+
}
|
|
1465
|
+
if (this.morphTargetManager) {
|
|
1466
|
+
for (let a = 0; a < this.morphTargetManager.numTargets; a++) {
|
|
1467
|
+
const o = this.morphTargetManager.getTarget(a), l = o.getPositions();
|
|
1468
|
+
o.setPositions(r(l, 3));
|
|
1469
|
+
const c = o.getNormals();
|
|
1470
|
+
c && o.setNormals(e ? this._getFlattenedNormals(i, l) : r(c, 3));
|
|
1471
|
+
const u = o.getTangents();
|
|
1472
|
+
u && o.setTangents(r(u, 3));
|
|
1473
|
+
const _ = o.getUVs();
|
|
1474
|
+
_ && o.setUVs(r(_, 2));
|
|
1475
|
+
}
|
|
1476
|
+
this.morphTargetManager.synchronize();
|
|
1477
|
+
}
|
|
1478
|
+
for (let a = 0; a < i.length; a++)
|
|
1479
|
+
i[a] = a;
|
|
1480
|
+
this.setIndices(i), this._unIndexed = !0, this.releaseSubMeshes();
|
|
1481
|
+
for (const a of s)
|
|
1482
|
+
k.AddToMesh(a.materialIndex, a.indexStart, a.indexCount, a.indexStart, a.indexCount, this);
|
|
1483
|
+
return this.synchronizeInstances(), this;
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Modify the mesh to get a flat shading rendering.
|
|
1487
|
+
* This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result.
|
|
1488
|
+
* Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated.
|
|
1489
|
+
* @returns current mesh
|
|
1490
|
+
*/
|
|
1491
|
+
convertToFlatShadedMesh() {
|
|
1492
|
+
return this._convertToUnIndexedMesh(!0);
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers.
|
|
1496
|
+
* In other words, more vertices, no more indices and a single bigger VBO.
|
|
1497
|
+
* The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.
|
|
1498
|
+
* @returns current mesh
|
|
1499
|
+
*/
|
|
1500
|
+
convertToUnIndexedMesh() {
|
|
1501
|
+
return this._convertToUnIndexedMesh();
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Inverses facet orientations.
|
|
1505
|
+
* Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
|
|
1506
|
+
* @param flipNormals will also inverts the normals
|
|
1507
|
+
* @returns current mesh
|
|
1508
|
+
*/
|
|
1509
|
+
flipFaces(e = !1) {
|
|
1510
|
+
const n = P.ExtractFromMesh(this);
|
|
1511
|
+
let i;
|
|
1512
|
+
if (e && this.isVerticesDataPresent(d.NormalKind) && n.normals)
|
|
1513
|
+
for (i = 0; i < n.normals.length; i++)
|
|
1514
|
+
n.normals[i] *= -1;
|
|
1515
|
+
if (n.indices) {
|
|
1516
|
+
let t;
|
|
1517
|
+
for (i = 0; i < n.indices.length; i += 3)
|
|
1518
|
+
t = n.indices[i + 1], n.indices[i + 1] = n.indices[i + 2], n.indices[i + 2] = t;
|
|
1519
|
+
}
|
|
1520
|
+
return n.applyToMesh(this, this.isVertexBufferUpdatable(d.PositionKind)), this;
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Increase the number of facets and hence vertices in a mesh
|
|
1524
|
+
* Vertex normals are interpolated from existing vertex normals
|
|
1525
|
+
* Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
|
|
1526
|
+
* @param numberPerEdge the number of new vertices to add to each edge of a facet, optional default 1
|
|
1527
|
+
*/
|
|
1528
|
+
increaseVertices(e = 1) {
|
|
1529
|
+
const n = P.ExtractFromMesh(this), i = n.indices && !Array.isArray(n.indices) && Array.from ? Array.from(n.indices) : n.indices, t = n.positions && !Array.isArray(n.positions) && Array.from ? Array.from(n.positions) : n.positions, r = n.uvs && !Array.isArray(n.uvs) && Array.from ? Array.from(n.uvs) : n.uvs, s = n.normals && !Array.isArray(n.normals) && Array.from ? Array.from(n.normals) : n.normals;
|
|
1530
|
+
if (!i || !t)
|
|
1531
|
+
F.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");
|
|
1532
|
+
else {
|
|
1533
|
+
n.indices = i, n.positions = t, r && (n.uvs = r), s && (n.normals = s);
|
|
1534
|
+
const a = e + 1, o = new Array();
|
|
1535
|
+
for (let m = 0; m < a + 1; m++)
|
|
1536
|
+
o[m] = new Array();
|
|
1537
|
+
let l, c;
|
|
1538
|
+
const u = new w(0, 0, 0), _ = new w(0, 0, 0), p = new W(0, 0), x = new Array(), I = new Array(), f = new Array();
|
|
1539
|
+
let y, v = t.length, M;
|
|
1540
|
+
r && (M = r.length);
|
|
1541
|
+
let S;
|
|
1542
|
+
s && (S = s.length);
|
|
1543
|
+
for (let m = 0; m < i.length; m += 3) {
|
|
1544
|
+
I[0] = i[m], I[1] = i[m + 1], I[2] = i[m + 2];
|
|
1545
|
+
for (let h = 0; h < 3; h++)
|
|
1546
|
+
if (l = I[h], c = I[(h + 1) % 3], f[l] === void 0 && f[c] === void 0 ? (f[l] = new Array(), f[c] = new Array()) : (f[l] === void 0 && (f[l] = new Array()), f[c] === void 0 && (f[c] = new Array())), f[l][c] === void 0 && f[c][l] === void 0) {
|
|
1547
|
+
f[l][c] = [], u.x = (t[3 * c] - t[3 * l]) / a, u.y = (t[3 * c + 1] - t[3 * l + 1]) / a, u.z = (t[3 * c + 2] - t[3 * l + 2]) / a, s && (_.x = (s[3 * c] - s[3 * l]) / a, _.y = (s[3 * c + 1] - s[3 * l + 1]) / a, _.z = (s[3 * c + 2] - s[3 * l + 2]) / a), r && (p.x = (r[2 * c] - r[2 * l]) / a, p.y = (r[2 * c + 1] - r[2 * l + 1]) / a), f[l][c].push(l);
|
|
1548
|
+
for (let g = 1; g < a; g++)
|
|
1549
|
+
f[l][c].push(t.length / 3), t[v++] = t[3 * l] + g * u.x, t[v++] = t[3 * l + 1] + g * u.y, t[v++] = t[3 * l + 2] + g * u.z, s && (s[S++] = s[3 * l] + g * _.x, s[S++] = s[3 * l + 1] + g * _.y, s[S++] = s[3 * l + 2] + g * _.z), r && (r[M++] = r[2 * l] + g * p.x, r[M++] = r[2 * l + 1] + g * p.y);
|
|
1550
|
+
f[l][c].push(c), f[c][l] = new Array(), y = f[l][c].length;
|
|
1551
|
+
for (let g = 0; g < y; g++)
|
|
1552
|
+
f[c][l][g] = f[l][c][y - 1 - g];
|
|
1553
|
+
}
|
|
1554
|
+
o[0][0] = i[m], o[1][0] = f[i[m]][i[m + 1]][1], o[1][1] = f[i[m]][i[m + 2]][1];
|
|
1555
|
+
for (let h = 2; h < a; h++) {
|
|
1556
|
+
o[h][0] = f[i[m]][i[m + 1]][h], o[h][h] = f[i[m]][i[m + 2]][h], u.x = (t[3 * o[h][h]] - t[3 * o[h][0]]) / h, u.y = (t[3 * o[h][h] + 1] - t[3 * o[h][0] + 1]) / h, u.z = (t[3 * o[h][h] + 2] - t[3 * o[h][0] + 2]) / h, s && (_.x = (s[3 * o[h][h]] - s[3 * o[h][0]]) / h, _.y = (s[3 * o[h][h] + 1] - s[3 * o[h][0] + 1]) / h, _.z = (s[3 * o[h][h] + 2] - s[3 * o[h][0] + 2]) / h), r && (p.x = (r[2 * o[h][h]] - r[2 * o[h][0]]) / h, p.y = (r[2 * o[h][h] + 1] - r[2 * o[h][0] + 1]) / h);
|
|
1557
|
+
for (let g = 1; g < h; g++)
|
|
1558
|
+
o[h][g] = t.length / 3, t[v++] = t[3 * o[h][0]] + g * u.x, t[v++] = t[3 * o[h][0] + 1] + g * u.y, t[v++] = t[3 * o[h][0] + 2] + g * u.z, s && (s[S++] = s[3 * o[h][0]] + g * _.x, s[S++] = s[3 * o[h][0] + 1] + g * _.y, s[S++] = s[3 * o[h][0] + 2] + g * _.z), r && (r[M++] = r[2 * o[h][0]] + g * p.x, r[M++] = r[2 * o[h][0] + 1] + g * p.y);
|
|
1559
|
+
}
|
|
1560
|
+
o[a] = f[i[m + 1]][i[m + 2]], x.push(o[0][0], o[1][0], o[1][1]);
|
|
1561
|
+
for (let h = 1; h < a; h++) {
|
|
1562
|
+
let g;
|
|
1563
|
+
for (g = 0; g < h; g++)
|
|
1564
|
+
x.push(o[h][g], o[h + 1][g], o[h + 1][g + 1]), x.push(o[h][g], o[h + 1][g + 1], o[h][g + 1]);
|
|
1565
|
+
x.push(o[h][g], o[h + 1][g], o[h + 1][g + 1]);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
n.indices = x, n.applyToMesh(this, this.isVertexBufferUpdatable(d.PositionKind));
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Force adjacent facets to share vertices and remove any facets that have all vertices in a line
|
|
1573
|
+
* This will undo any application of covertToFlatShadedMesh
|
|
1574
|
+
* Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
|
|
1575
|
+
*/
|
|
1576
|
+
forceSharedVertices() {
|
|
1577
|
+
const e = P.ExtractFromMesh(this), n = e.uvs, i = e.indices, t = e.positions, r = e.colors, s = e.matricesIndices, a = e.matricesWeights, o = e.matricesIndicesExtra, l = e.matricesWeightsExtra;
|
|
1578
|
+
if (i === void 0 || t === void 0 || i === null || t === null)
|
|
1579
|
+
F.Warn("VertexData contains empty entries");
|
|
1580
|
+
else {
|
|
1581
|
+
const c = new Array(), u = new Array(), _ = new Array(), p = new Array(), x = new Array(), I = new Array(), f = new Array(), y = new Array();
|
|
1582
|
+
let v = new Array(), M = 0;
|
|
1583
|
+
const S = {};
|
|
1584
|
+
let m, h;
|
|
1585
|
+
for (let B = 0; B < i.length; B += 3) {
|
|
1586
|
+
h = [i[B], i[B + 1], i[B + 2]], v = new Array();
|
|
1587
|
+
for (let b = 0; b < 3; b++) {
|
|
1588
|
+
v[b] = "";
|
|
1589
|
+
for (let A = 0; A < 3; A++)
|
|
1590
|
+
Math.abs(t[3 * h[b] + A]) < 1e-8 && (t[3 * h[b] + A] = 0), v[b] += t[3 * h[b] + A] + "|";
|
|
1591
|
+
}
|
|
1592
|
+
if (!(v[0] == v[1] || v[0] == v[2] || v[1] == v[2]))
|
|
1593
|
+
for (let b = 0; b < 3; b++) {
|
|
1594
|
+
if (m = S[v[b]], m === void 0) {
|
|
1595
|
+
S[v[b]] = M, m = M++;
|
|
1596
|
+
for (let A = 0; A < 3; A++)
|
|
1597
|
+
c.push(t[3 * h[b] + A]);
|
|
1598
|
+
if (r != null)
|
|
1599
|
+
for (let A = 0; A < 4; A++)
|
|
1600
|
+
p.push(r[4 * h[b] + A]);
|
|
1601
|
+
if (n != null)
|
|
1602
|
+
for (let A = 0; A < 2; A++)
|
|
1603
|
+
_.push(n[2 * h[b] + A]);
|
|
1604
|
+
if (s != null)
|
|
1605
|
+
for (let A = 0; A < 4; A++)
|
|
1606
|
+
x.push(s[4 * h[b] + A]);
|
|
1607
|
+
if (a != null)
|
|
1608
|
+
for (let A = 0; A < 4; A++)
|
|
1609
|
+
I.push(a[4 * h[b] + A]);
|
|
1610
|
+
if (o != null)
|
|
1611
|
+
for (let A = 0; A < 4; A++)
|
|
1612
|
+
f.push(o[4 * h[b] + A]);
|
|
1613
|
+
if (l != null)
|
|
1614
|
+
for (let A = 0; A < 4; A++)
|
|
1615
|
+
y.push(l[4 * h[b] + A]);
|
|
1616
|
+
}
|
|
1617
|
+
u.push(m);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
const g = new Array();
|
|
1621
|
+
P.ComputeNormals(c, u, g), e.positions = c, e.indices = u, e.normals = g, n != null && (e.uvs = _), r != null && (e.colors = p), s != null && (e.matricesIndices = x), a != null && (e.matricesWeights = I), o != null && (e.matricesIndicesExtra = f), a != null && (e.matricesWeightsExtra = y), e.applyToMesh(this, this.isVertexBufferUpdatable(d.PositionKind));
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
// Instances
|
|
1625
|
+
/**
|
|
1626
|
+
* @internal
|
|
1627
|
+
*/
|
|
1628
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/naming-convention
|
|
1629
|
+
static _instancedMeshFactory(e, n) {
|
|
1630
|
+
throw R("InstancedMesh");
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* @internal
|
|
1634
|
+
*/
|
|
1635
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1636
|
+
static _PhysicsImpostorParser(e, n, i) {
|
|
1637
|
+
throw R("PhysicsImpostor");
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Creates a new InstancedMesh object from the mesh model.
|
|
1641
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
|
|
1642
|
+
* @param name defines the name of the new instance
|
|
1643
|
+
* @returns a new InstancedMesh
|
|
1644
|
+
*/
|
|
1645
|
+
createInstance(e) {
|
|
1646
|
+
return D._instancedMeshFactory(e, this);
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Synchronises all the mesh instance submeshes to the current mesh submeshes, if any.
|
|
1650
|
+
* After this call, all the mesh instances have the same submeshes than the current mesh.
|
|
1651
|
+
* @returns the current mesh
|
|
1652
|
+
*/
|
|
1653
|
+
synchronizeInstances() {
|
|
1654
|
+
for (let e = 0; e < this.instances.length; e++)
|
|
1655
|
+
this.instances[e]._syncSubMeshes();
|
|
1656
|
+
return this;
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Optimization of the mesh's indices, in case a mesh has duplicated vertices.
|
|
1660
|
+
* The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes.
|
|
1661
|
+
* This should be used together with the simplification to avoid disappearing triangles.
|
|
1662
|
+
* @param successCallback an optional success callback to be called after the optimization finished.
|
|
1663
|
+
* @returns the current mesh
|
|
1664
|
+
*/
|
|
1665
|
+
optimizeIndices(e) {
|
|
1666
|
+
const n = this.getIndices(), i = this.getVerticesData(d.PositionKind);
|
|
1667
|
+
if (!i || !n)
|
|
1668
|
+
return this;
|
|
1669
|
+
const t = new Array();
|
|
1670
|
+
for (let s = 0; s < i.length; s = s + 3)
|
|
1671
|
+
t.push(w.FromArray(i, s));
|
|
1672
|
+
const r = new Array();
|
|
1673
|
+
return Y.SyncAsyncForLoop(t.length, 40, (s) => {
|
|
1674
|
+
const a = t.length - 1 - s, o = t[a];
|
|
1675
|
+
for (let l = 0; l < a; ++l) {
|
|
1676
|
+
const c = t[l];
|
|
1677
|
+
if (o.equals(c)) {
|
|
1678
|
+
r[a] = l;
|
|
1679
|
+
break;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}, () => {
|
|
1683
|
+
for (let a = 0; a < n.length; ++a)
|
|
1684
|
+
n[a] = r[n[a]] || n[a];
|
|
1685
|
+
const s = this.subMeshes.slice(0);
|
|
1686
|
+
this.setIndices(n), this.subMeshes = s, e && e(this);
|
|
1687
|
+
}), this;
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Serialize current mesh
|
|
1691
|
+
* @param serializationObject defines the object which will receive the serialization data
|
|
1692
|
+
*/
|
|
1693
|
+
serialize(e = {}) {
|
|
1694
|
+
e.name = this.name, e.id = this.id, e.uniqueId = this.uniqueId, e.type = this.getClassName(), C && C.HasTags(this) && (e.tags = C.GetTags(this)), e.position = this.position.asArray(), this.rotationQuaternion ? e.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (e.rotation = this.rotation.asArray()), e.scaling = this.scaling.asArray(), this._postMultiplyPivotMatrix ? e.pivotMatrix = this.getPivotMatrix().asArray() : e.localMatrix = this.getPivotMatrix().asArray(), e.isEnabled = this.isEnabled(!1), e.isVisible = this.isVisible, e.infiniteDistance = this.infiniteDistance, e.pickable = this.isPickable, e.receiveShadows = this.receiveShadows, e.billboardMode = this.billboardMode, e.visibility = this.visibility, e.checkCollisions = this.checkCollisions, e.isBlocker = this.isBlocker, e.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation, this.parent && this.parent._serializeAsParent(e), e.isUnIndexed = this.isUnIndexed;
|
|
1695
|
+
const n = this._geometry;
|
|
1696
|
+
if (n && this.subMeshes) {
|
|
1697
|
+
e.geometryUniqueId = n.uniqueId, e.geometryId = n.id, e.subMeshes = [];
|
|
1698
|
+
for (let i = 0; i < this.subMeshes.length; i++) {
|
|
1699
|
+
const t = this.subMeshes[i];
|
|
1700
|
+
e.subMeshes.push({
|
|
1701
|
+
materialIndex: t.materialIndex,
|
|
1702
|
+
verticesStart: t.verticesStart,
|
|
1703
|
+
verticesCount: t.verticesCount,
|
|
1704
|
+
indexStart: t.indexStart,
|
|
1705
|
+
indexCount: t.indexCount
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
if (this.material ? this.material.doNotSerialize || (e.materialUniqueId = this.material.uniqueId, e.materialId = this.material.id) : (this.material = null, e.materialUniqueId = this._scene.defaultMaterial.uniqueId, e.materialId = this._scene.defaultMaterial.id), this.morphTargetManager && (e.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (e.skeletonId = this.skeleton.id, e.numBoneInfluencers = this.numBoneInfluencers), this.getScene()._getComponent(H.NAME_PHYSICSENGINE)) {
|
|
1710
|
+
const i = this.getPhysicsImpostor();
|
|
1711
|
+
i && (e.physicsMass = i.getParam("mass"), e.physicsFriction = i.getParam("friction"), e.physicsRestitution = i.getParam("mass"), e.physicsImpostor = i.type);
|
|
1712
|
+
}
|
|
1713
|
+
this.metadata && (e.metadata = this.metadata), e.instances = [];
|
|
1714
|
+
for (let i = 0; i < this.instances.length; i++) {
|
|
1715
|
+
const t = this.instances[i];
|
|
1716
|
+
if (t.doNotSerialize)
|
|
1717
|
+
continue;
|
|
1718
|
+
const r = {
|
|
1719
|
+
name: t.name,
|
|
1720
|
+
id: t.id,
|
|
1721
|
+
isEnabled: t.isEnabled(!1),
|
|
1722
|
+
isVisible: t.isVisible,
|
|
1723
|
+
isPickable: t.isPickable,
|
|
1724
|
+
checkCollisions: t.checkCollisions,
|
|
1725
|
+
position: t.position.asArray(),
|
|
1726
|
+
scaling: t.scaling.asArray()
|
|
1727
|
+
};
|
|
1728
|
+
if (t.parent && t.parent._serializeAsParent(r), t.rotationQuaternion ? r.rotationQuaternion = t.rotationQuaternion.asArray() : t.rotation && (r.rotation = t.rotation.asArray()), this.getScene()._getComponent(H.NAME_PHYSICSENGINE)) {
|
|
1729
|
+
const s = t.getPhysicsImpostor();
|
|
1730
|
+
s && (r.physicsMass = s.getParam("mass"), r.physicsFriction = s.getParam("friction"), r.physicsRestitution = s.getParam("mass"), r.physicsImpostor = s.type);
|
|
1731
|
+
}
|
|
1732
|
+
t.metadata && (r.metadata = t.metadata), t.actionManager && (r.actions = t.actionManager.serialize(t.name)), e.instances.push(r), q.AppendSerializedAnimations(t, r), r.ranges = t.serializeAnimationRanges();
|
|
1733
|
+
}
|
|
1734
|
+
if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData && (e.thinInstances = {
|
|
1735
|
+
instancesCount: this._thinInstanceDataStorage.instancesCount,
|
|
1736
|
+
matrixData: Array.from(this._thinInstanceDataStorage.matrixData),
|
|
1737
|
+
matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize,
|
|
1738
|
+
enablePicking: this.thinInstanceEnablePicking
|
|
1739
|
+
}, this._userThinInstanceBuffersStorage)) {
|
|
1740
|
+
const i = {
|
|
1741
|
+
data: {},
|
|
1742
|
+
sizes: {},
|
|
1743
|
+
strides: {}
|
|
1744
|
+
};
|
|
1745
|
+
for (const t in this._userThinInstanceBuffersStorage.data)
|
|
1746
|
+
i.data[t] = Array.from(this._userThinInstanceBuffersStorage.data[t]), i.sizes[t] = this._userThinInstanceBuffersStorage.sizes[t], i.strides[t] = this._userThinInstanceBuffersStorage.strides[t];
|
|
1747
|
+
e.thinInstances.userThinInstance = i;
|
|
1748
|
+
}
|
|
1749
|
+
return q.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e.layerMask = this.layerMask, e.alphaIndex = this.alphaIndex, e.hasVertexAlpha = this.hasVertexAlpha, e.overlayAlpha = this.overlayAlpha, e.overlayColor = this.overlayColor.asArray(), e.renderOverlay = this.renderOverlay, e.applyFog = this.applyFog, this.actionManager && (e.actions = this.actionManager.serialize(this.name)), e;
|
|
1750
|
+
}
|
|
1751
|
+
/** @internal */
|
|
1752
|
+
_syncGeometryWithMorphTargetManager() {
|
|
1753
|
+
if (!this.geometry)
|
|
1754
|
+
return;
|
|
1755
|
+
this._markSubMeshesAsAttributesDirty();
|
|
1756
|
+
const e = this._internalAbstractMeshDataInfo._morphTargetManager;
|
|
1757
|
+
if (e && e.vertexCount) {
|
|
1758
|
+
if (e.vertexCount !== this.getTotalVertices()) {
|
|
1759
|
+
F.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."), this.morphTargetManager = null;
|
|
1760
|
+
return;
|
|
1761
|
+
}
|
|
1762
|
+
if (e.isUsingTextureForTargets)
|
|
1763
|
+
return;
|
|
1764
|
+
for (let n = 0; n < e.numInfluencers; n++) {
|
|
1765
|
+
const i = e.getActiveTarget(n), t = i.getPositions();
|
|
1766
|
+
if (!t) {
|
|
1767
|
+
F.Error("Invalid morph target. Target must have positions.");
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
this.geometry.setVerticesData(d.PositionKind + n, t, !1, 3);
|
|
1771
|
+
const r = i.getNormals();
|
|
1772
|
+
r && this.geometry.setVerticesData(d.NormalKind + n, r, !1, 3);
|
|
1773
|
+
const s = i.getTangents();
|
|
1774
|
+
s && this.geometry.setVerticesData(d.TangentKind + n, s, !1, 3);
|
|
1775
|
+
const a = i.getUVs();
|
|
1776
|
+
a && this.geometry.setVerticesData(d.UVKind + "_" + n, a, !1, 2);
|
|
1777
|
+
}
|
|
1778
|
+
} else {
|
|
1779
|
+
let n = 0;
|
|
1780
|
+
for (; this.geometry.isVerticesDataPresent(d.PositionKind + n); )
|
|
1781
|
+
this.geometry.removeVerticesData(d.PositionKind + n), this.geometry.isVerticesDataPresent(d.NormalKind + n) && this.geometry.removeVerticesData(d.NormalKind + n), this.geometry.isVerticesDataPresent(d.TangentKind + n) && this.geometry.removeVerticesData(d.TangentKind + n), this.geometry.isVerticesDataPresent(d.UVKind + n) && this.geometry.removeVerticesData(d.UVKind + "_" + n), n++;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Returns a new Mesh object parsed from the source provided.
|
|
1786
|
+
* @param parsedMesh is the source
|
|
1787
|
+
* @param scene defines the hosting scene
|
|
1788
|
+
* @param rootUrl is the root URL to prefix the `delayLoadingFile` property with
|
|
1789
|
+
* @returns a new Mesh
|
|
1790
|
+
*/
|
|
1791
|
+
static Parse(e, n, i) {
|
|
1792
|
+
let t;
|
|
1793
|
+
if (e.type && e.type === "LinesMesh" ? t = D._LinesMeshParser(e, n) : e.type && e.type === "GroundMesh" ? t = D._GroundMeshParser(e, n) : e.type && e.type === "GoldbergMesh" ? t = D._GoldbergMeshParser(e, n) : e.type && e.type === "GreasedLineMesh" ? t = D._GreasedLineMeshParser(e, n) : e.type && e.type === "TrailMesh" ? t = D._TrailMeshParser(e, n) : t = new D(e.name, n), t.id = e.id, t._waitingParsedUniqueId = e.uniqueId, C && C.AddTagsTo(t, e.tags), t.position = w.FromArray(e.position), e.metadata !== void 0 && (t.metadata = e.metadata), e.rotationQuaternion ? t.rotationQuaternion = U.FromArray(e.rotationQuaternion) : e.rotation && (t.rotation = w.FromArray(e.rotation)), t.scaling = w.FromArray(e.scaling), e.localMatrix ? t.setPreTransformMatrix(E.FromArray(e.localMatrix)) : e.pivotMatrix && t.setPivotMatrix(E.FromArray(e.pivotMatrix)), t.setEnabled(e.isEnabled), t.isVisible = e.isVisible, t.infiniteDistance = e.infiniteDistance, t.showBoundingBox = e.showBoundingBox, t.showSubMeshesBoundingBox = e.showSubMeshesBoundingBox, e.applyFog !== void 0 && (t.applyFog = e.applyFog), e.pickable !== void 0 && (t.isPickable = e.pickable), e.alphaIndex !== void 0 && (t.alphaIndex = e.alphaIndex), t.receiveShadows = e.receiveShadows, e.billboardMode !== void 0 && (t.billboardMode = e.billboardMode), e.visibility !== void 0 && (t.visibility = e.visibility), t.checkCollisions = e.checkCollisions, t.overrideMaterialSideOrientation = e.overrideMaterialSideOrientation, e.isBlocker !== void 0 && (t.isBlocker = e.isBlocker), t._shouldGenerateFlatShading = e.useFlatShading, e.freezeWorldMatrix && (t._waitingData.freezeWorldMatrix = e.freezeWorldMatrix), e.parentId !== void 0 && (t._waitingParentId = e.parentId), e.parentInstanceIndex !== void 0 && (t._waitingParentInstanceIndex = e.parentInstanceIndex), e.actions !== void 0 && (t._waitingData.actions = e.actions), e.overlayAlpha !== void 0 && (t.overlayAlpha = e.overlayAlpha), e.overlayColor !== void 0 && (t.overlayColor = ne.FromArray(e.overlayColor)), e.renderOverlay !== void 0 && (t.renderOverlay = e.renderOverlay), t.isUnIndexed = !!e.isUnIndexed, t.hasVertexAlpha = e.hasVertexAlpha, e.delayLoadingFile ? (t.delayLoadState = 4, t.delayLoadingFile = i + e.delayLoadingFile, t.buildBoundingInfo(w.FromArray(e.boundingBoxMinimum), w.FromArray(e.boundingBoxMaximum)), e._binaryInfo && (t._binaryInfo = e._binaryInfo), t._delayInfo = [], e.hasUVs && t._delayInfo.push(d.UVKind), e.hasUVs2 && t._delayInfo.push(d.UV2Kind), e.hasUVs3 && t._delayInfo.push(d.UV3Kind), e.hasUVs4 && t._delayInfo.push(d.UV4Kind), e.hasUVs5 && t._delayInfo.push(d.UV5Kind), e.hasUVs6 && t._delayInfo.push(d.UV6Kind), e.hasColors && t._delayInfo.push(d.ColorKind), e.hasMatricesIndices && t._delayInfo.push(d.MatricesIndicesKind), e.hasMatricesWeights && t._delayInfo.push(d.MatricesWeightsKind), t._delayLoadingFunction = V._ImportGeometry, se.ForceFullSceneLoadingForIncremental && t._checkDelayState()) : V._ImportGeometry(e, t), e.materialUniqueId ? t._waitingMaterialId = e.materialUniqueId : e.materialId && (t._waitingMaterialId = e.materialId), e.morphTargetManagerId > -1 && (t.morphTargetManager = n.getMorphTargetManagerById(e.morphTargetManagerId)), e.skeletonId !== void 0 && e.skeletonId !== null && (t.skeleton = n.getLastSkeletonById(e.skeletonId), e.numBoneInfluencers && (t.numBoneInfluencers = e.numBoneInfluencers)), e.animations) {
|
|
1794
|
+
for (let r = 0; r < e.animations.length; r++) {
|
|
1795
|
+
const s = e.animations[r], a = Z("BABYLON.Animation");
|
|
1796
|
+
a && t.animations.push(a.Parse(s));
|
|
1797
|
+
}
|
|
1798
|
+
K.ParseAnimationRanges(t, e, n);
|
|
1799
|
+
}
|
|
1800
|
+
if (e.autoAnimate && n.beginAnimation(t, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), e.layerMask && !isNaN(e.layerMask) ? t.layerMask = Math.abs(parseInt(e.layerMask)) : t.layerMask = 268435455, e.physicsImpostor && D._PhysicsImpostorParser(n, t, e), e.lodMeshIds && (t._waitingData.lods = {
|
|
1801
|
+
ids: e.lodMeshIds,
|
|
1802
|
+
distances: e.lodDistances ? e.lodDistances : null,
|
|
1803
|
+
coverages: e.lodCoverages ? e.lodCoverages : null
|
|
1804
|
+
}), e.instances)
|
|
1805
|
+
for (let r = 0; r < e.instances.length; r++) {
|
|
1806
|
+
const s = e.instances[r], a = t.createInstance(s.name);
|
|
1807
|
+
if (s.id && (a.id = s.id), C && (s.tags ? C.AddTagsTo(a, s.tags) : C.AddTagsTo(a, e.tags)), a.position = w.FromArray(s.position), s.metadata !== void 0 && (a.metadata = s.metadata), s.parentId !== void 0 && (a._waitingParentId = s.parentId), s.parentInstanceIndex !== void 0 && (a._waitingParentInstanceIndex = s.parentInstanceIndex), s.isEnabled !== void 0 && s.isEnabled !== null && a.setEnabled(s.isEnabled), s.isVisible !== void 0 && s.isVisible !== null && (a.isVisible = s.isVisible), s.isPickable !== void 0 && s.isPickable !== null && (a.isPickable = s.isPickable), s.rotationQuaternion ? a.rotationQuaternion = U.FromArray(s.rotationQuaternion) : s.rotation && (a.rotation = w.FromArray(s.rotation)), a.scaling = w.FromArray(s.scaling), s.checkCollisions != null && s.checkCollisions != null && (a.checkCollisions = s.checkCollisions), s.pickable != null && s.pickable != null && (a.isPickable = s.pickable), s.showBoundingBox != null && s.showBoundingBox != null && (a.showBoundingBox = s.showBoundingBox), s.showSubMeshesBoundingBox != null && s.showSubMeshesBoundingBox != null && (a.showSubMeshesBoundingBox = s.showSubMeshesBoundingBox), s.alphaIndex != null && s.showSubMeshesBoundingBox != null && (a.alphaIndex = s.alphaIndex), s.physicsImpostor && D._PhysicsImpostorParser(n, a, s), s.actions !== void 0 && (a._waitingData.actions = s.actions), s.animations) {
|
|
1808
|
+
for (let o = 0; o < s.animations.length; o++) {
|
|
1809
|
+
const l = s.animations[o], c = Z("BABYLON.Animation");
|
|
1810
|
+
c && a.animations.push(c.Parse(l));
|
|
1811
|
+
}
|
|
1812
|
+
K.ParseAnimationRanges(a, s, n), s.autoAnimate && n.beginAnimation(a, s.autoAnimateFrom, s.autoAnimateTo, s.autoAnimateLoop, s.autoAnimateSpeed || 1);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
if (e.thinInstances) {
|
|
1816
|
+
const r = e.thinInstances;
|
|
1817
|
+
if (t.thinInstanceEnablePicking = !!r.enablePicking, r.matrixData ? (t.thinInstanceSetBuffer("matrix", new Float32Array(r.matrixData), 16, !1), t._thinInstanceDataStorage.matrixBufferSize = r.matrixBufferSize, t._thinInstanceDataStorage.instancesCount = r.instancesCount) : t._thinInstanceDataStorage.matrixBufferSize = r.matrixBufferSize, e.thinInstances.userThinInstance) {
|
|
1818
|
+
const s = e.thinInstances.userThinInstance;
|
|
1819
|
+
for (const a in s.data)
|
|
1820
|
+
t.thinInstanceSetBuffer(a, new Float32Array(s.data[a]), s.strides[a], !1), t._userThinInstanceBuffersStorage.sizes[a] = s.sizes[a];
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
return t;
|
|
1824
|
+
}
|
|
1825
|
+
// Skeletons
|
|
1826
|
+
/**
|
|
1827
|
+
* Prepare internal position array for software CPU skinning
|
|
1828
|
+
* @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
|
|
1829
|
+
*/
|
|
1830
|
+
setPositionsForCPUSkinning() {
|
|
1831
|
+
const e = this._internalMeshDataInfo;
|
|
1832
|
+
if (!e._sourcePositions) {
|
|
1833
|
+
const n = this.getVerticesData(d.PositionKind);
|
|
1834
|
+
if (!n)
|
|
1835
|
+
return e._sourcePositions;
|
|
1836
|
+
e._sourcePositions = new Float32Array(n), this.isVertexBufferUpdatable(d.PositionKind) || this.setVerticesData(d.PositionKind, n, !0);
|
|
1837
|
+
}
|
|
1838
|
+
return e._sourcePositions;
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Prepare internal normal array for software CPU skinning
|
|
1842
|
+
* @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
|
|
1843
|
+
*/
|
|
1844
|
+
setNormalsForCPUSkinning() {
|
|
1845
|
+
const e = this._internalMeshDataInfo;
|
|
1846
|
+
if (!e._sourceNormals) {
|
|
1847
|
+
const n = this.getVerticesData(d.NormalKind);
|
|
1848
|
+
if (!n)
|
|
1849
|
+
return e._sourceNormals;
|
|
1850
|
+
e._sourceNormals = new Float32Array(n), this.isVertexBufferUpdatable(d.NormalKind) || this.setVerticesData(d.NormalKind, n, !0);
|
|
1851
|
+
}
|
|
1852
|
+
return e._sourceNormals;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Updates the vertex buffer by applying transformation from the bones
|
|
1856
|
+
* @param skeleton defines the skeleton to apply to current mesh
|
|
1857
|
+
* @returns the current mesh
|
|
1858
|
+
*/
|
|
1859
|
+
applySkeleton(e) {
|
|
1860
|
+
if (!this.geometry)
|
|
1861
|
+
return this;
|
|
1862
|
+
if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId())
|
|
1863
|
+
return this;
|
|
1864
|
+
if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(d.PositionKind))
|
|
1865
|
+
return this;
|
|
1866
|
+
if (!this.isVerticesDataPresent(d.MatricesIndicesKind))
|
|
1867
|
+
return this;
|
|
1868
|
+
if (!this.isVerticesDataPresent(d.MatricesWeightsKind))
|
|
1869
|
+
return this;
|
|
1870
|
+
const n = this.isVerticesDataPresent(d.NormalKind), i = this._internalMeshDataInfo;
|
|
1871
|
+
if (!i._sourcePositions) {
|
|
1872
|
+
const y = this.subMeshes.slice();
|
|
1873
|
+
this.setPositionsForCPUSkinning(), this.subMeshes = y;
|
|
1874
|
+
}
|
|
1875
|
+
n && !i._sourceNormals && this.setNormalsForCPUSkinning();
|
|
1876
|
+
let t = this.getVerticesData(d.PositionKind);
|
|
1877
|
+
if (!t)
|
|
1878
|
+
return this;
|
|
1879
|
+
t instanceof Float32Array || (t = new Float32Array(t));
|
|
1880
|
+
let r = this.getVerticesData(d.NormalKind);
|
|
1881
|
+
if (n) {
|
|
1882
|
+
if (!r)
|
|
1883
|
+
return this;
|
|
1884
|
+
r instanceof Float32Array || (r = new Float32Array(r));
|
|
1885
|
+
}
|
|
1886
|
+
const s = this.getVerticesData(d.MatricesIndicesKind), a = this.getVerticesData(d.MatricesWeightsKind);
|
|
1887
|
+
if (!a || !s)
|
|
1888
|
+
return this;
|
|
1889
|
+
const o = this.numBoneInfluencers > 4, l = o ? this.getVerticesData(d.MatricesIndicesExtraKind) : null, c = o ? this.getVerticesData(d.MatricesWeightsExtraKind) : null, u = e.getTransformMatrices(this), _ = w.Zero(), p = new E(), x = new E();
|
|
1890
|
+
let I = 0, f;
|
|
1891
|
+
for (let y = 0; y < t.length; y += 3, I += 4) {
|
|
1892
|
+
let v;
|
|
1893
|
+
for (f = 0; f < 4; f++)
|
|
1894
|
+
v = a[I + f], v > 0 && (E.FromFloat32ArrayToRefScaled(u, Math.floor(s[I + f] * 16), v, x), p.addToSelf(x));
|
|
1895
|
+
if (o)
|
|
1896
|
+
for (f = 0; f < 4; f++)
|
|
1897
|
+
v = c[I + f], v > 0 && (E.FromFloat32ArrayToRefScaled(u, Math.floor(l[I + f] * 16), v, x), p.addToSelf(x));
|
|
1898
|
+
w.TransformCoordinatesFromFloatsToRef(i._sourcePositions[y], i._sourcePositions[y + 1], i._sourcePositions[y + 2], p, _), _.toArray(t, y), n && (w.TransformNormalFromFloatsToRef(i._sourceNormals[y], i._sourceNormals[y + 1], i._sourceNormals[y + 2], p, _), _.toArray(r, y)), p.reset();
|
|
1899
|
+
}
|
|
1900
|
+
return this.updateVerticesData(d.PositionKind, t), n && this.updateVerticesData(d.NormalKind, r), this;
|
|
1901
|
+
}
|
|
1902
|
+
// Tools
|
|
1903
|
+
/**
|
|
1904
|
+
* Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates
|
|
1905
|
+
* @param meshes defines the list of meshes to scan
|
|
1906
|
+
* @returns an object `{min:` Vector3`, max:` Vector3`}`
|
|
1907
|
+
*/
|
|
1908
|
+
static MinMax(e) {
|
|
1909
|
+
let n = null, i = null;
|
|
1910
|
+
return e.forEach(function(t) {
|
|
1911
|
+
const s = t.getBoundingInfo().boundingBox;
|
|
1912
|
+
!n || !i ? (n = s.minimumWorld, i = s.maximumWorld) : (n.minimizeInPlace(s.minimumWorld), i.maximizeInPlace(s.maximumWorld));
|
|
1913
|
+
}), !n || !i ? {
|
|
1914
|
+
min: w.Zero(),
|
|
1915
|
+
max: w.Zero()
|
|
1916
|
+
} : {
|
|
1917
|
+
min: n,
|
|
1918
|
+
max: i
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Returns the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array
|
|
1923
|
+
* @param meshesOrMinMaxVector could be an array of meshes or a `{min:` Vector3`, max:` Vector3`}` object
|
|
1924
|
+
* @returns a vector3
|
|
1925
|
+
*/
|
|
1926
|
+
static Center(e) {
|
|
1927
|
+
const n = e instanceof Array ? D.MinMax(e) : e;
|
|
1928
|
+
return w.Center(n.min, n.max);
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Merge the array of meshes into a single mesh for performance reasons.
|
|
1932
|
+
* @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
|
|
1933
|
+
* @param disposeSource when true (default), dispose of the vertices from the source meshes.
|
|
1934
|
+
* @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
|
|
1935
|
+
* @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
|
|
1936
|
+
* @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
|
|
1937
|
+
* @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
|
|
1938
|
+
* @returns a new mesh
|
|
1939
|
+
*/
|
|
1940
|
+
static MergeMeshes(e, n = !0, i, t, r, s) {
|
|
1941
|
+
return X(D._MergeMeshesCoroutine(e, n, i, t, r, s, !1));
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Merge the array of meshes into a single mesh for performance reasons.
|
|
1945
|
+
* @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
|
|
1946
|
+
* @param disposeSource when true (default), dispose of the vertices from the source meshes.
|
|
1947
|
+
* @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
|
|
1948
|
+
* @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
|
|
1949
|
+
* @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
|
|
1950
|
+
* @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
|
|
1951
|
+
* @returns a new mesh
|
|
1952
|
+
*/
|
|
1953
|
+
static MergeMeshesAsync(e, n = !0, i, t, r, s) {
|
|
1954
|
+
return $(D._MergeMeshesCoroutine(e, n, i, t, r, s, !0), j());
|
|
1955
|
+
}
|
|
1956
|
+
static *_MergeMeshesCoroutine(e, n = !0, i, t, r, s, a) {
|
|
1957
|
+
if (e = e.filter(Boolean), e.length === 0)
|
|
1958
|
+
return null;
|
|
1959
|
+
let o;
|
|
1960
|
+
if (!i) {
|
|
1961
|
+
let g = 0;
|
|
1962
|
+
for (o = 0; o < e.length; o++)
|
|
1963
|
+
if (g += e[o].getTotalVertices(), g >= 65536)
|
|
1964
|
+
return F.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"), null;
|
|
1965
|
+
}
|
|
1966
|
+
s && (r = !1);
|
|
1967
|
+
const l = new Array(), c = new Array(), u = new Array(), _ = e[0].overrideMaterialSideOrientation;
|
|
1968
|
+
for (o = 0; o < e.length; o++) {
|
|
1969
|
+
const g = e[o];
|
|
1970
|
+
if (g.isAnInstance)
|
|
1971
|
+
return F.Warn("Cannot merge instance meshes."), null;
|
|
1972
|
+
if (_ !== g.overrideMaterialSideOrientation)
|
|
1973
|
+
return F.Warn("Cannot merge meshes with different overrideMaterialSideOrientation values."), null;
|
|
1974
|
+
if (r && u.push(g.getTotalIndices()), s)
|
|
1975
|
+
if (g.material) {
|
|
1976
|
+
const B = g.material;
|
|
1977
|
+
if (B instanceof G) {
|
|
1978
|
+
for (let b = 0; b < B.subMaterials.length; b++)
|
|
1979
|
+
l.indexOf(B.subMaterials[b]) < 0 && l.push(B.subMaterials[b]);
|
|
1980
|
+
for (let b = 0; b < g.subMeshes.length; b++)
|
|
1981
|
+
c.push(l.indexOf(B.subMaterials[g.subMeshes[b].materialIndex])), u.push(g.subMeshes[b].indexCount);
|
|
1982
|
+
} else {
|
|
1983
|
+
l.indexOf(B) < 0 && l.push(B);
|
|
1984
|
+
for (let b = 0; b < g.subMeshes.length; b++)
|
|
1985
|
+
c.push(l.indexOf(B)), u.push(g.subMeshes[b].indexCount);
|
|
1986
|
+
}
|
|
1987
|
+
} else
|
|
1988
|
+
for (let B = 0; B < g.subMeshes.length; B++)
|
|
1989
|
+
c.push(0), u.push(g.subMeshes[B].indexCount);
|
|
1990
|
+
}
|
|
1991
|
+
const p = e[0], x = (g) => {
|
|
1992
|
+
const B = g.computeWorldMatrix(!0);
|
|
1993
|
+
return { vertexData: P.ExtractFromMesh(g, !1, !1), transform: B };
|
|
1994
|
+
}, { vertexData: I, transform: f } = x(p);
|
|
1995
|
+
a && (yield);
|
|
1996
|
+
const y = new Array(e.length - 1);
|
|
1997
|
+
for (let g = 1; g < e.length; g++)
|
|
1998
|
+
y[g - 1] = x(e[g]), a && (yield);
|
|
1999
|
+
const v = I._mergeCoroutine(f, y, i, a, !n);
|
|
2000
|
+
let M = v.next();
|
|
2001
|
+
for (; !M.done; )
|
|
2002
|
+
a && (yield), M = v.next();
|
|
2003
|
+
const S = M.value;
|
|
2004
|
+
t || (t = new D(p.name + "_merged", p.getScene()));
|
|
2005
|
+
const m = S._applyToCoroutine(t, void 0, a);
|
|
2006
|
+
let h = m.next();
|
|
2007
|
+
for (; !h.done; )
|
|
2008
|
+
a && (yield), h = m.next();
|
|
2009
|
+
if (t.checkCollisions = p.checkCollisions, t.overrideMaterialSideOrientation = p.overrideMaterialSideOrientation, n)
|
|
2010
|
+
for (o = 0; o < e.length; o++)
|
|
2011
|
+
e[o].dispose();
|
|
2012
|
+
if (r || s) {
|
|
2013
|
+
t.releaseSubMeshes(), o = 0;
|
|
2014
|
+
let g = 0;
|
|
2015
|
+
for (; o < u.length; )
|
|
2016
|
+
k.CreateFromIndices(0, g, u[o], t, void 0, !1), g += u[o], o++;
|
|
2017
|
+
for (const B of t.subMeshes)
|
|
2018
|
+
B.refreshBoundingInfo();
|
|
2019
|
+
t.computeWorldMatrix(!0);
|
|
2020
|
+
}
|
|
2021
|
+
if (s) {
|
|
2022
|
+
const g = new G(p.name + "_merged", p.getScene());
|
|
2023
|
+
g.subMaterials = l;
|
|
2024
|
+
for (let B = 0; B < t.subMeshes.length; B++)
|
|
2025
|
+
t.subMeshes[B].materialIndex = c[B];
|
|
2026
|
+
t.material = g;
|
|
2027
|
+
} else
|
|
2028
|
+
t.material = p.material;
|
|
2029
|
+
return t;
|
|
2030
|
+
}
|
|
2031
|
+
/**
|
|
2032
|
+
* @internal
|
|
2033
|
+
*/
|
|
2034
|
+
addInstance(e) {
|
|
2035
|
+
e._indexInSourceMeshInstanceArray = this.instances.length, this.instances.push(e);
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* @internal
|
|
2039
|
+
*/
|
|
2040
|
+
removeInstance(e) {
|
|
2041
|
+
const n = e._indexInSourceMeshInstanceArray;
|
|
2042
|
+
if (n != -1) {
|
|
2043
|
+
if (n !== this.instances.length - 1) {
|
|
2044
|
+
const i = this.instances[this.instances.length - 1];
|
|
2045
|
+
this.instances[n] = i, i._indexInSourceMeshInstanceArray = n;
|
|
2046
|
+
}
|
|
2047
|
+
e._indexInSourceMeshInstanceArray = -1, this.instances.pop();
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
/** @internal */
|
|
2051
|
+
_shouldConvertRHS() {
|
|
2052
|
+
return this.overrideMaterialSideOrientation === T.CounterClockWiseSideOrientation;
|
|
2053
|
+
}
|
|
2054
|
+
/** @internal */
|
|
2055
|
+
_getRenderingFillMode(e) {
|
|
2056
|
+
var n;
|
|
2057
|
+
const i = this.getScene();
|
|
2058
|
+
return i.forcePointsCloud ? T.PointFillMode : i.forceWireframe ? T.WireFrameFillMode : (n = this.overrideRenderingFillMode) !== null && n !== void 0 ? n : e;
|
|
2059
|
+
}
|
|
2060
|
+
// deprecated methods
|
|
2061
|
+
/**
|
|
2062
|
+
* Sets the mesh material by the material or multiMaterial `id` property
|
|
2063
|
+
* @param id is a string identifying the material or the multiMaterial
|
|
2064
|
+
* @returns the current mesh
|
|
2065
|
+
* @deprecated Please use MeshBuilder instead Please use setMaterialById instead
|
|
2066
|
+
*/
|
|
2067
|
+
setMaterialByID(e) {
|
|
2068
|
+
return this.setMaterialById(e);
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Creates a ribbon mesh.
|
|
2072
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
|
|
2073
|
+
* @param name defines the name of the mesh to create
|
|
2074
|
+
* @param pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
|
|
2075
|
+
* @param closeArray creates a seam between the first and the last paths of the path array (default is false)
|
|
2076
|
+
* @param closePath creates a seam between the first and the last points of each path of the path array
|
|
2077
|
+
* @param offset is taken in account only if the `pathArray` is containing a single path
|
|
2078
|
+
* @param scene defines the hosting scene
|
|
2079
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2080
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2081
|
+
* @param instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)
|
|
2082
|
+
* @returns a new Mesh
|
|
2083
|
+
* @deprecated Please use MeshBuilder instead
|
|
2084
|
+
*/
|
|
2085
|
+
static CreateRibbon(e, n, i, t, r, s, a, o, l) {
|
|
2086
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Creates a plane polygonal mesh. By default, this is a disc.
|
|
2090
|
+
* @param name defines the name of the mesh to create
|
|
2091
|
+
* @param radius sets the radius size (float) of the polygon (default 0.5)
|
|
2092
|
+
* @param tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
|
|
2093
|
+
* @param scene defines the hosting scene
|
|
2094
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2095
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2096
|
+
* @returns a new Mesh
|
|
2097
|
+
* @deprecated Please use MeshBuilder instead
|
|
2098
|
+
*/
|
|
2099
|
+
static CreateDisc(e, n, i, t, r, s) {
|
|
2100
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Creates a box mesh.
|
|
2104
|
+
* @param name defines the name of the mesh to create
|
|
2105
|
+
* @param size sets the size (float) of each box side (default 1)
|
|
2106
|
+
* @param scene defines the hosting scene
|
|
2107
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2108
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2109
|
+
* @returns a new Mesh
|
|
2110
|
+
* @deprecated Please use MeshBuilder instead
|
|
2111
|
+
*/
|
|
2112
|
+
static CreateBox(e, n, i, t, r) {
|
|
2113
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Creates a sphere mesh.
|
|
2117
|
+
* @param name defines the name of the mesh to create
|
|
2118
|
+
* @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
|
|
2119
|
+
* @param diameter sets the diameter size (float) of the sphere (default 1)
|
|
2120
|
+
* @param scene defines the hosting scene
|
|
2121
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2122
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2123
|
+
* @returns a new Mesh
|
|
2124
|
+
* @deprecated Please use MeshBuilder instead
|
|
2125
|
+
*/
|
|
2126
|
+
static CreateSphere(e, n, i, t, r, s) {
|
|
2127
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Creates a hemisphere mesh.
|
|
2131
|
+
* @param name defines the name of the mesh to create
|
|
2132
|
+
* @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
|
|
2133
|
+
* @param diameter sets the diameter size (float) of the sphere (default 1)
|
|
2134
|
+
* @param scene defines the hosting scene
|
|
2135
|
+
* @returns a new Mesh
|
|
2136
|
+
* @deprecated Please use MeshBuilder instead
|
|
2137
|
+
*/
|
|
2138
|
+
static CreateHemisphere(e, n, i, t) {
|
|
2139
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Creates a cylinder or a cone mesh.
|
|
2143
|
+
* @param name defines the name of the mesh to create
|
|
2144
|
+
* @param height sets the height size (float) of the cylinder/cone (float, default 2)
|
|
2145
|
+
* @param diameterTop set the top cap diameter (floats, default 1)
|
|
2146
|
+
* @param diameterBottom set the bottom cap diameter (floats, default 1). This value can't be zero
|
|
2147
|
+
* @param tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
|
|
2148
|
+
* @param subdivisions sets the number of rings along the cylinder height (positive integer, default 1)
|
|
2149
|
+
* @param scene defines the hosting scene
|
|
2150
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2151
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2152
|
+
* @returns a new Mesh
|
|
2153
|
+
* @deprecated Please use MeshBuilder instead
|
|
2154
|
+
*/
|
|
2155
|
+
static CreateCylinder(e, n, i, t, r, s, a, o, l) {
|
|
2156
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2157
|
+
}
|
|
2158
|
+
// Torus (Code from SharpDX.org)
|
|
2159
|
+
/**
|
|
2160
|
+
* Creates a torus mesh.
|
|
2161
|
+
* @param name defines the name of the mesh to create
|
|
2162
|
+
* @param diameter sets the diameter size (float) of the torus (default 1)
|
|
2163
|
+
* @param thickness sets the diameter size of the tube of the torus (float, default 0.5)
|
|
2164
|
+
* @param tessellation sets the number of torus sides (positive integer, default 16)
|
|
2165
|
+
* @param scene defines the hosting scene
|
|
2166
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2167
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2168
|
+
* @returns a new Mesh
|
|
2169
|
+
* @deprecated Please use MeshBuilder instead
|
|
2170
|
+
*/
|
|
2171
|
+
static CreateTorus(e, n, i, t, r, s, a) {
|
|
2172
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Creates a torus knot mesh.
|
|
2176
|
+
* @param name defines the name of the mesh to create
|
|
2177
|
+
* @param radius sets the global radius size (float) of the torus knot (default 2)
|
|
2178
|
+
* @param tube sets the diameter size of the tube of the torus (float, default 0.5)
|
|
2179
|
+
* @param radialSegments sets the number of sides on each tube segments (positive integer, default 32)
|
|
2180
|
+
* @param tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32)
|
|
2181
|
+
* @param p the number of windings on X axis (positive integers, default 2)
|
|
2182
|
+
* @param q the number of windings on Y axis (positive integers, default 3)
|
|
2183
|
+
* @param scene defines the hosting scene
|
|
2184
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2185
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2186
|
+
* @returns a new Mesh
|
|
2187
|
+
* @deprecated Please use MeshBuilder instead
|
|
2188
|
+
*/
|
|
2189
|
+
static CreateTorusKnot(e, n, i, t, r, s, a, o, l, c) {
|
|
2190
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Creates a line mesh..
|
|
2194
|
+
* @param name defines the name of the mesh to create
|
|
2195
|
+
* @param points is an array successive Vector3
|
|
2196
|
+
* @param scene defines the hosting scene
|
|
2197
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2198
|
+
* @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines).
|
|
2199
|
+
* @returns a new Mesh
|
|
2200
|
+
* @deprecated Please use MeshBuilder instead
|
|
2201
|
+
*/
|
|
2202
|
+
static CreateLines(e, n, i, t, r) {
|
|
2203
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* Creates a dashed line mesh.
|
|
2207
|
+
* @param name defines the name of the mesh to create
|
|
2208
|
+
* @param points is an array successive Vector3
|
|
2209
|
+
* @param dashSize is the size of the dashes relatively the dash number (positive float, default 3)
|
|
2210
|
+
* @param gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
|
|
2211
|
+
* @param dashNb is the intended total number of dashes (positive integer, default 200)
|
|
2212
|
+
* @param scene defines the hosting scene
|
|
2213
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2214
|
+
* @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)
|
|
2215
|
+
* @returns a new Mesh
|
|
2216
|
+
* @deprecated Please use MeshBuilder instead
|
|
2217
|
+
*/
|
|
2218
|
+
static CreateDashedLines(e, n, i, t, r, s, a, o) {
|
|
2219
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2220
|
+
}
|
|
2221
|
+
/**
|
|
2222
|
+
* Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead
|
|
2223
|
+
* The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
|
|
2224
|
+
* The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
|
|
2225
|
+
* You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
|
|
2226
|
+
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
2227
|
+
* Remember you can only change the shape positions, not their number when updating a polygon.
|
|
2228
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon
|
|
2229
|
+
* @param name defines the name of the mesh to create
|
|
2230
|
+
* @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
|
|
2231
|
+
* @param scene defines the hosting scene
|
|
2232
|
+
* @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
|
|
2233
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2234
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2235
|
+
* @param earcutInjection can be used to inject your own earcut reference
|
|
2236
|
+
* @returns a new Mesh
|
|
2237
|
+
* @deprecated Please use MeshBuilder instead
|
|
2238
|
+
*/
|
|
2239
|
+
static CreatePolygon(e, n, i, t, r, s, a) {
|
|
2240
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* Creates an extruded polygon mesh, with depth in the Y direction..
|
|
2244
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-non-regular-polygon
|
|
2245
|
+
* @param name defines the name of the mesh to create
|
|
2246
|
+
* @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
|
|
2247
|
+
* @param depth defines the height of extrusion
|
|
2248
|
+
* @param scene defines the hosting scene
|
|
2249
|
+
* @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
|
|
2250
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2251
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2252
|
+
* @param earcutInjection can be used to inject your own earcut reference
|
|
2253
|
+
* @returns a new Mesh
|
|
2254
|
+
* @deprecated Please use MeshBuilder instead
|
|
2255
|
+
*/
|
|
2256
|
+
static ExtrudePolygon(e, n, i, t, r, s, a, o) {
|
|
2257
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Creates an extruded shape mesh.
|
|
2261
|
+
* The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
|
|
2262
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
|
|
2263
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
|
|
2264
|
+
* @param name defines the name of the mesh to create
|
|
2265
|
+
* @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
|
|
2266
|
+
* @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
|
|
2267
|
+
* @param scale is the value to scale the shape
|
|
2268
|
+
* @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
|
|
2269
|
+
* @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
|
|
2270
|
+
* @param scene defines the hosting scene
|
|
2271
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2272
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2273
|
+
* @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)
|
|
2274
|
+
* @returns a new Mesh
|
|
2275
|
+
* @deprecated Please use MeshBuilder instead
|
|
2276
|
+
*/
|
|
2277
|
+
static ExtrudeShape(e, n, i, t, r, s, a, o, l, c) {
|
|
2278
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* Creates an custom extruded shape mesh.
|
|
2282
|
+
* The custom extrusion is a parametric shape.
|
|
2283
|
+
* It has no predefined shape. Its final shape will depend on the input parameters.
|
|
2284
|
+
*
|
|
2285
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
|
|
2286
|
+
* @param name defines the name of the mesh to create
|
|
2287
|
+
* @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
|
|
2288
|
+
* @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
|
|
2289
|
+
* @param scaleFunction is a custom Javascript function called on each path point
|
|
2290
|
+
* @param rotationFunction is a custom Javascript function called on each path point
|
|
2291
|
+
* @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray`
|
|
2292
|
+
* @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray`
|
|
2293
|
+
* @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
|
|
2294
|
+
* @param scene defines the hosting scene
|
|
2295
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2296
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2297
|
+
* @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)
|
|
2298
|
+
* @returns a new Mesh
|
|
2299
|
+
* @deprecated Please use MeshBuilder instead
|
|
2300
|
+
*/
|
|
2301
|
+
static ExtrudeShapeCustom(e, n, i, t, r, s, a, o, l, c, u, _) {
|
|
2302
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2303
|
+
}
|
|
2304
|
+
/**
|
|
2305
|
+
* Creates lathe mesh.
|
|
2306
|
+
* The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.
|
|
2307
|
+
* @param name defines the name of the mesh to create
|
|
2308
|
+
* @param shape is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
|
|
2309
|
+
* @param radius is the radius value of the lathe
|
|
2310
|
+
* @param tessellation is the side number of the lathe.
|
|
2311
|
+
* @param scene defines the hosting scene
|
|
2312
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2313
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2314
|
+
* @returns a new Mesh
|
|
2315
|
+
* @deprecated Please use MeshBuilder instead
|
|
2316
|
+
*/
|
|
2317
|
+
static CreateLathe(e, n, i, t, r, s, a) {
|
|
2318
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2319
|
+
}
|
|
2320
|
+
/**
|
|
2321
|
+
* Creates a plane mesh.
|
|
2322
|
+
* @param name defines the name of the mesh to create
|
|
2323
|
+
* @param size sets the size (float) of both sides of the plane at once (default 1)
|
|
2324
|
+
* @param scene defines the hosting scene
|
|
2325
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2326
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2327
|
+
* @returns a new Mesh
|
|
2328
|
+
* @deprecated Please use MeshBuilder instead
|
|
2329
|
+
*/
|
|
2330
|
+
static CreatePlane(e, n, i, t, r) {
|
|
2331
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2332
|
+
}
|
|
2333
|
+
/**
|
|
2334
|
+
* Creates a ground mesh.
|
|
2335
|
+
* @param name defines the name of the mesh to create
|
|
2336
|
+
* @param width set the width of the ground
|
|
2337
|
+
* @param height set the height of the ground
|
|
2338
|
+
* @param subdivisions sets the number of subdivisions per side
|
|
2339
|
+
* @param scene defines the hosting scene
|
|
2340
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2341
|
+
* @returns a new Mesh
|
|
2342
|
+
* @deprecated Please use MeshBuilder instead
|
|
2343
|
+
*/
|
|
2344
|
+
static CreateGround(e, n, i, t, r, s) {
|
|
2345
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* Creates a tiled ground mesh.
|
|
2349
|
+
* @param name defines the name of the mesh to create
|
|
2350
|
+
* @param xmin set the ground minimum X coordinate
|
|
2351
|
+
* @param zmin set the ground minimum Y coordinate
|
|
2352
|
+
* @param xmax set the ground maximum X coordinate
|
|
2353
|
+
* @param zmax set the ground maximum Z coordinate
|
|
2354
|
+
* @param subdivisions is an object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
|
|
2355
|
+
* @param precision is an object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
|
|
2356
|
+
* @param scene defines the hosting scene
|
|
2357
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2358
|
+
* @returns a new Mesh
|
|
2359
|
+
* @deprecated Please use MeshBuilder instead
|
|
2360
|
+
*/
|
|
2361
|
+
static CreateTiledGround(e, n, i, t, r, s, a, o, l) {
|
|
2362
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Creates a ground mesh from a height map.
|
|
2366
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
|
|
2367
|
+
* @param name defines the name of the mesh to create
|
|
2368
|
+
* @param url sets the URL of the height map image resource
|
|
2369
|
+
* @param width set the ground width size
|
|
2370
|
+
* @param height set the ground height size
|
|
2371
|
+
* @param subdivisions sets the number of subdivision per side
|
|
2372
|
+
* @param minHeight is the minimum altitude on the ground
|
|
2373
|
+
* @param maxHeight is the maximum altitude on the ground
|
|
2374
|
+
* @param scene defines the hosting scene
|
|
2375
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2376
|
+
* @param onReady is a callback function that will be called once the mesh is built (the height map download can last some time)
|
|
2377
|
+
* @param alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
|
|
2378
|
+
* @returns a new Mesh
|
|
2379
|
+
* @deprecated Please use MeshBuilder instead
|
|
2380
|
+
*/
|
|
2381
|
+
static CreateGroundFromHeightMap(e, n, i, t, r, s, a, o, l, c, u) {
|
|
2382
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2383
|
+
}
|
|
2384
|
+
/**
|
|
2385
|
+
* Creates a tube mesh.
|
|
2386
|
+
* The tube is a parametric shape.
|
|
2387
|
+
* It has no predefined shape. Its final shape will depend on the input parameters.
|
|
2388
|
+
*
|
|
2389
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
|
|
2390
|
+
* @param name defines the name of the mesh to create
|
|
2391
|
+
* @param path is a required array of successive Vector3. It is the curve used as the axis of the tube
|
|
2392
|
+
* @param radius sets the tube radius size
|
|
2393
|
+
* @param tessellation is the number of sides on the tubular surface
|
|
2394
|
+
* @param radiusFunction is a custom function. If it is not null, it overrides the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path
|
|
2395
|
+
* @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
|
|
2396
|
+
* @param scene defines the hosting scene
|
|
2397
|
+
* @param updatable defines if the mesh must be flagged as updatable
|
|
2398
|
+
* @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
|
|
2399
|
+
* @param instance is an instance of an existing Tube object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)
|
|
2400
|
+
* @returns a new Mesh
|
|
2401
|
+
* @deprecated Please use MeshBuilder instead
|
|
2402
|
+
*/
|
|
2403
|
+
static CreateTube(e, n, i, t, r, s, a, o, l, c) {
|
|
2404
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2405
|
+
}
|
|
2406
|
+
/**
|
|
2407
|
+
* Creates a polyhedron mesh.
|
|
2408
|
+
*.
|
|
2409
|
+
* * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded types. Please refer to the type sheet in the tutorial to choose the wanted type
|
|
2410
|
+
* * The parameter `size` (positive float, default 1) sets the polygon size
|
|
2411
|
+
* * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
|
|
2412
|
+
* * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
|
|
2413
|
+
* * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
|
|
2414
|
+
* * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
|
|
2415
|
+
* * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
|
|
2416
|
+
* * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
2417
|
+
* * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
|
|
2418
|
+
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
|
|
2419
|
+
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
2420
|
+
* @param name defines the name of the mesh to create
|
|
2421
|
+
* @param options defines the options used to create the mesh
|
|
2422
|
+
* @param scene defines the hosting scene
|
|
2423
|
+
* @returns a new Mesh
|
|
2424
|
+
* @deprecated Please use MeshBuilder instead
|
|
2425
|
+
*/
|
|
2426
|
+
static CreatePolyhedron(e, n, i) {
|
|
2427
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
|
|
2431
|
+
* * The parameter `radius` sets the radius size (float) of the icosphere (default 1)
|
|
2432
|
+
* * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`)
|
|
2433
|
+
* * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
|
|
2434
|
+
* * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
|
|
2435
|
+
* * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
|
|
2436
|
+
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
|
|
2437
|
+
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
2438
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
|
|
2439
|
+
* @param name defines the name of the mesh
|
|
2440
|
+
* @param options defines the options used to create the mesh
|
|
2441
|
+
* @param scene defines the hosting scene
|
|
2442
|
+
* @returns a new Mesh
|
|
2443
|
+
* @deprecated Please use MeshBuilder instead
|
|
2444
|
+
*/
|
|
2445
|
+
static CreateIcoSphere(e, n, i) {
|
|
2446
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2447
|
+
}
|
|
2448
|
+
/**
|
|
2449
|
+
* Creates a decal mesh.
|
|
2450
|
+
*.
|
|
2451
|
+
* A decal is a mesh usually applied as a model onto the surface of another mesh
|
|
2452
|
+
* @param name defines the name of the mesh
|
|
2453
|
+
* @param sourceMesh defines the mesh receiving the decal
|
|
2454
|
+
* @param position sets the position of the decal in world coordinates
|
|
2455
|
+
* @param normal sets the normal of the mesh where the decal is applied onto in world coordinates
|
|
2456
|
+
* @param size sets the decal scaling
|
|
2457
|
+
* @param angle sets the angle to rotate the decal
|
|
2458
|
+
* @returns a new Mesh
|
|
2459
|
+
* @deprecated Please use MeshBuilder instead
|
|
2460
|
+
*/
|
|
2461
|
+
static CreateDecal(e, n, i, t, r, s) {
|
|
2462
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2463
|
+
}
|
|
2464
|
+
/** Creates a Capsule Mesh
|
|
2465
|
+
* @param name defines the name of the mesh.
|
|
2466
|
+
* @param options the constructors options used to shape the mesh.
|
|
2467
|
+
* @param scene defines the scene the mesh is scoped to.
|
|
2468
|
+
* @returns the capsule mesh
|
|
2469
|
+
* @see https://doc.babylonjs.com/how_to/capsule_shape
|
|
2470
|
+
* @deprecated Please use MeshBuilder instead
|
|
2471
|
+
*/
|
|
2472
|
+
static CreateCapsule(e, n, i) {
|
|
2473
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* Extends a mesh to a Goldberg mesh
|
|
2477
|
+
* Warning the mesh to convert MUST be an import of a perviously exported Goldberg mesh
|
|
2478
|
+
* @param mesh the mesh to convert
|
|
2479
|
+
* @returns the extended mesh
|
|
2480
|
+
* @deprecated Please use ExtendMeshToGoldberg instead
|
|
2481
|
+
*/
|
|
2482
|
+
static ExtendToGoldberg(e) {
|
|
2483
|
+
throw new Error("Import MeshBuilder to populate this function");
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
D.FRONTSIDE = P.FRONTSIDE;
|
|
2487
|
+
D.BACKSIDE = P.BACKSIDE;
|
|
2488
|
+
D.DOUBLESIDE = P.DOUBLESIDE;
|
|
2489
|
+
D.DEFAULTSIDE = P.DEFAULTSIDE;
|
|
2490
|
+
D.NO_CAP = 0;
|
|
2491
|
+
D.CAP_START = 1;
|
|
2492
|
+
D.CAP_END = 2;
|
|
2493
|
+
D.CAP_ALL = 3;
|
|
2494
|
+
D.NO_FLIP = 0;
|
|
2495
|
+
D.FLIP_TILE = 1;
|
|
2496
|
+
D.ROTATE_TILE = 2;
|
|
2497
|
+
D.FLIP_ROW = 3;
|
|
2498
|
+
D.ROTATE_ROW = 4;
|
|
2499
|
+
D.FLIP_N_ROTATE_TILE = 5;
|
|
2500
|
+
D.FLIP_N_ROTATE_ROW = 6;
|
|
2501
|
+
D.CENTER = 0;
|
|
2502
|
+
D.LEFT = 1;
|
|
2503
|
+
D.RIGHT = 2;
|
|
2504
|
+
D.TOP = 3;
|
|
2505
|
+
D.BOTTOM = 4;
|
|
2506
|
+
D.INSTANCEDMESH_SORT_TRANSPARENT = !1;
|
|
2507
|
+
D._GroundMeshParser = (O, e) => {
|
|
2508
|
+
throw R("GroundMesh");
|
|
2509
|
+
};
|
|
2510
|
+
D._GoldbergMeshParser = (O, e) => {
|
|
2511
|
+
throw R("GoldbergMesh");
|
|
2512
|
+
};
|
|
2513
|
+
D._LinesMeshParser = (O, e) => {
|
|
2514
|
+
throw R("LinesMesh");
|
|
2515
|
+
};
|
|
2516
|
+
D._GreasedLineMeshParser = (O, e) => {
|
|
2517
|
+
throw R("GreasedLineMesh");
|
|
2518
|
+
};
|
|
2519
|
+
D._TrailMeshParser = (O, e) => {
|
|
2520
|
+
throw R("TrailMesh");
|
|
2521
|
+
};
|
|
2522
|
+
re("BABYLON.Mesh", D);
|
|
2523
|
+
export {
|
|
2524
|
+
D as Mesh,
|
|
2525
|
+
Q as _InstancesBatch
|
|
2526
|
+
};
|