@babylonjs/core 6.23.1 → 6.25.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/Buffers/buffer.align.d.ts +25 -0
- package/Buffers/buffer.align.js +120 -0
- package/Buffers/buffer.align.js.map +1 -0
- package/Buffers/buffer.d.ts +15 -3
- package/Buffers/buffer.js +27 -7
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/index.d.ts +1 -0
- package/Buffers/index.js +1 -0
- package/Buffers/index.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +0 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +1 -4
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +0 -6
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/RigModes/index.d.ts +0 -1
- package/Cameras/RigModes/index.js +0 -1
- package/Cameras/RigModes/index.js.map +1 -1
- package/Cameras/RigModes/vrRigMode.js +1 -1
- package/Cameras/RigModes/vrRigMode.js.map +1 -1
- package/Cameras/VR/index.d.ts +0 -1
- package/Cameras/VR/index.js +0 -1
- package/Cameras/VR/index.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.d.ts +7 -66
- package/Cameras/VR/vrExperienceHelper.js +17 -702
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/camera.d.ts +15 -20
- package/Cameras/camera.js +41 -36
- package/Cameras/camera.js.map +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/Extensions/index.d.ts +0 -1
- package/Engines/Extensions/index.js +0 -1
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +8 -7
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/constants.d.ts +0 -4
- package/Engines/constants.js +0 -4
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +38 -258
- package/Engines/engine.js +0 -65
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.js +9 -14
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/engineFeatures.d.ts +2 -0
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +22 -5
- package/Engines/thinEngine.js +55 -22
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +4 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +9 -8
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +34 -16
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +4 -3
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +14 -6
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +19 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +64 -27
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +39 -41
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +152 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +12 -12
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +42 -21
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +17 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +62 -26
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +13 -10
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +46 -18
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +10 -5
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +6 -2
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +11 -6
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +22 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +15 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +14 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +9 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +41 -3
- package/FlowGraph/flowGraph.js +135 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +15 -3
- package/FlowGraph/flowGraphBlock.js +50 -7
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +34 -4
- package/FlowGraph/flowGraphConnection.js +49 -3
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +25 -5
- package/FlowGraph/flowGraphContext.js +86 -4
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +7 -1
- package/FlowGraph/flowGraphCoordinator.js +18 -2
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +4 -11
- package/FlowGraph/flowGraphDataConnection.js +16 -14
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +8 -3
- package/FlowGraph/flowGraphExecutionBlock.js +37 -6
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -9
- package/FlowGraph/flowGraphRichTypes.js +29 -44
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +2 -0
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/flowGraphVariableDefinitions.d.ts +22 -2
- package/FlowGraph/flowGraphVariableDefinitions.js +29 -0
- package/FlowGraph/flowGraphVariableDefinitions.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/Gamepads/gamepadManager.js +0 -5
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gamepads/index.d.ts +0 -1
- package/Gamepads/index.js +0 -2
- package/Gamepads/index.js.map +1 -1
- package/Gizmos/gizmo.js +1 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +24 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js +19 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +243 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js +55 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +253 -0
- package/Materials/{greasedLinePluginMaterial.js → GreasedLine/greasedLinePluginMaterial.js} +148 -205
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -0
- package/Materials/{greasedLineSimpleMaterial.d.ts → GreasedLine/greasedLineSimpleMaterial.d.ts} +20 -48
- package/Materials/{greasedLineSimpleMaterial.js → GreasedLine/greasedLineSimpleMaterial.js} +74 -91
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Textures/texture.js +1 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/index.d.ts +4 -1
- package/Materials/index.js +4 -1
- package/Materials/index.js.map +1 -1
- package/Maths/math.vector.d.ts +32 -22
- package/Maths/math.vector.js +54 -43
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +7 -6
- package/Meshes/Builders/greasedLineBuilder.js +65 -31
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +216 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +247 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +92 -0
- package/Meshes/{greasedLineMesh.js → GreasedLine/greasedLineMesh.js} +29 -223
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +107 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +462 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +9 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js +17 -5
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +15 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +50 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +5 -5
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +1 -2
- package/Meshes/Node/nodeGeometry.js +3 -4
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +1 -2
- package/Meshes/Node/nodeGeometryBlock.js +1 -2
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/geometry.js +6 -12
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +3 -1
- package/Meshes/index.js +3 -1
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.d.ts +4 -0
- package/Meshes/mesh.js +7 -0
- package/Meshes/mesh.js.map +1 -1
- package/Misc/deepCopier.js +3 -0
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +52 -5
- package/Misc/greasedLineTools.js +180 -10
- package/Misc/greasedLineTools.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +9 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +4 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +4 -0
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/greasedLine.fragment.js +2 -5
- package/Shaders/greasedLine.fragment.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +15 -4
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +1 -1
- package/XR/webXRDefaultExperience.js +1 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +17 -10
- package/scene.js +25 -30
- package/scene.js.map +1 -1
- package/Cameras/RigModes/webVRRigMode.d.ts +0 -5
- package/Cameras/RigModes/webVRRigMode.js +0 -34
- package/Cameras/RigModes/webVRRigMode.js.map +0 -1
- package/Cameras/VR/webVRCamera.d.ts +0 -316
- package/Cameras/VR/webVRCamera.js +0 -618
- package/Cameras/VR/webVRCamera.js.map +0 -1
- package/Engines/Extensions/engine.webVR.d.ts +0 -91
- package/Engines/Extensions/engine.webVR.js +0 -195
- package/Engines/Extensions/engine.webVR.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.d.ts +0 -23
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js +0 -18
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js.map +0 -1
- package/Gamepads/Controllers/daydreamController.d.ts +0 -38
- package/Gamepads/Controllers/daydreamController.js +0 -70
- package/Gamepads/Controllers/daydreamController.js.map +0 -1
- package/Gamepads/Controllers/gearVRController.d.ts +0 -39
- package/Gamepads/Controllers/gearVRController.js +0 -79
- package/Gamepads/Controllers/gearVRController.js.map +0 -1
- package/Gamepads/Controllers/genericController.d.ts +0 -34
- package/Gamepads/Controllers/genericController.js +0 -48
- package/Gamepads/Controllers/genericController.js.map +0 -1
- package/Gamepads/Controllers/index.d.ts +0 -8
- package/Gamepads/Controllers/index.js +0 -9
- package/Gamepads/Controllers/index.js.map +0 -1
- package/Gamepads/Controllers/oculusTouchController.d.ts +0 -78
- package/Gamepads/Controllers/oculusTouchController.js +0 -196
- package/Gamepads/Controllers/oculusTouchController.js.map +0 -1
- package/Gamepads/Controllers/poseEnabledController.d.ts +0 -219
- package/Gamepads/Controllers/poseEnabledController.js +0 -293
- package/Gamepads/Controllers/poseEnabledController.js.map +0 -1
- package/Gamepads/Controllers/viveController.d.ts +0 -52
- package/Gamepads/Controllers/viveController.js +0 -115
- package/Gamepads/Controllers/viveController.js.map +0 -1
- package/Gamepads/Controllers/webVRController.d.ts +0 -85
- package/Gamepads/Controllers/webVRController.js +0 -122
- package/Gamepads/Controllers/webVRController.js.map +0 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +0 -212
- package/Gamepads/Controllers/windowsMotionController.js +0 -519
- package/Gamepads/Controllers/windowsMotionController.js.map +0 -1
- package/Materials/greasedLinePluginMaterial.d.ts +0 -496
- package/Materials/greasedLinePluginMaterial.js.map +0 -1
- package/Materials/greasedLineSimpleMaterial.js.map +0 -1
- package/Meshes/greasedLineMesh.d.ts +0 -204
- package/Meshes/greasedLineMesh.js.map +0 -1
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { GreasedLineTools } from "../Misc/greasedLineTools.js";
|
|
9
|
-
import { GreasedLineSimpleMaterial } from "../Materials/greasedLineSimpleMaterial.js";
|
|
1
|
+
import { Vector3 } from "../../Maths/math.vector.js";
|
|
2
|
+
import { Mesh } from "../mesh.js";
|
|
3
|
+
import { Buffer, VertexBuffer } from "../../Buffers/buffer.js";
|
|
4
|
+
import { PickingInfo } from "../../Collisions/pickingInfo.js";
|
|
5
|
+
import { DeepCopier } from "../../Misc/deepCopier.js";
|
|
6
|
+
import { GreasedLineTools } from "../../Misc/greasedLineTools.js";
|
|
7
|
+
import { GreasedLineBaseMesh } from "./greasedLineBaseMesh.js";
|
|
10
8
|
Mesh._GreasedLineMeshParser = (parsedMesh, scene) => {
|
|
11
9
|
return GreasedLineMesh.Parse(parsedMesh, scene);
|
|
12
10
|
};
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
12
|
+
* GreasedLineMesh
|
|
13
|
+
* Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.
|
|
15
14
|
*/
|
|
16
|
-
export class GreasedLineMesh extends
|
|
15
|
+
export class GreasedLineMesh extends GreasedLineBaseMesh {
|
|
16
|
+
/**
|
|
17
|
+
* GreasedLineMesh
|
|
18
|
+
* @param name name of the mesh
|
|
19
|
+
* @param scene the scene
|
|
20
|
+
* @param _options mesh options
|
|
21
|
+
*/
|
|
17
22
|
constructor(name, scene, _options) {
|
|
18
|
-
|
|
19
|
-
super(name, scene, null, null, false, false);
|
|
23
|
+
super(name, scene, _options);
|
|
20
24
|
this.name = name;
|
|
21
|
-
this._options = _options;
|
|
22
|
-
this._lazy = false;
|
|
23
|
-
this._updatable = false;
|
|
24
25
|
/**
|
|
25
26
|
* Treshold used to pick the mesh
|
|
26
27
|
*/
|
|
27
28
|
this.intersectionThreshold = 0.1;
|
|
28
|
-
this._lazy = (_a = _options.lazy) !== null && _a !== void 0 ? _a : false;
|
|
29
|
-
this._updatable = (_b = _options.updatable) !== null && _b !== void 0 ? _b : false;
|
|
30
|
-
this._vertexPositions = [];
|
|
31
|
-
this._indices = [];
|
|
32
|
-
this._uvs = [];
|
|
33
|
-
this._points = [];
|
|
34
|
-
this._colorPointers = (_c = _options.colorPointers) !== null && _c !== void 0 ? _c : [];
|
|
35
|
-
this._widths = (_d = _options.widths) !== null && _d !== void 0 ? _d : new Array(_options.points.length).fill(1);
|
|
36
29
|
this._previousAndSide = [];
|
|
37
30
|
this._nextAndCounters = [];
|
|
38
31
|
if (_options.points) {
|
|
39
|
-
this.addPoints(
|
|
32
|
+
this.addPoints(GreasedLineTools.ConvertPoints(_options.points));
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
/**
|
|
@@ -46,158 +39,10 @@ export class GreasedLineMesh extends Mesh {
|
|
|
46
39
|
getClassName() {
|
|
47
40
|
return "GreasedLineMesh";
|
|
48
41
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Converts GreasedLinePoints to number[][]
|
|
51
|
-
* @param points GreasedLinePoints
|
|
52
|
-
* @returns number[][] with x, y, z coordinates of the points, like [[x, y, z, x, y, z, ...], [x, y, z, ...]]
|
|
53
|
-
*/
|
|
54
|
-
static ConvertPoints(points) {
|
|
55
|
-
if (points.length && Array.isArray(points) && typeof points[0] === "number") {
|
|
56
|
-
return [points];
|
|
57
|
-
}
|
|
58
|
-
else if (points.length && Array.isArray(points[0]) && typeof points[0][0] === "number") {
|
|
59
|
-
return points;
|
|
60
|
-
}
|
|
61
|
-
else if (points.length && !Array.isArray(points[0]) && points[0] instanceof Vector3) {
|
|
62
|
-
const positions = [];
|
|
63
|
-
for (let j = 0; j < points.length; j++) {
|
|
64
|
-
const p = points[j];
|
|
65
|
-
positions.push(p.x, p.y, p.z);
|
|
66
|
-
}
|
|
67
|
-
return [positions];
|
|
68
|
-
}
|
|
69
|
-
else if (points.length > 0 && Array.isArray(points[0]) && points[0].length > 0 && points[0][0] instanceof Vector3) {
|
|
70
|
-
const positions = [];
|
|
71
|
-
const vectorPoints = points;
|
|
72
|
-
vectorPoints.forEach((p) => {
|
|
73
|
-
positions.push(p.flatMap((p2) => [p2.x, p2.y, p2.z]));
|
|
74
|
-
});
|
|
75
|
-
return positions;
|
|
76
|
-
}
|
|
77
|
-
else if (points instanceof Float32Array) {
|
|
78
|
-
return [Array.from(points)];
|
|
79
|
-
}
|
|
80
|
-
else if (points.length && points[0] instanceof Float32Array) {
|
|
81
|
-
const positions = [];
|
|
82
|
-
points.forEach((p) => {
|
|
83
|
-
positions.push(Array.from(p));
|
|
84
|
-
});
|
|
85
|
-
return positions;
|
|
86
|
-
}
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Updated a lazy line. Rerenders the line and updates boundinfo as well.
|
|
91
|
-
*/
|
|
92
|
-
updateLazy() {
|
|
93
|
-
var _a;
|
|
94
|
-
this._setPoints(this._points);
|
|
95
|
-
if (!this._options.colorPointers) {
|
|
96
|
-
this._updateColorPointers();
|
|
97
|
-
}
|
|
98
|
-
this._createVertexBuffers();
|
|
99
|
-
this.refreshBoundingInfo();
|
|
100
|
-
(_a = this.greasedLineMaterial) === null || _a === void 0 ? void 0 : _a.updateLazy();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Dispose the line and it's resources
|
|
104
|
-
*/
|
|
105
|
-
dispose() {
|
|
106
|
-
super.dispose();
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
*
|
|
110
|
-
* @returns true if the mesh was created in lazy mode
|
|
111
|
-
*/
|
|
112
|
-
isLazy() {
|
|
113
|
-
return this._lazy;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Return the the points offsets
|
|
117
|
-
*/
|
|
118
|
-
get offsets() {
|
|
119
|
-
return this._offsets;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Sets point offests
|
|
123
|
-
* @param offsets offset table [x,y,z, x,y,z, ....]
|
|
124
|
-
*/
|
|
125
|
-
set offsets(offsets) {
|
|
126
|
-
this._offsets = offsets;
|
|
127
|
-
if (!this._offsetsBuffer) {
|
|
128
|
-
this._createOffsetsBuffer(offsets);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this._offsetsBuffer && this._offsetsBuffer.update(offsets);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Gets widths at each line point like [widthLower, widthUpper, widthLower, widthUpper, ...]
|
|
136
|
-
*/
|
|
137
|
-
get widths() {
|
|
138
|
-
return this._widths;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Sets widths at each line point
|
|
142
|
-
* @param widths width table [widthLower, widthUpper, widthLower, widthUpper ...]
|
|
143
|
-
*/
|
|
144
|
-
set widths(widths) {
|
|
145
|
-
this._widths = widths;
|
|
146
|
-
if (!this._lazy) {
|
|
147
|
-
this._widthsBuffer && this._widthsBuffer.update(widths);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Gets the color pointer. Each vertex need a color pointer. These color pointers points to the colors in the color table @see colors
|
|
152
|
-
*/
|
|
153
|
-
get colorPointers() {
|
|
154
|
-
return this._colorPointers;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Sets the color pointer
|
|
158
|
-
* @param colorPointers array of color pointer in the colors array. One pointer for every vertex is needed.
|
|
159
|
-
*/
|
|
160
|
-
set colorPointers(colorPointers) {
|
|
161
|
-
this._colorPointers = colorPointers;
|
|
162
|
-
if (!this._lazy) {
|
|
163
|
-
this._colorPointersBuffer && this._colorPointersBuffer.update(colorPointers);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Gets the pluginMaterial associated with line
|
|
168
|
-
*/
|
|
169
|
-
get greasedLineMaterial() {
|
|
170
|
-
var _a, _b;
|
|
171
|
-
if (this.material && this.material instanceof GreasedLineSimpleMaterial) {
|
|
172
|
-
return this.material;
|
|
173
|
-
}
|
|
174
|
-
const materialPlugin = (_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);
|
|
175
|
-
if (materialPlugin) {
|
|
176
|
-
return materialPlugin;
|
|
177
|
-
}
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Return copy the points.
|
|
182
|
-
*/
|
|
183
|
-
get points() {
|
|
184
|
-
const pointsCopy = [];
|
|
185
|
-
DeepCopier.DeepCopy(this._points, pointsCopy);
|
|
186
|
-
return pointsCopy;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Adds new points to the line. It doesn't rerenders the line if in lazy mode.
|
|
190
|
-
* @param points points table
|
|
191
|
-
*/
|
|
192
|
-
addPoints(points) {
|
|
193
|
-
for (const p of points) {
|
|
194
|
-
this._points.push(p);
|
|
195
|
-
}
|
|
196
|
-
if (!this._lazy) {
|
|
197
|
-
this.setPoints(this._points);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
42
|
_updateColorPointers() {
|
|
43
|
+
if (this._options.colorPointers) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
201
46
|
let colorPointer = 0;
|
|
202
47
|
this._colorPointers = [];
|
|
203
48
|
this._points.forEach((p) => {
|
|
@@ -208,24 +53,7 @@ export class GreasedLineMesh extends Mesh {
|
|
|
208
53
|
});
|
|
209
54
|
}
|
|
210
55
|
_updateWidths() {
|
|
211
|
-
|
|
212
|
-
for (const points of this._points) {
|
|
213
|
-
pointCount += points.length;
|
|
214
|
-
}
|
|
215
|
-
const countDiff = (pointCount / 3) * 2 - this._widths.length;
|
|
216
|
-
for (let i = 0; i < countDiff; i++) {
|
|
217
|
-
this._widths.push(1);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Sets line points and rerenders the line.
|
|
222
|
-
* @param points points table
|
|
223
|
-
*/
|
|
224
|
-
setPoints(points) {
|
|
225
|
-
this._points = points;
|
|
226
|
-
this._updateWidths();
|
|
227
|
-
this._updateColorPointers();
|
|
228
|
-
this._setPoints(points);
|
|
56
|
+
super._updateWidthsWithValue(0);
|
|
229
57
|
}
|
|
230
58
|
_setPoints(points) {
|
|
231
59
|
this._points = points;
|
|
@@ -281,17 +109,6 @@ export class GreasedLineMesh extends Mesh {
|
|
|
281
109
|
this.refreshBoundingInfo();
|
|
282
110
|
}
|
|
283
111
|
}
|
|
284
|
-
_createLineOptions() {
|
|
285
|
-
const lineOptions = {
|
|
286
|
-
points: this._points,
|
|
287
|
-
colorPointers: this._colorPointers,
|
|
288
|
-
lazy: this._lazy,
|
|
289
|
-
updatable: this._updatable,
|
|
290
|
-
uvs: this._uvs,
|
|
291
|
-
widths: this._widths,
|
|
292
|
-
};
|
|
293
|
-
return lineOptions;
|
|
294
|
-
}
|
|
295
112
|
/**
|
|
296
113
|
* Clones the GreasedLineMesh.
|
|
297
114
|
* @param name new line name
|
|
@@ -330,6 +147,11 @@ export class GreasedLineMesh extends Mesh {
|
|
|
330
147
|
const result = new GreasedLineMesh(name, scene, lineOptions);
|
|
331
148
|
return result;
|
|
332
149
|
}
|
|
150
|
+
_initGreasedLine() {
|
|
151
|
+
super._initGreasedLine();
|
|
152
|
+
this._previousAndSide = [];
|
|
153
|
+
this._nextAndCounters = [];
|
|
154
|
+
}
|
|
333
155
|
/**
|
|
334
156
|
* Checks whether a ray is intersecting this GreasedLineMesh
|
|
335
157
|
* @param ray ray to check the intersection of this mesh with
|
|
@@ -405,13 +227,6 @@ export class GreasedLineMesh extends Mesh {
|
|
|
405
227
|
}
|
|
406
228
|
return intersects;
|
|
407
229
|
}
|
|
408
|
-
_initGreasedLine() {
|
|
409
|
-
this._vertexPositions = [];
|
|
410
|
-
this._previousAndSide = [];
|
|
411
|
-
this._nextAndCounters = [];
|
|
412
|
-
this._indices = [];
|
|
413
|
-
this._uvs = [];
|
|
414
|
-
}
|
|
415
230
|
get _boundingSphere() {
|
|
416
231
|
return this.getBoundingInfo().boundingSphere;
|
|
417
232
|
}
|
|
@@ -470,11 +285,7 @@ export class GreasedLineMesh extends Mesh {
|
|
|
470
285
|
};
|
|
471
286
|
}
|
|
472
287
|
_createVertexBuffers() {
|
|
473
|
-
const vertexData =
|
|
474
|
-
vertexData.positions = this._vertexPositions;
|
|
475
|
-
vertexData.indices = this._indices;
|
|
476
|
-
vertexData.uvs = this._uvs;
|
|
477
|
-
vertexData.applyToMesh(this, this._options.updatable);
|
|
288
|
+
const vertexData = super._createVertexBuffers();
|
|
478
289
|
const engine = this._scene.getEngine();
|
|
479
290
|
const previousAndSideBuffer = new Buffer(engine, this._previousAndSide, false, 4);
|
|
480
291
|
this.setVerticesBuffer(previousAndSideBuffer.createVertexBuffer("grl_previousAndSide", 0, 4));
|
|
@@ -486,12 +297,7 @@ export class GreasedLineMesh extends Mesh {
|
|
|
486
297
|
const colorPointersBuffer = new Buffer(engine, this._colorPointers, this._updatable, 1);
|
|
487
298
|
this.setVerticesBuffer(colorPointersBuffer.createVertexBuffer("grl_colorPointers", 0, 1));
|
|
488
299
|
this._colorPointersBuffer = colorPointersBuffer;
|
|
489
|
-
|
|
490
|
-
_createOffsetsBuffer(offsets) {
|
|
491
|
-
const engine = this._scene.getEngine();
|
|
492
|
-
const offsetBuffer = new Buffer(engine, offsets, this._updatable, 3);
|
|
493
|
-
this.setVerticesBuffer(offsetBuffer.createVertexBuffer("grl_offsets", 0, 3));
|
|
494
|
-
this._offsetsBuffer = offsetBuffer;
|
|
300
|
+
return vertexData;
|
|
495
301
|
}
|
|
496
302
|
}
|
|
497
303
|
GreasedLineMesh._V_START = new Vector3();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greasedLineMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GreasedLine/greasedLineMesh.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAA+B,MAAM,uBAAuB,CAAC;AAEzF,IAAI,CAAC,sBAAsB,GAAG,CAAC,UAAe,EAAE,KAAY,EAAQ,EAAE;IAClE,OAAO,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IAcpD;;;;;OAKG;I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B,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE9F,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;QAEjC,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1F,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;QAEhD,OAAO,UAAU,CAAC;IACtB,CAAC;;AAvWc,wBAAQ,GAAG,IAAI,OAAO,EAAE,AAAhB,CAAiB;AACzB,sBAAM,GAAG,IAAI,OAAO,EAAE,AAAhB,CAAiB;AACvB,+BAAe,GAAG,IAAI,OAAO,EAAE,AAAhB,CAAiB;AAChC,6BAAa,GAAG,IAAI,OAAO,EAAE,AAAhB,CAAiB","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport type { Ray, TrianglePickingPredicate } from \"../../Culling/ray\";\r\nimport { Buffer, VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { PickingInfo } from \"../../Collisions/pickingInfo\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Node } from \"../../node\";\r\nimport { DeepCopier } from \"../../Misc/deepCopier\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport { GreasedLineBaseMesh, type GreasedLineMeshOptions } from \"./greasedLineBaseMesh\";\r\n\r\nMesh._GreasedLineMeshParser = (parsedMesh: any, scene: Scene): Mesh => {\r\n return GreasedLineMesh.Parse(parsedMesh, scene);\r\n};\r\n\r\n/**\r\n * GreasedLineMesh\r\n * Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.\r\n */\r\nexport class GreasedLineMesh extends GreasedLineBaseMesh {\r\n private _previousAndSide: number[];\r\n private _nextAndCounters: number[];\r\n\r\n private static _V_START = new Vector3();\r\n private static _V_END = new Vector3();\r\n private static _V_OFFSET_START = new Vector3();\r\n private static _V_OFFSET_END = new Vector3();\r\n\r\n /**\r\n * Treshold used to pick the mesh\r\n */\r\n public intersectionThreshold = 0.1;\r\n\r\n /**\r\n * GreasedLineMesh\r\n * @param name name of the mesh\r\n * @param scene the scene\r\n * @param _options mesh options\r\n */\r\n constructor(public readonly name: string, scene: Scene, _options: GreasedLineMeshOptions) {\r\n super(name, scene, _options);\r\n\r\n this._previousAndSide = [];\r\n this._nextAndCounters = [];\r\n\r\n if (_options.points) {\r\n this.addPoints(GreasedLineTools.ConvertPoints(_options.points));\r\n }\r\n }\r\n\r\n /**\r\n * \"GreasedLineMesh\"\r\n * @returns \"GreasedLineMesh\"\r\n */\r\n public getClassName(): string {\r\n return \"GreasedLineMesh\";\r\n }\r\n\r\n protected _updateColorPointers() {\r\n if (this._options.colorPointers) {\r\n return;\r\n }\r\n\r\n let colorPointer = 0;\r\n this._colorPointers = [];\r\n this._points.forEach((p) => {\r\n for (let jj = 0; jj < p.length; jj += 3) {\r\n this._colorPointers.push(colorPointer);\r\n this._colorPointers.push(colorPointer++);\r\n }\r\n });\r\n }\r\n\r\n protected _updateWidths(): void {\r\n super._updateWidthsWithValue(0);\r\n }\r\n\r\n protected _setPoints(points: number[][]) {\r\n this._points = points;\r\n this._options.points = points;\r\n\r\n this._initGreasedLine();\r\n\r\n let indiceOffset = 0;\r\n\r\n points.forEach((p) => {\r\n const counters: number[] = [];\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n\r\n const totalLength = GreasedLineTools.GetLineLength(p);\r\n for (let j = 0, jj = 0; jj < p.length; j++, jj += 3) {\r\n const partialLine = p.slice(0, jj + 3);\r\n const partialLineLength = GreasedLineTools.GetLineLength(partialLine);\r\n const c = partialLineLength / totalLength;\r\n\r\n positions.push(p[jj], p[jj + 1], p[jj + 2]);\r\n positions.push(p[jj], p[jj + 1], p[jj + 2]);\r\n counters.push(c);\r\n counters.push(c);\r\n\r\n if (jj < p.length - 3) {\r\n const n = j * 2 + indiceOffset;\r\n indices.push(n, n + 1, n + 2);\r\n indices.push(n + 2, n + 1, n + 3);\r\n }\r\n }\r\n\r\n indiceOffset += (p.length / 3) * 2;\r\n\r\n const previous: number[] = [];\r\n const next: number[] = [];\r\n const side: number[] = [];\r\n let uvs: number[] = [];\r\n\r\n this._preprocess(positions, previous, next, side, uvs);\r\n\r\n for (const vp of positions) {\r\n this._vertexPositions.push(vp);\r\n }\r\n\r\n for (const i of indices) {\r\n this._indices.push(i);\r\n }\r\n\r\n for (let i = 0; i < side.length; i++) {\r\n this._previousAndSide.push(previous[i * 3], previous[i * 3 + 1], previous[i * 3 + 2], side[i]);\r\n this._nextAndCounters.push(next[i * 3], next[i * 3 + 1], next[i * 3 + 2], counters[i]);\r\n }\r\n\r\n uvs = this._options.uvs ?? uvs;\r\n for (const uv of uvs) {\r\n this._uvs.push(uv);\r\n }\r\n });\r\n\r\n if (!this._lazy) {\r\n if (!this._options.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._createVertexBuffers();\r\n this.refreshBoundingInfo();\r\n }\r\n }\r\n\r\n /**\r\n * Clones the GreasedLineMesh.\r\n * @param name new line name\r\n * @param newParent new parent node\r\n * @returns cloned line\r\n */\r\n public clone(name: string = `${this.name}-cloned`, newParent?: Nullable<Node>) {\r\n const lineOptions = this._createLineOptions();\r\n const deepCopiedLineOptions = {};\r\n DeepCopier.DeepCopy(lineOptions, deepCopiedLineOptions, [\"instance\"]);\r\n\r\n const cloned = new GreasedLineMesh(name, this._scene, <GreasedLineMeshOptions>deepCopiedLineOptions);\r\n if (newParent) {\r\n cloned.parent = newParent;\r\n }\r\n\r\n cloned.material = this.material;\r\n\r\n return cloned;\r\n }\r\n\r\n /**\r\n * Serializes this GreasedLineMesh\r\n * @param serializationObject object to write serialization to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.type = this.getClassName();\r\n\r\n serializationObject.lineOptions = this._createLineOptions();\r\n }\r\n\r\n /**\r\n * Parses a serialized GreasedLineMesh\r\n * @param parsedMesh the serialized GreasedLineMesh\r\n * @param scene the scene to create the GreasedLineMesh in\r\n * @returns the created GreasedLineMesh\r\n */\r\n public static Parse(parsedMesh: any, scene: Scene): Mesh {\r\n const lineOptions = <GreasedLineMeshOptions>parsedMesh.lineOptions;\r\n const name = <string>parsedMesh.name;\r\n const result = new GreasedLineMesh(name, scene, lineOptions);\r\n return result;\r\n }\r\n\r\n protected _initGreasedLine() {\r\n super._initGreasedLine();\r\n\r\n this._previousAndSide = [];\r\n this._nextAndCounters = [];\r\n }\r\n /**\r\n * Checks whether a ray is intersecting this GreasedLineMesh\r\n * @param ray ray to check the intersection of this mesh with\r\n * @param fastCheck not supported\r\n * @param trianglePredicate not supported\r\n * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)\r\n * @param worldToUse not supported\r\n * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check\r\n * @returns the picking info\r\n */\r\n public intersects(\r\n ray: Ray,\r\n fastCheck?: boolean,\r\n trianglePredicate?: TrianglePickingPredicate,\r\n onlyBoundingInfo = false,\r\n worldToUse?: Matrix,\r\n skipBoundingInfo = false\r\n ): PickingInfo {\r\n const pickingInfo = new PickingInfo();\r\n const intersections = this.findAllIntersections(ray, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo, true);\r\n if (intersections?.length === 1) {\r\n const intersection = intersections[0];\r\n pickingInfo.hit = true;\r\n pickingInfo.distance = intersection.distance;\r\n pickingInfo.ray = ray;\r\n pickingInfo.pickedMesh = this;\r\n pickingInfo.pickedPoint = intersection.point;\r\n }\r\n return pickingInfo;\r\n }\r\n\r\n /**\r\n * Gets all intersections of a ray and the line\r\n * @param ray Ray to check the intersection of this mesh with\r\n * @param _fastCheck not supported\r\n * @param _trianglePredicate not supported\r\n * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)\r\n * @param _worldToUse not supported\r\n * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check\r\n * @param firstOnly If true, the first and only intersection is immediatelly returned if found\r\n * @returns intersection(s)\r\n */\r\n public findAllIntersections(\r\n ray: Ray,\r\n _fastCheck?: boolean,\r\n _trianglePredicate?: TrianglePickingPredicate,\r\n onlyBoundingInfo = false,\r\n _worldToUse?: Matrix,\r\n skipBoundingInfo = false,\r\n firstOnly = false\r\n ): { distance: number; point: Vector3 }[] | undefined {\r\n if (onlyBoundingInfo && !skipBoundingInfo && ray.intersectsSphere(this._boundingSphere, this.intersectionThreshold) === false) {\r\n return;\r\n }\r\n\r\n const indices = this.getIndices();\r\n const positions = this.getVerticesData(VertexBuffer.PositionKind);\r\n const widths = this._widths;\r\n\r\n const lineWidth = this.greasedLineMaterial?.width ?? 1;\r\n\r\n const intersects = [];\r\n if (indices && positions && widths) {\r\n let i = 0,\r\n l = 0;\r\n for (i = 0, l = indices.length - 1; i < l; i += 3) {\r\n const a = indices[i];\r\n const b = indices[i + 1];\r\n\r\n GreasedLineMesh._V_START.fromArray(positions, a * 3);\r\n GreasedLineMesh._V_END.fromArray(positions, b * 3);\r\n\r\n if (this._offsets) {\r\n GreasedLineMesh._V_OFFSET_START.fromArray(this._offsets, a * 3);\r\n GreasedLineMesh._V_OFFSET_END.fromArray(this._offsets, b * 3);\r\n GreasedLineMesh._V_START.addInPlace(GreasedLineMesh._V_OFFSET_START);\r\n GreasedLineMesh._V_END.addInPlace(GreasedLineMesh._V_OFFSET_END);\r\n }\r\n\r\n const iFloored = Math.floor(i / 3);\r\n const width = widths[iFloored] !== undefined ? widths[iFloored] : 1;\r\n const precision = (this.intersectionThreshold * (lineWidth * width)) / 2;\r\n\r\n const distance = ray.intersectionSegment(GreasedLineMesh._V_START, GreasedLineMesh._V_END, precision);\r\n if (distance !== -1) {\r\n intersects.push({\r\n distance: distance,\r\n point: ray.direction.normalize().multiplyByFloats(distance, distance, distance).add(ray.origin),\r\n });\r\n if (firstOnly) {\r\n return intersects;\r\n }\r\n }\r\n }\r\n i = l;\r\n }\r\n\r\n return intersects;\r\n }\r\n\r\n private get _boundingSphere() {\r\n return this.getBoundingInfo().boundingSphere;\r\n }\r\n\r\n private static _CompareV3(positionIdx1: number, positionIdx2: number, positions: number[]) {\r\n const arrayIdx1 = positionIdx1 * 6;\r\n const arrayIdx2 = positionIdx2 * 6;\r\n return positions[arrayIdx1] === positions[arrayIdx2] && positions[arrayIdx1 + 1] === positions[arrayIdx2 + 1] && positions[arrayIdx1 + 2] === positions[arrayIdx2 + 2];\r\n }\r\n\r\n private static _CopyV3(positionIdx: number, positions: number[]) {\r\n const arrayIdx = positionIdx * 6;\r\n return [positions[arrayIdx], positions[arrayIdx + 1], positions[arrayIdx + 2]];\r\n }\r\n\r\n private _preprocess(positions: number[], previous: number[], next: number[], side: number[], uvs: number[]) {\r\n const l = positions.length / 6;\r\n\r\n let v: number[] = [];\r\n\r\n if (GreasedLineMesh._CompareV3(0, l - 1, positions)) {\r\n v = GreasedLineMesh._CopyV3(l - 2, positions);\r\n } else {\r\n v = GreasedLineMesh._CopyV3(0, positions);\r\n }\r\n previous.push(v[0], v[1], v[2]);\r\n previous.push(v[0], v[1], v[2]);\r\n\r\n for (let j = 0; j < l; j++) {\r\n side.push(1);\r\n side.push(-1);\r\n\r\n // uvs\r\n if (!this._options.uvs) {\r\n uvs.push(j / (l - 1), 0);\r\n uvs.push(j / (l - 1), 1);\r\n }\r\n\r\n if (j < l - 1) {\r\n v = GreasedLineMesh._CopyV3(j, positions);\r\n previous.push(v[0], v[1], v[2]);\r\n previous.push(v[0], v[1], v[2]);\r\n }\r\n if (j > 0) {\r\n v = GreasedLineMesh._CopyV3(j, positions);\r\n next.push(v[0], v[1], v[2]);\r\n next.push(v[0], v[1], v[2]);\r\n }\r\n }\r\n\r\n if (GreasedLineMesh._CompareV3(l - 1, 0, positions)) {\r\n v = GreasedLineMesh._CopyV3(1, positions);\r\n } else {\r\n v = GreasedLineMesh._CopyV3(l - 1, positions);\r\n }\r\n next.push(v[0], v[1], v[2]);\r\n next.push(v[0], v[1], v[2]);\r\n\r\n return {\r\n previous,\r\n next,\r\n uvs,\r\n side,\r\n };\r\n }\r\n\r\n protected _createVertexBuffers() {\r\n const vertexData = super._createVertexBuffers();\r\n\r\n const engine = this._scene.getEngine();\r\n\r\n const previousAndSideBuffer = new Buffer(engine, this._previousAndSide, false, 4);\r\n this.setVerticesBuffer(previousAndSideBuffer.createVertexBuffer(\"grl_previousAndSide\", 0, 4));\r\n\r\n const nextAndCountersBuffer = new Buffer(engine, this._nextAndCounters, false, 4);\r\n this.setVerticesBuffer(nextAndCountersBuffer.createVertexBuffer(\"grl_nextAndCounters\", 0, 4));\r\n\r\n const widthBuffer = new Buffer(engine, this._widths, this._updatable, 1);\r\n this.setVerticesBuffer(widthBuffer.createVertexBuffer(\"grl_widths\", 0, 1));\r\n this._widthsBuffer = widthBuffer;\r\n\r\n const colorPointersBuffer = new Buffer(engine, this._colorPointers, this._updatable, 1);\r\n this.setVerticesBuffer(colorPointersBuffer.createVertexBuffer(\"grl_colorPointers\", 0, 1));\r\n this._colorPointersBuffer = colorPointersBuffer;\r\n\r\n return vertexData;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Scene } from "../../scene";
|
|
2
|
+
import { Vector3 } from "../../Maths/math.vector";
|
|
3
|
+
import { Mesh } from "../mesh";
|
|
4
|
+
import type { Nullable } from "../../types";
|
|
5
|
+
import type { Node } from "../../node";
|
|
6
|
+
import type { GreasedLineMeshOptions } from "./greasedLineBaseMesh";
|
|
7
|
+
import { GreasedLineBaseMesh } from "./greasedLineBaseMesh";
|
|
8
|
+
/**
|
|
9
|
+
* GreasedLineRibbonMesh
|
|
10
|
+
* Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GreasedLineRibbonMesh extends GreasedLineBaseMesh {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Default line width
|
|
16
|
+
*/
|
|
17
|
+
static DEFAULT_WIDTH: number;
|
|
18
|
+
private static _RightHandedForwardReadOnlyQuaternion;
|
|
19
|
+
private static _LeftHandedForwardReadOnlyQuaternion;
|
|
20
|
+
private static _LeftReadOnlyQuaternion;
|
|
21
|
+
/**
|
|
22
|
+
* Direction which the line segment will be thickened if drawn on the XY plane
|
|
23
|
+
*/
|
|
24
|
+
static DIRECTION_XY: import("../../types").DeepImmutableObject<Vector3>;
|
|
25
|
+
/**
|
|
26
|
+
* Direction which the line segment will be thickened if drawn on the XZ plane
|
|
27
|
+
*/
|
|
28
|
+
static DIRECTION_XZ: import("../../types").DeepImmutableObject<Vector3>;
|
|
29
|
+
/**
|
|
30
|
+
* Direction which the line segment will be thickened if drawn on the YZ plane
|
|
31
|
+
*/
|
|
32
|
+
static DIRECTION_YZ: import("../../types").DeepImmutableObject<Vector3>;
|
|
33
|
+
private _paths;
|
|
34
|
+
private _pathsOptions;
|
|
35
|
+
private _vSegmentLengths;
|
|
36
|
+
private _uSegmentLengths;
|
|
37
|
+
private _vTotalLengths;
|
|
38
|
+
private _uTotalLengths;
|
|
39
|
+
private _counters;
|
|
40
|
+
private _slopes;
|
|
41
|
+
private _ribbonWidths;
|
|
42
|
+
/**
|
|
43
|
+
* GreasedLineRibbonMesh
|
|
44
|
+
* @param name name of the mesh
|
|
45
|
+
* @param scene the scene
|
|
46
|
+
* @param _options mesh options
|
|
47
|
+
* @param _pathOptions used internaly when parsing a serialized GreasedLineRibbonMesh
|
|
48
|
+
*/
|
|
49
|
+
constructor(name: string, scene: Scene, _options: GreasedLineMeshOptions, _pathOptions?: {
|
|
50
|
+
options: GreasedLineMeshOptions;
|
|
51
|
+
pathCount: number;
|
|
52
|
+
}[]);
|
|
53
|
+
/**
|
|
54
|
+
* Adds new points to the line. It doesn't rerenders the line if in lazy mode.
|
|
55
|
+
* @param points points table
|
|
56
|
+
*/
|
|
57
|
+
addPoints(points: number[][], options: GreasedLineMeshOptions, hasPathOptions?: boolean): void;
|
|
58
|
+
/**
|
|
59
|
+
* "GreasedLineRibbonMesh"
|
|
60
|
+
* @returns "GreasedLineRibbonMesh"
|
|
61
|
+
*/
|
|
62
|
+
getClassName(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Return true if the line was created from two edge paths or one points path.
|
|
65
|
+
* In this case the line is always flat.
|
|
66
|
+
*/
|
|
67
|
+
get isFlatLine(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the slopes of the line at each point relative to the center of the line
|
|
70
|
+
*/
|
|
71
|
+
get slopes(): number[];
|
|
72
|
+
/**
|
|
73
|
+
* Set the slopes of the line at each point relative to the center of the line
|
|
74
|
+
*/
|
|
75
|
+
set slopes(slopes: number[]);
|
|
76
|
+
protected _updateColorPointers(): void;
|
|
77
|
+
protected _updateWidths(): void;
|
|
78
|
+
protected _setPoints(points: number[][], _options: GreasedLineMeshOptions): void;
|
|
79
|
+
private static _GetDirectionPlanesFromDirectionsOption;
|
|
80
|
+
private static _CreateRibbonVertexData;
|
|
81
|
+
private _preprocess;
|
|
82
|
+
private static _ConvertToRibbonPath;
|
|
83
|
+
private static _GetDirectionFromPoints;
|
|
84
|
+
/**
|
|
85
|
+
* Clones the GreasedLineRibbonMesh.
|
|
86
|
+
* @param name new line name
|
|
87
|
+
* @param newParent new parent node
|
|
88
|
+
* @returns cloned line
|
|
89
|
+
*/
|
|
90
|
+
clone(name?: string, newParent?: Nullable<Node>): GreasedLineRibbonMesh;
|
|
91
|
+
/**
|
|
92
|
+
* Serializes this GreasedLineRibbonMesh
|
|
93
|
+
* @param serializationObject object to write serialization to
|
|
94
|
+
*/
|
|
95
|
+
serialize(serializationObject: any): void;
|
|
96
|
+
/**
|
|
97
|
+
* Parses a serialized GreasedLineRibbonMesh
|
|
98
|
+
* @param parsedMesh the serialized GreasedLineRibbonMesh
|
|
99
|
+
* @param scene the scene to create the GreasedLineRibbonMesh in
|
|
100
|
+
* @returns the created GreasedLineRibbonMesh
|
|
101
|
+
*/
|
|
102
|
+
static Parse(parsedMesh: any, scene: Scene): Mesh;
|
|
103
|
+
protected _initGreasedLine(): void;
|
|
104
|
+
private _calculateSegmentLengths;
|
|
105
|
+
private static _CalculateSlopes;
|
|
106
|
+
protected _createVertexBuffers(): import("..").VertexData;
|
|
107
|
+
}
|