@babylonjs/core 6.8.0 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/action.d.ts +4 -5
- package/Actions/action.js.map +1 -1
- package/Actions/condition.d.ts +1 -2
- package/Actions/condition.js.map +1 -1
- package/Actions/directActions.d.ts +1 -2
- package/Actions/directActions.js.map +1 -1
- package/Animations/animatable.interface.d.ts +1 -2
- package/Animations/animatable.interface.js.map +1 -1
- package/Animations/animation.d.ts +3 -4
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +5 -0
- package/Animations/animationGroup.js +12 -0
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/easing.js.map +1 -1
- package/Animations/runtimeAnimation.d.ts +1 -2
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/bone.d.ts +3 -3
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js.map +1 -1
- package/Buffers/dataBuffer.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +6 -7
- package/Cameras/camera.js.map +1 -1
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Collisions/collider.js.map +1 -1
- package/Collisions/meshCollisionData.d.ts +1 -2
- package/Collisions/meshCollisionData.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +1 -2
- package/Collisions/pickingInfo.js.map +1 -1
- package/Compute/computeEffect.d.ts +1 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +1 -5
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Octrees/octree.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.d.ts +1 -2
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.d.ts +1 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/boundingInfo.d.ts +1 -2
- package/Culling/boundingInfo.js.map +1 -1
- package/Culling/boundingSphere.js.map +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.js +1 -9
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/skeletonViewer.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +1 -6
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +1 -6
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +1 -9
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/Extensions/engine.webVR.js +1 -5
- package/Engines/Extensions/engine.webVR.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js +3 -0
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +1 -2
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/Processors/shaderProcessor.d.ts +5 -6
- package/Engines/Processors/shaderProcessor.js +10 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.d.ts +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +1 -7
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +1 -8
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +1 -10
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +1 -6
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +1 -2
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +1 -4
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.d.ts +3 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/engineStore.d.ts +4 -5
- package/Engines/engineStore.js.map +1 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -9
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.js +3 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -2
- package/Engines/webgpuEngine.js +3 -14
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/pointerEvents.d.ts +1 -2
- package/Events/pointerEvents.js.map +1 -1
- package/Gamepads/Controllers/gearVRController.js.map +1 -1
- package/Gamepads/Controllers/oculusTouchController.js.map +1 -1
- package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gamepads/gamepad.js.map +1 -1
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +2 -8
- package/Helpers/environmentHelper.js.map +1 -1
- package/Helpers/textureDome.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -2
- package/Inputs/scene.inputManager.js +4 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +1 -8
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.js +1 -12
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +1 -11
- package/Layers/highlightLayer.js.map +1 -1
- package/Legacy/legacy.js +1 -1
- package/Legacy/legacy.js.map +1 -1
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +1 -4
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.js.map +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Loading/loadingScreen.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +2 -3
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +3 -4
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +2 -0
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.d.ts +1 -0
- package/Materials/Node/Blocks/customBlock.js +18 -2
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +2 -0
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +2 -0
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +2 -0
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +2 -8
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialDecorator.d.ts +2 -3
- package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -5
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +2 -1
- package/Materials/PBR/pbrMaterial.js +6 -13
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +2 -3
- package/Materials/Textures/htmlElementTexture.js +1 -4
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +3 -4
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +1 -2
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +1 -2
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +9 -22
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/drawWrapper.d.ts +3 -4
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +5 -6
- package/Materials/effect.js.map +1 -1
- package/Materials/effectFallbacks.d.ts +2 -3
- package/Materials/effectFallbacks.js.map +1 -1
- package/Materials/greasedLinePluginMaterial.d.ts +307 -0
- package/Materials/greasedLinePluginMaterial.js +553 -0
- package/Materials/greasedLinePluginMaterial.js.map +1 -0
- package/Materials/iEffectFallbacks.d.ts +1 -2
- package/Materials/iEffectFallbacks.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +2 -3
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.d.ts +6 -4
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.detailMapConfiguration.d.ts +4 -5
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +40 -5
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +13 -14
- package/Materials/materialPluginBase.js +2 -2
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +8 -9
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginFactoryExport.d.ts +1 -2
- package/Materials/materialPluginFactoryExport.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +6 -6
- package/Materials/materialPluginManager.js +3 -1
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/materialStencilState.d.ts +1 -2
- package/Materials/materialStencilState.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +4 -5
- package/Materials/shaderMaterial.js +6 -19
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -1
- package/Materials/standardMaterial.js +4 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.d.ts +2 -1
- package/Maths/math.vector.js +3 -2
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +4 -4
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +105 -0
- package/Meshes/Builders/greasedLineBuilder.js +330 -0
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -0
- package/Meshes/Builders/index.d.ts +1 -0
- package/Meshes/Builders/index.js +1 -0
- package/Meshes/Builders/index.js.map +1 -1
- package/Meshes/Builders/linesBuilder.d.ts +1 -2
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.d.ts +34 -0
- package/Meshes/Builders/textBuilder.js +10 -2
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +6 -6
- package/Meshes/abstractMesh.js +3 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +1 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/greasedLineMesh.d.ts +189 -0
- package/Meshes/greasedLineMesh.js +437 -0
- package/Meshes/greasedLineMesh.js.map +1 -0
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.d.ts +10 -6
- package/Meshes/mesh.js +20 -10
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +2 -3
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.js +1 -8
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Meshes/subMesh.d.ts +7 -8
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/basis.js.map +1 -1
- package/Misc/copyTools.d.ts +1 -2
- package/Misc/copyTools.js.map +1 -1
- package/Misc/decorators.d.ts +5 -6
- package/Misc/decorators.js.map +1 -1
- package/Misc/deepCopier.js +7 -1
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/dumpTools.d.ts +4 -3
- package/Misc/dumpTools.js +5 -4
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/environmentTextureTools.js +1 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.js +10 -10
- package/Misc/fileTools.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +153 -0
- package/Misc/greasedLineTools.js +299 -0
- package/Misc/greasedLineTools.js.map +1 -0
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/khronosTextureContainer.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +3 -4
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.d.ts +16 -7
- package/Misc/screenshotTools.js +23 -13
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/smartArray.js.map +1 -1
- package/Misc/tools.d.ts +21 -9
- package/Misc/tools.js +21 -9
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.js +1 -4
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/virtualJoystick.js +1 -4
- package/Misc/virtualJoystick.js.map +1 -1
- package/Misc/webRequest.js.map +1 -1
- package/Morph/morphTarget.d.ts +2 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/Offline/database.js.map +1 -1
- package/Particles/EmitterTypes/IParticleEmitterType.d.ts +1 -2
- package/Particles/EmitterTypes/IParticleEmitterType.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +2 -3
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -2
- package/Particles/gpuParticleSystem.js +2 -6
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -2
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemSet.js.map +1 -1
- package/Particles/subEmitter.d.ts +2 -3
- package/Particles/subEmitter.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/physicsHelper.js +4 -4
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/physicsRaycastResult.d.ts +3 -1
- package/Physics/physicsRaycastResult.js +10 -1
- package/Physics/physicsRaycastResult.js.map +1 -1
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +10 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +3 -2
- package/Physics/v2/Plugins/havokPlugin.js +9 -6
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -2
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +1 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +1 -2
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.d.ts +1 -2
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.d.ts +1 -2
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.d.ts +1 -2
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.d.ts +1 -2
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.d.ts +1 -2
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.d.ts +1 -2
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.d.ts +2 -3
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +1 -2
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +6 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +1 -2
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/refractionPostProcess.d.ts +1 -2
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.d.ts +2 -3
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -2
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +1 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthRenderer.d.ts +2 -3
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.d.ts +5 -6
- package/Rendering/renderingManager.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +4 -2
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +3 -1
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Sprites/sprite.d.ts +1 -2
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spriteManager.d.ts +1 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +2 -3
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRBackgroundRemover.js.map +1 -1
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +4 -13
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDOMOverlay.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXREyeTracking.js.map +1 -1
- package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +2 -8
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRHitTest.js.map +1 -1
- package/XR/features/WebXRHitTestLegacy.js.map +1 -1
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLayers.js +2 -2
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +1 -4
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRGenericMotionController.js.map +1 -1
- package/XR/motionController/webXRHTCViveMotionController.js.map +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
- package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRDefaultExperience.js +6 -28
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +1 -0
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +1 -4
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInput.js +1 -6
- package/XR/webXRInput.js.map +1 -1
- package/abstractScene.d.ts +3 -3
- package/abstractScene.js.map +1 -1
- package/assetContainer.js +1 -4
- package/assetContainer.js.map +1 -1
- package/node.d.ts +6 -7
- package/node.js.map +1 -1
- package/package.json +2 -4
- package/scene.d.ts +49 -50
- package/scene.js +4 -10
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +6 -7
- package/sceneComponent.js.map +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { Scene } from "../scene";
|
|
2
|
+
import type { Matrix } from "../Maths/math.vector";
|
|
3
|
+
import { Vector3 } from "../Maths/math.vector";
|
|
4
|
+
import { GreasedLinePluginMaterial } from "../Materials/greasedLinePluginMaterial";
|
|
5
|
+
import { Mesh } from "./mesh";
|
|
6
|
+
import type { Ray, TrianglePickingPredicate } from "../Culling/ray";
|
|
7
|
+
import { PickingInfo } from "../Collisions/pickingInfo";
|
|
8
|
+
import type { Nullable } from "../types";
|
|
9
|
+
import type { Node } from "../node";
|
|
10
|
+
export type GreasedLinePoints = Vector3[] | Vector3[][] | Float32Array | Float32Array[] | number[][] | number[];
|
|
11
|
+
/**
|
|
12
|
+
* Options for creating a GreasedLineMesh
|
|
13
|
+
*/
|
|
14
|
+
export interface GreasedLineMeshOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Points of the line.
|
|
17
|
+
*/
|
|
18
|
+
points: GreasedLinePoints;
|
|
19
|
+
/**
|
|
20
|
+
* Each line segmment (from point to point) can have it's width multiplier. Final width = widths[segmentIdx] * width.
|
|
21
|
+
* Defaults to empty array.
|
|
22
|
+
*/
|
|
23
|
+
widths?: number[];
|
|
24
|
+
/**
|
|
25
|
+
* If instance is specified, lines are added to the specified instance.
|
|
26
|
+
* Defaults to undefined.
|
|
27
|
+
*/
|
|
28
|
+
instance?: GreasedLineMesh;
|
|
29
|
+
/**
|
|
30
|
+
* You can manually set the color pointers so you can control which segment/part
|
|
31
|
+
* will use which color from the colors material option
|
|
32
|
+
*/
|
|
33
|
+
colorPointers?: number[];
|
|
34
|
+
/**
|
|
35
|
+
* UVs for the mesh
|
|
36
|
+
*/
|
|
37
|
+
uvs?: number[];
|
|
38
|
+
/**
|
|
39
|
+
* If true, offsets and widths are updatable.
|
|
40
|
+
* Defaults to false.
|
|
41
|
+
*/
|
|
42
|
+
updatable?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Use when @see instance is specified.
|
|
45
|
+
* If true, the line will be rendered only after calling instance.updateLazy(). If false, line will be rerendered after every call to @see CreateGreasedLine
|
|
46
|
+
* Defaults to false.
|
|
47
|
+
*/
|
|
48
|
+
lazy?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* GreasedLine
|
|
52
|
+
*/
|
|
53
|
+
export declare class GreasedLineMesh extends Mesh {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
private _options;
|
|
56
|
+
private _vertexPositions;
|
|
57
|
+
private _offsets?;
|
|
58
|
+
private _colorPointers;
|
|
59
|
+
private _previousAndSide;
|
|
60
|
+
private _nextAndCounters;
|
|
61
|
+
private _indices;
|
|
62
|
+
private _uvs;
|
|
63
|
+
private _points;
|
|
64
|
+
private _offsetsBuffer?;
|
|
65
|
+
private _widthsBuffer?;
|
|
66
|
+
private _colorPointersBuffer?;
|
|
67
|
+
private _lazy;
|
|
68
|
+
private _updatable;
|
|
69
|
+
private static _V_START;
|
|
70
|
+
private static _V_END;
|
|
71
|
+
private static _V_OFFSET_START;
|
|
72
|
+
private static _V_OFFSET_END;
|
|
73
|
+
/**
|
|
74
|
+
* Treshold used to pick the mesh
|
|
75
|
+
*/
|
|
76
|
+
intersectionThreshold: number;
|
|
77
|
+
constructor(name: string, scene: Scene, _options: GreasedLineMeshOptions);
|
|
78
|
+
/**
|
|
79
|
+
* "GreasedLineMesh"
|
|
80
|
+
* @returns "GreasedLineMesh"
|
|
81
|
+
*/
|
|
82
|
+
getClassName(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Converts GreasedLinePoints to number[][]
|
|
85
|
+
* @param points GreasedLinePoints
|
|
86
|
+
* @returns number[][] with x, y, z coordinates of the points, like [[x, y, z, x, y, z, ...], [x, y, z, ...]]
|
|
87
|
+
*/
|
|
88
|
+
static ConvertPoints(points: GreasedLinePoints): number[][];
|
|
89
|
+
/**
|
|
90
|
+
* Updated a lazy line. Rerenders the line and updates boundinfo as well.
|
|
91
|
+
*/
|
|
92
|
+
updateLazy(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Dispose the line and it's resources
|
|
95
|
+
*/
|
|
96
|
+
dispose(): void;
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @returns true if the mesh was created in lazy mode
|
|
100
|
+
*/
|
|
101
|
+
isLazy(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @returns options of the line
|
|
105
|
+
*/
|
|
106
|
+
get options(): GreasedLineMeshOptions;
|
|
107
|
+
/**
|
|
108
|
+
* Sets point offets
|
|
109
|
+
* @param offsets offset table [x,y,z, x,y,z, ....]
|
|
110
|
+
*/
|
|
111
|
+
setOffsets(offsets: number[]): void;
|
|
112
|
+
/**
|
|
113
|
+
* Sets widths at each line point
|
|
114
|
+
* @param widths width table [widthUpper,widthLower, widthUpper,widthLower, ...]
|
|
115
|
+
*/
|
|
116
|
+
setSegmentWidths(widths: number[]): void;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the color pointer
|
|
119
|
+
* @param colorPointers arra of color pointer in the colors array. One pointer for every vertex is needed.
|
|
120
|
+
*/
|
|
121
|
+
setColorPointers(colorPointers: number[]): void;
|
|
122
|
+
/**
|
|
123
|
+
* Gets the pluginMaterial associated with line
|
|
124
|
+
*/
|
|
125
|
+
get greasedLineMaterial(): GreasedLinePluginMaterial;
|
|
126
|
+
/**
|
|
127
|
+
* Adds new points to the line. It doesn't rerenders the line if in lazy mode.
|
|
128
|
+
* @param points points table
|
|
129
|
+
*/
|
|
130
|
+
addPoints(points: number[][]): void;
|
|
131
|
+
private _updateColorPointers;
|
|
132
|
+
/**
|
|
133
|
+
* Sets line points and rerenders the line.
|
|
134
|
+
* @param points points table
|
|
135
|
+
*/
|
|
136
|
+
setPoints(points: number[][]): void;
|
|
137
|
+
/**
|
|
138
|
+
* Clones the GreasedLineMesh.
|
|
139
|
+
* @param name new line name
|
|
140
|
+
* @param newParent new parent node
|
|
141
|
+
* @returns cloned line
|
|
142
|
+
*/
|
|
143
|
+
clone(name?: string, newParent?: Nullable<Node>): GreasedLineMesh;
|
|
144
|
+
/**
|
|
145
|
+
* Serializes this GreasedLineMesh
|
|
146
|
+
* @param serializationObject object to write serialization to
|
|
147
|
+
*/
|
|
148
|
+
serialize(serializationObject: any): void;
|
|
149
|
+
/**
|
|
150
|
+
* Parses a serialized GreasedLineMesh
|
|
151
|
+
* @param parsedMesh the serialized GreasedLineMesh
|
|
152
|
+
* @param scene the scene to create the GreasedLineMesh in
|
|
153
|
+
* @returns the created GreasedLineMesh
|
|
154
|
+
*/
|
|
155
|
+
static Parse(parsedMesh: any, scene: Scene): Mesh;
|
|
156
|
+
/**
|
|
157
|
+
* Checks whether a ray is intersecting this GreasedLineMesh
|
|
158
|
+
* @param ray ray to check the intersection of this mesh with
|
|
159
|
+
* @param fastCheck not supported
|
|
160
|
+
* @param trianglePredicate not supported
|
|
161
|
+
* @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
|
|
162
|
+
* @param worldToUse not supported
|
|
163
|
+
* @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
|
|
164
|
+
* @returns the picking info
|
|
165
|
+
*/
|
|
166
|
+
intersects(ray: Ray, fastCheck?: boolean, trianglePredicate?: TrianglePickingPredicate, onlyBoundingInfo?: boolean, worldToUse?: Matrix, skipBoundingInfo?: boolean): PickingInfo;
|
|
167
|
+
/**
|
|
168
|
+
* Gets all intersections of a ray and the line
|
|
169
|
+
* @param ray Ray to check the intersection of this mesh with
|
|
170
|
+
* @param _fastCheck not supported
|
|
171
|
+
* @param _trianglePredicate not supported
|
|
172
|
+
* @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
|
|
173
|
+
* @param _worldToUse not supported
|
|
174
|
+
* @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
|
|
175
|
+
* @param firstOnly If true, the first and only intersection is immediatelly returned if found
|
|
176
|
+
* @returns intersection(s)
|
|
177
|
+
*/
|
|
178
|
+
findAllIntersections(ray: Ray, _fastCheck?: boolean, _trianglePredicate?: TrianglePickingPredicate, onlyBoundingInfo?: boolean, _worldToUse?: Matrix, skipBoundingInfo?: boolean, firstOnly?: boolean): {
|
|
179
|
+
distance: number;
|
|
180
|
+
point: Vector3;
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
private _initGreasedLine;
|
|
183
|
+
private get _boundingSphere();
|
|
184
|
+
private static _CompareV3;
|
|
185
|
+
private static _CopyV3;
|
|
186
|
+
private _preprocess;
|
|
187
|
+
private _createVertexBuffers;
|
|
188
|
+
private _createOffsetsBuffer;
|
|
189
|
+
}
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { Vector3 } from "../Maths/math.vector.js";
|
|
2
|
+
import { GreasedLinePluginMaterial } from "../Materials/greasedLinePluginMaterial.js";
|
|
3
|
+
import { Mesh } from "./mesh.js";
|
|
4
|
+
import { Buffer, VertexBuffer } from "../Buffers/buffer.js";
|
|
5
|
+
import { VertexData } from "./mesh.vertexData.js";
|
|
6
|
+
import { PickingInfo } from "../Collisions/pickingInfo.js";
|
|
7
|
+
import { DeepCopier } from "../Misc/deepCopier.js";
|
|
8
|
+
import { GreasedLineTools } from "../Misc/greasedLineTools.js";
|
|
9
|
+
Mesh._GreasedLineMeshParser = (parsedMesh, scene) => {
|
|
10
|
+
return GreasedLineMesh.Parse(parsedMesh, scene);
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* GreasedLine
|
|
14
|
+
*/
|
|
15
|
+
export class GreasedLineMesh extends Mesh {
|
|
16
|
+
constructor(name, scene, _options) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
super(name, scene, null, null, false, false);
|
|
19
|
+
this.name = name;
|
|
20
|
+
this._options = _options;
|
|
21
|
+
this._lazy = false;
|
|
22
|
+
this._updatable = false;
|
|
23
|
+
/**
|
|
24
|
+
* Treshold used to pick the mesh
|
|
25
|
+
*/
|
|
26
|
+
this.intersectionThreshold = 0.1;
|
|
27
|
+
this._lazy = (_a = _options.lazy) !== null && _a !== void 0 ? _a : false;
|
|
28
|
+
this._updatable = (_b = _options.updatable) !== null && _b !== void 0 ? _b : false;
|
|
29
|
+
this._vertexPositions = [];
|
|
30
|
+
this._indices = [];
|
|
31
|
+
this._uvs = [];
|
|
32
|
+
this._points = [];
|
|
33
|
+
this._colorPointers = (_c = _options.colorPointers) !== null && _c !== void 0 ? _c : [];
|
|
34
|
+
this._previousAndSide = [];
|
|
35
|
+
this._nextAndCounters = [];
|
|
36
|
+
_options.widths = (_d = _options.widths) !== null && _d !== void 0 ? _d : new Array(_options.points.length).fill(1);
|
|
37
|
+
if (_options.points) {
|
|
38
|
+
this.addPoints(GreasedLineMesh.ConvertPoints(_options.points));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* "GreasedLineMesh"
|
|
43
|
+
* @returns "GreasedLineMesh"
|
|
44
|
+
*/
|
|
45
|
+
getClassName() {
|
|
46
|
+
return "GreasedLineMesh";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Converts GreasedLinePoints to number[][]
|
|
50
|
+
* @param points GreasedLinePoints
|
|
51
|
+
* @returns number[][] with x, y, z coordinates of the points, like [[x, y, z, x, y, z, ...], [x, y, z, ...]]
|
|
52
|
+
*/
|
|
53
|
+
static ConvertPoints(points) {
|
|
54
|
+
if (points.length && Array.isArray(points) && typeof points[0] === "number") {
|
|
55
|
+
return [points];
|
|
56
|
+
}
|
|
57
|
+
else if (points.length && Array.isArray(points[0]) && typeof points[0][0] === "number") {
|
|
58
|
+
return points;
|
|
59
|
+
}
|
|
60
|
+
else if (points.length && !Array.isArray(points[0]) && points[0] instanceof Vector3) {
|
|
61
|
+
const positions = [];
|
|
62
|
+
for (let j = 0; j < points.length; j++) {
|
|
63
|
+
const p = points[j];
|
|
64
|
+
positions.push(p.x, p.y, p.z);
|
|
65
|
+
}
|
|
66
|
+
return [positions];
|
|
67
|
+
}
|
|
68
|
+
else if (points.length > 0 && Array.isArray(points[0]) && points[0].length > 0 && points[0][0] instanceof Vector3) {
|
|
69
|
+
const positions = [];
|
|
70
|
+
const vectorPoints = points;
|
|
71
|
+
vectorPoints.forEach((p) => {
|
|
72
|
+
positions.push(p.flatMap((p2) => [p2.x, p2.y, p2.z]));
|
|
73
|
+
});
|
|
74
|
+
return positions;
|
|
75
|
+
}
|
|
76
|
+
else if (points instanceof Float32Array) {
|
|
77
|
+
return [Array.from(points)];
|
|
78
|
+
}
|
|
79
|
+
else if (points.length && points[0] instanceof Float32Array) {
|
|
80
|
+
const positions = [];
|
|
81
|
+
points.forEach((p) => {
|
|
82
|
+
positions.push(Array.from(p));
|
|
83
|
+
});
|
|
84
|
+
return positions;
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Updated a lazy line. Rerenders the line and updates boundinfo as well.
|
|
90
|
+
*/
|
|
91
|
+
updateLazy() {
|
|
92
|
+
var _a;
|
|
93
|
+
this.setPoints(this._points);
|
|
94
|
+
if (!this._options.colorPointers) {
|
|
95
|
+
this._updateColorPointers();
|
|
96
|
+
}
|
|
97
|
+
this._createVertexBuffers();
|
|
98
|
+
this.refreshBoundingInfo();
|
|
99
|
+
(_a = this.greasedLineMaterial) === null || _a === void 0 ? void 0 : _a.updateLazy();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Dispose the line and it's resources
|
|
103
|
+
*/
|
|
104
|
+
dispose() {
|
|
105
|
+
super.dispose();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* @returns true if the mesh was created in lazy mode
|
|
110
|
+
*/
|
|
111
|
+
isLazy() {
|
|
112
|
+
return this._lazy;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @returns options of the line
|
|
117
|
+
*/
|
|
118
|
+
get options() {
|
|
119
|
+
return this._options;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Sets point offets
|
|
123
|
+
* @param offsets offset table [x,y,z, x,y,z, ....]
|
|
124
|
+
*/
|
|
125
|
+
setOffsets(offsets) {
|
|
126
|
+
if (!this._offsetsBuffer) {
|
|
127
|
+
this._createOffsetsBuffer(offsets);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this._offsetsBuffer && this._offsetsBuffer.update(offsets);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Sets widths at each line point
|
|
135
|
+
* @param widths width table [widthUpper,widthLower, widthUpper,widthLower, ...]
|
|
136
|
+
*/
|
|
137
|
+
setSegmentWidths(widths) {
|
|
138
|
+
this._options.widths = widths;
|
|
139
|
+
if (!this._lazy) {
|
|
140
|
+
this._widthsBuffer && this._widthsBuffer.update(widths);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Sets the color pointer
|
|
145
|
+
* @param colorPointers arra of color pointer in the colors array. One pointer for every vertex is needed.
|
|
146
|
+
*/
|
|
147
|
+
setColorPointers(colorPointers) {
|
|
148
|
+
if (!this._lazy) {
|
|
149
|
+
this._colorPointersBuffer && this._colorPointersBuffer.update(colorPointers);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Gets the pluginMaterial associated with line
|
|
154
|
+
*/
|
|
155
|
+
get greasedLineMaterial() {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
return (_b = (_a = this.material) === null || _a === void 0 ? void 0 : _a.pluginManager) === null || _b === void 0 ? void 0 : _b.getPlugin(GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Adds new points to the line. It doesn't rerenders the line if in lazy mode.
|
|
161
|
+
* @param points points table
|
|
162
|
+
*/
|
|
163
|
+
addPoints(points) {
|
|
164
|
+
const numberPoints = points;
|
|
165
|
+
this._points.push(...numberPoints);
|
|
166
|
+
if (!this._lazy) {
|
|
167
|
+
this.setPoints(this._points);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
_updateColorPointers() {
|
|
171
|
+
let colorPointer = 0;
|
|
172
|
+
this._colorPointers = [];
|
|
173
|
+
this._points.forEach((p) => {
|
|
174
|
+
for (let jj = 0; jj < p.length; jj += 3) {
|
|
175
|
+
this._colorPointers.push(colorPointer);
|
|
176
|
+
this._colorPointers.push(colorPointer++);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Sets line points and rerenders the line.
|
|
182
|
+
* @param points points table
|
|
183
|
+
*/
|
|
184
|
+
setPoints(points) {
|
|
185
|
+
this._points = points;
|
|
186
|
+
this._options.points = points;
|
|
187
|
+
this._initGreasedLine();
|
|
188
|
+
let indiceOffset = 0;
|
|
189
|
+
points.forEach((p) => {
|
|
190
|
+
var _a;
|
|
191
|
+
const counters = [];
|
|
192
|
+
const positions = [];
|
|
193
|
+
const indices = [];
|
|
194
|
+
const totalLength = GreasedLineTools.GetLineLength(p);
|
|
195
|
+
for (let j = 0, jj = 0; jj < p.length; j++, jj += 3) {
|
|
196
|
+
const partialLine = p.slice(0, jj + 3);
|
|
197
|
+
const partialLineLength = GreasedLineTools.GetLineLength(partialLine);
|
|
198
|
+
const c = partialLineLength / totalLength;
|
|
199
|
+
positions.push(p[jj], p[jj + 1], p[jj + 2]);
|
|
200
|
+
positions.push(p[jj], p[jj + 1], p[jj + 2]);
|
|
201
|
+
counters.push(c);
|
|
202
|
+
counters.push(c);
|
|
203
|
+
if (jj < p.length - 3) {
|
|
204
|
+
const n = j * 2 + indiceOffset;
|
|
205
|
+
indices.push(n, n + 1, n + 2);
|
|
206
|
+
indices.push(n + 2, n + 1, n + 3);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
indiceOffset += (p.length / 3) * 2;
|
|
210
|
+
const previous = [];
|
|
211
|
+
const next = [];
|
|
212
|
+
const side = [];
|
|
213
|
+
let uvs = [];
|
|
214
|
+
this._preprocess(positions, previous, next, side, uvs);
|
|
215
|
+
this._vertexPositions.push(...positions);
|
|
216
|
+
this._indices.push(...indices);
|
|
217
|
+
for (let i = 0; i < side.length; i++) {
|
|
218
|
+
this._previousAndSide.push(previous[i * 3], previous[i * 3 + 1], previous[i * 3 + 2], side[i]);
|
|
219
|
+
this._nextAndCounters.push(next[i * 3], next[i * 3 + 1], next[i * 3 + 2], counters[i]);
|
|
220
|
+
}
|
|
221
|
+
uvs = (_a = this._options.uvs) !== null && _a !== void 0 ? _a : uvs;
|
|
222
|
+
this._uvs.push(...uvs);
|
|
223
|
+
});
|
|
224
|
+
if (!this._lazy) {
|
|
225
|
+
if (!this._options.colorPointers) {
|
|
226
|
+
this._updateColorPointers();
|
|
227
|
+
}
|
|
228
|
+
this._createVertexBuffers();
|
|
229
|
+
this.refreshBoundingInfo();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Clones the GreasedLineMesh.
|
|
234
|
+
* @param name new line name
|
|
235
|
+
* @param newParent new parent node
|
|
236
|
+
* @returns cloned line
|
|
237
|
+
*/
|
|
238
|
+
clone(name = `${this.name}-cloned`, newParent) {
|
|
239
|
+
const lineOptions = {};
|
|
240
|
+
DeepCopier.DeepCopy(this._options, lineOptions, ["instance"]);
|
|
241
|
+
const cloned = new GreasedLineMesh(name, this._scene, lineOptions);
|
|
242
|
+
if (newParent) {
|
|
243
|
+
cloned.parent = newParent;
|
|
244
|
+
}
|
|
245
|
+
cloned.material = this.material;
|
|
246
|
+
return cloned;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Serializes this GreasedLineMesh
|
|
250
|
+
* @param serializationObject object to write serialization to
|
|
251
|
+
*/
|
|
252
|
+
serialize(serializationObject) {
|
|
253
|
+
super.serialize(serializationObject);
|
|
254
|
+
serializationObject.type = this.getClassName();
|
|
255
|
+
serializationObject.lineOptions = this._options;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parses a serialized GreasedLineMesh
|
|
259
|
+
* @param parsedMesh the serialized GreasedLineMesh
|
|
260
|
+
* @param scene the scene to create the GreasedLineMesh in
|
|
261
|
+
* @returns the created GreasedLineMesh
|
|
262
|
+
*/
|
|
263
|
+
static Parse(parsedMesh, scene) {
|
|
264
|
+
const lineOptions = parsedMesh.lineOptions;
|
|
265
|
+
const name = parsedMesh.name;
|
|
266
|
+
const result = new GreasedLineMesh(name, scene, lineOptions);
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Checks whether a ray is intersecting this GreasedLineMesh
|
|
271
|
+
* @param ray ray to check the intersection of this mesh with
|
|
272
|
+
* @param fastCheck not supported
|
|
273
|
+
* @param trianglePredicate not supported
|
|
274
|
+
* @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
|
|
275
|
+
* @param worldToUse not supported
|
|
276
|
+
* @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
|
|
277
|
+
* @returns the picking info
|
|
278
|
+
*/
|
|
279
|
+
intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {
|
|
280
|
+
const pickingInfo = new PickingInfo();
|
|
281
|
+
const intersections = this.findAllIntersections(ray, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo, true);
|
|
282
|
+
if ((intersections === null || intersections === void 0 ? void 0 : intersections.length) === 1) {
|
|
283
|
+
const intersection = intersections[0];
|
|
284
|
+
pickingInfo.hit = true;
|
|
285
|
+
pickingInfo.distance = intersection.distance;
|
|
286
|
+
pickingInfo.ray = ray;
|
|
287
|
+
pickingInfo.pickedMesh = this;
|
|
288
|
+
pickingInfo.pickedPoint = intersection.point;
|
|
289
|
+
}
|
|
290
|
+
return pickingInfo;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Gets all intersections of a ray and the line
|
|
294
|
+
* @param ray Ray to check the intersection of this mesh with
|
|
295
|
+
* @param _fastCheck not supported
|
|
296
|
+
* @param _trianglePredicate not supported
|
|
297
|
+
* @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
|
|
298
|
+
* @param _worldToUse not supported
|
|
299
|
+
* @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
|
|
300
|
+
* @param firstOnly If true, the first and only intersection is immediatelly returned if found
|
|
301
|
+
* @returns intersection(s)
|
|
302
|
+
*/
|
|
303
|
+
findAllIntersections(ray, _fastCheck, _trianglePredicate, onlyBoundingInfo = false, _worldToUse, skipBoundingInfo = false, firstOnly = false) {
|
|
304
|
+
var _a, _b;
|
|
305
|
+
if (onlyBoundingInfo && !skipBoundingInfo && ray.intersectsSphere(this._boundingSphere, this.intersectionThreshold) === false) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const indices = this.getIndices();
|
|
309
|
+
const positions = this.getVerticesData(VertexBuffer.PositionKind);
|
|
310
|
+
const widths = this._options.widths;
|
|
311
|
+
const lineWidth = (_b = (_a = this.greasedLineMaterial) === null || _a === void 0 ? void 0 : _a.getOptions().width) !== null && _b !== void 0 ? _b : 1;
|
|
312
|
+
const intersects = [];
|
|
313
|
+
if (indices && positions && widths) {
|
|
314
|
+
let i = 0, l = 0;
|
|
315
|
+
for (i = 0, l = indices.length - 1; i < l; i += 3) {
|
|
316
|
+
const a = indices[i];
|
|
317
|
+
const b = indices[i + 1];
|
|
318
|
+
GreasedLineMesh._V_START.fromArray(positions, a * 3);
|
|
319
|
+
GreasedLineMesh._V_END.fromArray(positions, b * 3);
|
|
320
|
+
if (this._offsets) {
|
|
321
|
+
GreasedLineMesh._V_OFFSET_START.fromArray(this._offsets, a * 3);
|
|
322
|
+
GreasedLineMesh._V_OFFSET_END.fromArray(this._offsets, b * 3);
|
|
323
|
+
GreasedLineMesh._V_START.addInPlace(GreasedLineMesh._V_OFFSET_START);
|
|
324
|
+
GreasedLineMesh._V_END.addInPlace(GreasedLineMesh._V_OFFSET_END);
|
|
325
|
+
}
|
|
326
|
+
const iFloored = Math.floor(i / 3);
|
|
327
|
+
const width = widths[iFloored] !== undefined ? widths[iFloored] : 1;
|
|
328
|
+
const precision = (this.intersectionThreshold * (lineWidth * width)) / 2;
|
|
329
|
+
const distance = ray.intersectionSegment(GreasedLineMesh._V_START, GreasedLineMesh._V_END, precision);
|
|
330
|
+
if (distance !== -1) {
|
|
331
|
+
intersects.push({
|
|
332
|
+
distance: distance,
|
|
333
|
+
point: ray.direction.normalize().multiplyByFloats(distance, distance, distance).add(ray.origin),
|
|
334
|
+
});
|
|
335
|
+
if (firstOnly) {
|
|
336
|
+
return intersects;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
i = l;
|
|
341
|
+
}
|
|
342
|
+
return intersects;
|
|
343
|
+
}
|
|
344
|
+
_initGreasedLine() {
|
|
345
|
+
this._vertexPositions = [];
|
|
346
|
+
this._previousAndSide = [];
|
|
347
|
+
this._nextAndCounters = [];
|
|
348
|
+
this._indices = [];
|
|
349
|
+
this._uvs = [];
|
|
350
|
+
}
|
|
351
|
+
get _boundingSphere() {
|
|
352
|
+
return this.getBoundingInfo().boundingSphere;
|
|
353
|
+
}
|
|
354
|
+
static _CompareV3(positionIdx1, positionIdx2, positions) {
|
|
355
|
+
const arrayIdx1 = positionIdx1 * 6;
|
|
356
|
+
const arrayIdx2 = positionIdx2 * 6;
|
|
357
|
+
return positions[arrayIdx1] === positions[arrayIdx2] && positions[arrayIdx1 + 1] === positions[arrayIdx2 + 1] && positions[arrayIdx1 + 2] === positions[arrayIdx2 + 2];
|
|
358
|
+
}
|
|
359
|
+
static _CopyV3(positionIdx, positions) {
|
|
360
|
+
const arrayIdx = positionIdx * 6;
|
|
361
|
+
return [positions[arrayIdx], positions[arrayIdx + 1], positions[arrayIdx + 2]];
|
|
362
|
+
}
|
|
363
|
+
_preprocess(positions, previous, next, side, uvs) {
|
|
364
|
+
const l = positions.length / 6;
|
|
365
|
+
let v = [];
|
|
366
|
+
if (GreasedLineMesh._CompareV3(0, l - 1, positions)) {
|
|
367
|
+
v = GreasedLineMesh._CopyV3(l - 2, positions);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
v = GreasedLineMesh._CopyV3(0, positions);
|
|
371
|
+
}
|
|
372
|
+
previous.push(v[0], v[1], v[2]);
|
|
373
|
+
previous.push(v[0], v[1], v[2]);
|
|
374
|
+
for (let j = 0; j < l; j++) {
|
|
375
|
+
side.push(1);
|
|
376
|
+
side.push(-1);
|
|
377
|
+
// uvs
|
|
378
|
+
if (!this._options.uvs) {
|
|
379
|
+
uvs.push(j / (l - 1), 0);
|
|
380
|
+
uvs.push(j / (l - 1), 1);
|
|
381
|
+
}
|
|
382
|
+
if (j < l - 1) {
|
|
383
|
+
v = GreasedLineMesh._CopyV3(j, positions);
|
|
384
|
+
previous.push(v[0], v[1], v[2]);
|
|
385
|
+
previous.push(v[0], v[1], v[2]);
|
|
386
|
+
}
|
|
387
|
+
if (j > 0) {
|
|
388
|
+
v = GreasedLineMesh._CopyV3(j, positions);
|
|
389
|
+
next.push(v[0], v[1], v[2]);
|
|
390
|
+
next.push(v[0], v[1], v[2]);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (GreasedLineMesh._CompareV3(l - 1, 0, positions)) {
|
|
394
|
+
v = GreasedLineMesh._CopyV3(1, positions);
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
v = GreasedLineMesh._CopyV3(l - 1, positions);
|
|
398
|
+
}
|
|
399
|
+
next.push(v[0], v[1], v[2]);
|
|
400
|
+
next.push(v[0], v[1], v[2]);
|
|
401
|
+
return {
|
|
402
|
+
previous,
|
|
403
|
+
next,
|
|
404
|
+
uvs,
|
|
405
|
+
side,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
_createVertexBuffers() {
|
|
409
|
+
const vertexData = new VertexData();
|
|
410
|
+
vertexData.positions = this._vertexPositions;
|
|
411
|
+
vertexData.indices = this._indices;
|
|
412
|
+
vertexData.uvs = this._uvs;
|
|
413
|
+
vertexData.applyToMesh(this, this._options.updatable);
|
|
414
|
+
const engine = this._scene.getEngine();
|
|
415
|
+
const previousAndSideBuffer = new Buffer(engine, this._previousAndSide, false, 4);
|
|
416
|
+
this.setVerticesBuffer(previousAndSideBuffer.createVertexBuffer("grl_previousAndSide", 0, 4));
|
|
417
|
+
const nextAndCountersBuffer = new Buffer(engine, this._nextAndCounters, false, 4);
|
|
418
|
+
this.setVerticesBuffer(nextAndCountersBuffer.createVertexBuffer("grl_nextAndCounters", 0, 4));
|
|
419
|
+
const widthBuffer = new Buffer(engine, this._options.widths, this._updatable, 1);
|
|
420
|
+
this.setVerticesBuffer(widthBuffer.createVertexBuffer("grl_widths", 0, 1));
|
|
421
|
+
this._widthsBuffer = widthBuffer;
|
|
422
|
+
const colorPointersBuffer = new Buffer(engine, this._colorPointers, this._updatable, 1);
|
|
423
|
+
this.setVerticesBuffer(colorPointersBuffer.createVertexBuffer("grl_colorPointers", 0, 1));
|
|
424
|
+
this._colorPointersBuffer = colorPointersBuffer;
|
|
425
|
+
}
|
|
426
|
+
_createOffsetsBuffer(offsets) {
|
|
427
|
+
const engine = this._scene.getEngine();
|
|
428
|
+
const offsetBuffer = new Buffer(engine, offsets, this._updatable, 3);
|
|
429
|
+
this.setVerticesBuffer(offsetBuffer.createVertexBuffer("grl_offsets", 0, 3));
|
|
430
|
+
this._offsetsBuffer = offsetBuffer;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
GreasedLineMesh._V_START = new Vector3();
|
|
434
|
+
GreasedLineMesh._V_END = new Vector3();
|
|
435
|
+
GreasedLineMesh._V_OFFSET_START = new Vector3();
|
|
436
|
+
GreasedLineMesh._V_OFFSET_END = new Vector3();
|
|
437
|
+
//# sourceMappingURL=greasedLineMesh.js.map
|