@babylonjs/core 6.37.1 → 6.38.1
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/Behaviors/Meshes/baseSixDofDragBehavior.js +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +26 -6
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/skeleton.js +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.align.js +4 -1
- package/Buffers/buffer.align.js.map +1 -1
- package/Buffers/buffer.d.ts +10 -3
- package/Buffers/buffer.js +34 -5
- package/Buffers/buffer.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.d.ts +1 -3
- package/Engines/Extensions/engine.cubeTexture.js +1 -3
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +6 -17
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/ICanvas.d.ts +60 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/IPipelineContext.d.ts +3 -3
- package/Engines/IPipelineContext.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +4 -5
- package/Engines/Native/nativePipelineContext.js +2 -9
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/validatedNativeDataStream.d.ts +3 -0
- package/Engines/Native/validatedNativeDataStream.js +3 -0
- package/Engines/Native/validatedNativeDataStream.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +11 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +27 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +8 -4
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +3 -1
- package/Engines/WebGPU/webgpuConstants.js +2 -0
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +3 -0
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/engine.d.ts +10 -45
- package/Engines/nativeEngine.d.ts +3 -1
- package/Engines/nativeEngine.js +29 -30
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +7 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +3 -3
- package/Engines/thinEngine.js +16 -8
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -2
- package/Engines/webgpuEngine.js +7 -13
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +327 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +465 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +7 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +14 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +4 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +16 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +14 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphInteger.d.ts +62 -0
- package/FlowGraph/flowGraphInteger.js +76 -0
- package/FlowGraph/flowGraphInteger.js.map +1 -0
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +2 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +3 -3
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +2 -0
- package/FlowGraph/flowGraphRichTypes.js +5 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/serialization.js +8 -1
- package/FlowGraph/serialization.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +9 -2
- package/Gizmos/cameraGizmo.js +29 -10
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/shadowLight.d.ts +2 -2
- package/Lights/shadowLight.js +1 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.js +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +1 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +1 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +1 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +1 -0
- package/Materials/PBR/pbrMaterial.js +1 -0
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +1 -1
- package/Materials/Textures/baseTexture.js +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +5 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +1 -1
- package/Materials/Textures/multiRenderTarget.js +4 -4
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/videoTexture.js +2 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +1 -1
- package/Materials/materialPluginManager.js.map +1 -1
- package/Meshes/Node/Blocks/geometryArcTan2Block.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryArcTan2Block.js +81 -0
- package/Meshes/Node/Blocks/geometryArcTan2Block.js.map +1 -0
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +33 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js +101 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.js +76 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.js +90 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryModBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryModBlock.js +82 -0
- package/Meshes/Node/Blocks/geometryModBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.js +96 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryPowBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryPowBlock.js +82 -0
- package/Meshes/Node/Blocks/geometryPowBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js +91 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryStepBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryStepBlock.js +84 -0
- package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +19 -15
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +37 -17
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/index.d.ts +9 -0
- package/Meshes/Node/index.js +9 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/geometry.js +8 -5
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js +2 -2
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Navigation/INavigationEngine.d.ts +10 -1
- package/Navigation/INavigationEngine.js.map +1 -1
- package/Navigation/Plugins/recastJSPlugin.d.ts +20 -0
- package/Navigation/Plugins/recastJSPlugin.js +43 -8
- package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +5 -0
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -0
- package/Particles/gpuParticleSystem.js +10 -3
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Physics/v2/ragdoll.js +4 -0
- package/Physics/v2/ragdoll.js.map +1 -1
- package/Rendering/GaussianSplatting/gaussianSplatting.d.ts +6 -0
- package/Rendering/GaussianSplatting/gaussianSplatting.js +124 -39
- package/Rendering/GaussianSplatting/gaussianSplatting.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSM.d.ts +54 -0
- package/Rendering/GlobalIllumination/giRSM.js +54 -0
- package/Rendering/GlobalIllumination/giRSM.js.map +1 -0
- package/Rendering/GlobalIllumination/giRSMManager.d.ts +256 -0
- package/Rendering/GlobalIllumination/giRSMManager.js +715 -0
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -0
- package/Rendering/GlobalIllumination/index.d.ts +2 -0
- package/Rendering/GlobalIllumination/index.js +3 -0
- package/Rendering/GlobalIllumination/index.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderer.js +20 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/index.d.ts +2 -0
- package/Rendering/index.js +2 -0
- package/Rendering/index.js.map +1 -1
- package/Rendering/prePassRendererSceneComponent.js +1 -4
- package/Rendering/prePassRendererSceneComponent.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +152 -0
- package/Rendering/reflectiveShadowMap.js +389 -0
- package/Rendering/reflectiveShadowMap.js.map +1 -0
- package/Shaders/bilateralBlur.fragment.d.ts +5 -0
- package/Shaders/bilateralBlur.fragment.js +20 -0
- package/Shaders/bilateralBlur.fragment.js.map +1 -0
- package/Shaders/bilateralBlurQuality.fragment.d.ts +5 -0
- package/Shaders/bilateralBlurQuality.fragment.js +20 -0
- package/Shaders/bilateralBlurQuality.fragment.js.map +1 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.d.ts +5 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.js +28 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.js.map +1 -0
- package/Shaders/rsmGlobalIllumination.fragment.d.ts +5 -0
- package/Shaders/rsmGlobalIllumination.fragment.js +33 -0
- package/Shaders/rsmGlobalIllumination.fragment.js.map +1 -0
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +9 -1
- package/XR/features/WebXRControllerTeleportation.js +3 -0
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/webXRCamera.d.ts +2 -0
- package/XR/webXRCamera.js +2 -0
- package/XR/webXRCamera.js.map +1 -1
- package/node.d.ts +3 -0
- package/node.js +3 -0
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +1 -1
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +0 -60
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +0 -104
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinInstanceMesh.js","sourceRoot":"","sources":["../../../../dev/core/src/Meshes/thinInstanceMesh.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mCAAkC;AA6GzD,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,MAAwE,EAAE,UAAmB,IAAI;IACxI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,eAAe,EAAE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AAI,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,0CAAE,OAAO,EAAE,CAAC;YAEpE,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;YACvD,IAAI,CAAC,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;YAC3D,IAAI,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YAErI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAE,CAAC,CAAC;SACrF;KACJ;AACL,CAAC,CAAC;AAEF,IAAI,CAAC,SAAS,CAAC,kCAAkC,GAAG;IAChD,IAAI,CAAC,IAAI,CAAC,+BAA+B,EAAE;QACvC,IAAI,CAAC,+BAA+B,GAAG;YACnC,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,EAAE;YACjB,OAAO,EAAE,EAAE;SACd,CAAC;KACL;AACL,CAAC,CAAC;AAEF,IAAI,CAAC,SAAS,CAAC,gCAAgC,GAAG;;IAC9C,IAAI,MAAA,IAAI,CAAC,wBAAwB,0CAAE,YAAY,EAAE;QAC7C,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QACrD,IAAI,CAAC,wBAAwB,CAAC,YAAY,GAAG,IAAI,CAAC;KACrD;AACL,CAAC,CAAC","sourcesContent":["import type { Nullable, DeepImmutableObject } from \"../types\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { VertexBuffer, Buffer } from \"../Buffers/buffer\";\r\nimport { Matrix, Vector3, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { BoundingInfo } from \"core/Culling/boundingInfo\";\r\n\r\ndeclare module \"./mesh\" {\r\n export interface Mesh {\r\n /**\r\n * Gets or sets a boolean defining if we want picking to pick thin instances as well\r\n */\r\n thinInstanceEnablePicking: boolean;\r\n /**\r\n * Creates a new thin instance\r\n * @param matrix the matrix or array of matrices (position, rotation, scale) of the thin instance(s) to create\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n * @returns the thin instance index number. If you pass an array of matrices, other instance indexes are index+1, index+2, etc\r\n */\r\n thinInstanceAdd(matrix: DeepImmutableObject<Matrix> | Array<DeepImmutableObject<Matrix>>, refresh?: boolean): number;\r\n\r\n /**\r\n * Adds the transformation (matrix) of the current mesh as a thin instance\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n * @returns the thin instance index number\r\n */\r\n thinInstanceAddSelf(refresh?: boolean): number;\r\n\r\n /**\r\n * Registers a custom attribute to be used with thin instances\r\n * @param kind name of the attribute\r\n * @param stride size in floats of the attribute\r\n */\r\n thinInstanceRegisterAttribute(kind: string, stride: number): void;\r\n\r\n /**\r\n * Sets the matrix of a thin instance\r\n * @param index index of the thin instance\r\n * @param matrix matrix to set\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n */\r\n thinInstanceSetMatrixAt(index: number, matrix: DeepImmutableObject<Matrix>, refresh?: boolean): void;\r\n\r\n /**\r\n * Sets the value of a custom attribute for a thin instance\r\n * @param kind name of the attribute\r\n * @param index index of the thin instance\r\n * @param value value to set\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n */\r\n thinInstanceSetAttributeAt(kind: string, index: number, value: Array<number>, refresh?: boolean): void;\r\n\r\n /**\r\n * Gets / sets the number of thin instances to display. Note that you can't set a number higher than what the underlying buffer can handle.\r\n */\r\n thinInstanceCount: number;\r\n\r\n /**\r\n * Sets a buffer to be used with thin instances. This method is a faster way to setup multiple instances than calling thinInstanceAdd repeatedly\r\n * @param kind name of the attribute. Use \"matrix\" to setup the buffer of matrices\r\n * @param buffer buffer to set\r\n * @param stride size in floats of each value of the buffer\r\n * @param staticBuffer indicates that the buffer is static, so that you won't change it after it is set (better performances - false by default)\r\n */\r\n thinInstanceSetBuffer(kind: string, buffer: Nullable<Float32Array>, stride?: number, staticBuffer?: boolean): void;\r\n\r\n /**\r\n * Gets the list of world matrices\r\n * @returns an array containing all the world matrices from the thin instances\r\n */\r\n thinInstanceGetWorldMatrices(): Matrix[];\r\n\r\n /**\r\n * Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer\r\n * @param kind name of the attribute to update. Use \"matrix\" to update the buffer of matrices\r\n */\r\n thinInstanceBufferUpdated(kind: string): void;\r\n\r\n /**\r\n * Applies a partial update to a buffer directly on the GPU\r\n * Note that the buffer located on the CPU is NOT updated! It's up to you to update it (or not) with the same data you pass to this method\r\n * @param kind name of the attribute to update. Use \"matrix\" to update the buffer of matrices\r\n * @param data the data to set in the GPU buffer\r\n * @param offset the offset in the GPU buffer where to update the data\r\n */\r\n thinInstancePartialBufferUpdate(kind: string, data: Float32Array, offset: number): void;\r\n\r\n /**\r\n * Refreshes the bounding info, taking into account all the thin instances defined\r\n * @param forceRefreshParentInfo true to force recomputing the mesh bounding info and use it to compute the aggregated bounding info\r\n * @param applySkeleton defines whether to apply the skeleton before computing the bounding info\r\n * @param applyMorph defines whether to apply the morph target before computing the bounding info\r\n */\r\n thinInstanceRefreshBoundingInfo(forceRefreshParentInfo?: boolean, applySkeleton?: boolean, applyMorph?: boolean): void;\r\n\r\n /** @internal */\r\n _thinInstanceInitializeUserStorage(): void;\r\n\r\n /** @internal */\r\n _thinInstanceUpdateBufferSize(kind: string, numInstances?: number): void;\r\n\r\n /** @internal */\r\n _thinInstanceCreateMatrixBuffer(kind: string, buffer: Nullable<Float32Array>, staticBuffer: boolean): Buffer;\r\n\r\n /** @internal */\r\n _userThinInstanceBuffersStorage: {\r\n data: { [key: string]: Float32Array };\r\n sizes: { [key: string]: number };\r\n vertexBuffers: { [key: string]: Nullable<VertexBuffer> };\r\n strides: { [key: string]: number };\r\n };\r\n }\r\n}\r\n\r\nMesh.prototype.thinInstanceAdd = function (matrix: DeepImmutableObject<Matrix> | Array<DeepImmutableObject<Matrix>>, refresh: boolean = true): number {\r\n if (!this.getScene().getEngine().getCaps().instancedArrays) {\r\n Logger.Error(\"Thin Instances are not supported on this device as Instanced Array extension not supported\");\r\n return -1;\r\n }\r\n\r\n this._thinInstanceUpdateBufferSize(\"matrix\", Array.isArray(matrix) ? matrix.length : 1);\r\n\r\n const index = this._thinInstanceDataStorage.instancesCount;\r\n\r\n if (Array.isArray(matrix)) {\r\n for (let i = 0; i < matrix.length; ++i) {\r\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh);\r\n }\r\n } else {\r\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh);\r\n }\r\n\r\n return index;\r\n};\r\n\r\nMesh.prototype.thinInstanceAddSelf = function (refresh: boolean = true): number {\r\n return this.thinInstanceAdd(Matrix.IdentityReadOnly, refresh);\r\n};\r\n\r\nMesh.prototype.thinInstanceRegisterAttribute = function (kind: string, stride: number): void {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n this.removeVerticesData(kind);\r\n\r\n this._thinInstanceInitializeUserStorage();\r\n\r\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); // Initial size\r\n this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]);\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n};\r\n\r\nMesh.prototype.thinInstanceSetMatrixAt = function (index: number, matrix: DeepImmutableObject<Matrix>, refresh: boolean = true): boolean {\r\n if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) {\r\n return false;\r\n }\r\n\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n matrix.copyToArray(matrixData, index * 16);\r\n\r\n if (this._thinInstanceDataStorage.worldMatrices) {\r\n this._thinInstanceDataStorage.worldMatrices[index] = matrix as Matrix;\r\n }\r\n\r\n if (refresh) {\r\n this.thinInstanceBufferUpdated(\"matrix\");\r\n\r\n if (!this.doNotSyncBoundingInfo) {\r\n this.thinInstanceRefreshBoundingInfo(false);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nMesh.prototype.thinInstanceSetAttributeAt = function (kind: string, index: number, value: Array<number>, refresh: boolean = true): boolean {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) {\r\n return false;\r\n }\r\n\r\n this._thinInstanceUpdateBufferSize(kind, 0); // make sur the buffer for the kind attribute is big enough\r\n\r\n this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]);\r\n\r\n if (refresh) {\r\n this.thinInstanceBufferUpdated(kind);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nObject.defineProperty(Mesh.prototype, \"thinInstanceCount\", {\r\n get: function (this: Mesh) {\r\n return this._thinInstanceDataStorage.instancesCount;\r\n },\r\n set: function (this: Mesh, value: number) {\r\n const matrixData = this._thinInstanceDataStorage.matrixData ?? this.source?._thinInstanceDataStorage.matrixData;\r\n const numMaxInstances = matrixData ? matrixData.length / 16 : 0;\r\n\r\n if (value <= numMaxInstances) {\r\n this._thinInstanceDataStorage.instancesCount = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nMesh.prototype._thinInstanceCreateMatrixBuffer = function (kind: string, buffer: Float32Array, staticBuffer: boolean = false): Buffer {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n const matrixBuffer = new Buffer(this.getEngine(), buffer, !staticBuffer, 16, false, true);\r\n\r\n for (let i = 0; i < 4; i++) {\r\n this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4));\r\n }\r\n\r\n return matrixBuffer;\r\n};\r\n\r\nMesh.prototype.thinInstanceSetBuffer = function (kind: string, buffer: Nullable<Float32Array>, stride: number = 0, staticBuffer: boolean = false): void {\r\n stride = stride || 16;\r\n\r\n if (kind === \"matrix\") {\r\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = null;\r\n this._thinInstanceDataStorage.matrixBufferSize = buffer ? buffer.length : 32 * stride;\r\n this._thinInstanceDataStorage.matrixData = buffer;\r\n this._thinInstanceDataStorage.worldMatrices = null;\r\n\r\n if (buffer !== null) {\r\n this._thinInstanceDataStorage.instancesCount = buffer.length / stride;\r\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", buffer, staticBuffer);\r\n\r\n if (!this.doNotSyncBoundingInfo) {\r\n this.thinInstanceRefreshBoundingInfo(false);\r\n }\r\n } else {\r\n this._thinInstanceDataStorage.instancesCount = 0;\r\n if (!this.doNotSyncBoundingInfo) {\r\n // mesh has no more thin instances, so need to recompute the bounding box because it's the regular mesh that will now be displayed\r\n this.refreshBoundingInfo();\r\n }\r\n }\r\n } else if (kind === \"previousMatrix\") {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.previousMatrixBuffer = null;\r\n this._thinInstanceDataStorage.previousMatrixData = buffer;\r\n if (buffer !== null) {\r\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", buffer, staticBuffer);\r\n }\r\n } else {\r\n // color for instanced mesh is ColorInstanceKind and not ColorKind because of native that needs to do the differenciation\r\n // hot switching kind here to preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (buffer === null) {\r\n if (this._userThinInstanceBuffersStorage?.data[kind]) {\r\n this.removeVerticesData(kind);\r\n delete this._userThinInstanceBuffersStorage.data[kind];\r\n delete this._userThinInstanceBuffersStorage.strides[kind];\r\n delete this._userThinInstanceBuffersStorage.sizes[kind];\r\n delete this._userThinInstanceBuffersStorage.vertexBuffers[kind];\r\n }\r\n } else {\r\n this._thinInstanceInitializeUserStorage();\r\n\r\n this._userThinInstanceBuffersStorage.data[kind] = buffer;\r\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = buffer.length;\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), buffer, kind, !staticBuffer, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstanceBufferUpdated = function (kind: string): void {\r\n if (kind === \"matrix\") {\r\n this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData!, 0, this._thinInstanceDataStorage.instancesCount);\r\n } else if (kind === \"previousMatrix\") {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData!, 0, this._thinInstanceDataStorage.instancesCount);\r\n } else {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]!.updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstancePartialBufferUpdate = function (kind: string, data: Float32Array, offset: number): void {\r\n if (kind === \"matrix\") {\r\n if (this._thinInstanceDataStorage.matrixBuffer) {\r\n this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset);\r\n }\r\n } else {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]!.updateDirectly(data, offset);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstanceGetWorldMatrices = function (): Matrix[] {\r\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\r\n return [];\r\n }\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n if (!this._thinInstanceDataStorage.worldMatrices) {\r\n this._thinInstanceDataStorage.worldMatrices = [] as Matrix[];\r\n\r\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\r\n this._thinInstanceDataStorage.worldMatrices[i] = Matrix.FromArray(matrixData, i * 16);\r\n }\r\n }\r\n\r\n return this._thinInstanceDataStorage.worldMatrices;\r\n};\r\n\r\nMesh.prototype.thinInstanceRefreshBoundingInfo = function (forceRefreshParentInfo: boolean = false, applySkeleton: boolean = false, applyMorph: boolean = false) {\r\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\r\n return;\r\n }\r\n\r\n const vectors = this._thinInstanceDataStorage.boundingVectors;\r\n\r\n if (forceRefreshParentInfo || !this.rawBoundingInfo) {\r\n vectors.length = 0;\r\n this.refreshBoundingInfo(applySkeleton, applyMorph);\r\n const boundingInfo = this.getBoundingInfo();\r\n this.rawBoundingInfo = new BoundingInfo(boundingInfo.minimum, boundingInfo.maximum);\r\n }\r\n\r\n const boundingInfo = this.getBoundingInfo();\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n if (vectors.length === 0) {\r\n for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) {\r\n vectors.push(boundingInfo.boundingBox.vectors[v].clone());\r\n }\r\n }\r\n\r\n TmpVectors.Vector3[0].setAll(Number.POSITIVE_INFINITY); // min\r\n TmpVectors.Vector3[1].setAll(Number.NEGATIVE_INFINITY); // max\r\n\r\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\r\n Matrix.FromArrayToRef(matrixData, i * 16, TmpVectors.Matrix[0]);\r\n\r\n for (let v = 0; v < vectors.length; ++v) {\r\n Vector3.TransformCoordinatesToRef(vectors[v], TmpVectors.Matrix[0], TmpVectors.Vector3[2]);\r\n TmpVectors.Vector3[0].minimizeInPlace(TmpVectors.Vector3[2]);\r\n TmpVectors.Vector3[1].maximizeInPlace(TmpVectors.Vector3[2]);\r\n }\r\n }\r\n\r\n boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]);\r\n\r\n this._updateBoundingInfo();\r\n};\r\n\r\nMesh.prototype._thinInstanceUpdateBufferSize = function (kind: string, numInstances: number = 1) {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n const kindIsMatrix = kind === \"matrix\";\r\n\r\n if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) {\r\n return;\r\n }\r\n\r\n const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind];\r\n const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind];\r\n let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind];\r\n\r\n const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride;\r\n\r\n let newSize = currentSize;\r\n\r\n while (newSize < bufferSize) {\r\n newSize *= 2;\r\n }\r\n\r\n if (!data || currentSize != newSize) {\r\n if (!data) {\r\n data = new Float32Array(newSize);\r\n } else {\r\n const newData = new Float32Array(newSize);\r\n newData.set(data, 0);\r\n data = newData;\r\n }\r\n\r\n if (kindIsMatrix) {\r\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", data, false);\r\n this._thinInstanceDataStorage.matrixData = data;\r\n this._thinInstanceDataStorage.matrixBufferSize = newSize;\r\n if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", data, false);\r\n }\r\n } else {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();\r\n\r\n this._userThinInstanceBuffersStorage.data[kind] = data;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = newSize;\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), data, kind, true, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype._thinInstanceInitializeUserStorage = function () {\r\n if (!this._userThinInstanceBuffersStorage) {\r\n this._userThinInstanceBuffersStorage = {\r\n data: {},\r\n sizes: {},\r\n vertexBuffers: {},\r\n strides: {},\r\n };\r\n }\r\n};\r\n\r\nMesh.prototype._disposeThinInstanceSpecificData = function () {\r\n if (this._thinInstanceDataStorage?.matrixBuffer) {\r\n this._thinInstanceDataStorage.matrixBuffer.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = null;\r\n }\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"thinInstanceMesh.js","sourceRoot":"","sources":["../../../../dev/core/src/Meshes/thinInstanceMesh.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mCAAkC;AA6GzD,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,MAAwE,EAAE,UAAmB,IAAI;IACxI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,eAAe,EAAE;QACxD,MAAM,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAC;QAC3G,OAAO,CAAC,CAAC,CAAC;KACb;IAED,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAExF,MAAM,KAAK,GAAG,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC;IAE3D,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACpC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,wBAAwB,CAAC,cAAc,EAAE,EAAE,MAAM,CA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AEF,IAAI,CAAC,SAAS,CAAC,kCAAkC,GAAG;IAChD,IAAI,CAAC,IAAI,CAAC,+BAA+B,EAAE;QACvC,IAAI,CAAC,+BAA+B,GAAG;YACnC,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,EAAE;YACjB,OAAO,EAAE,EAAE;SACd,CAAC;KACL;AACL,CAAC,CAAC;AAEF,IAAI,CAAC,SAAS,CAAC,gCAAgC,GAAG;;IAC9C,IAAI,MAAA,IAAI,CAAC,wBAAwB,0CAAE,YAAY,EAAE;QAC7C,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QACrD,IAAI,CAAC,wBAAwB,CAAC,YAAY,GAAG,IAAI,CAAC;KACrD;AACL,CAAC,CAAC","sourcesContent":["import type { Nullable, DeepImmutableObject } from \"../types\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { VertexBuffer, Buffer } from \"../Buffers/buffer\";\r\nimport { Matrix, Vector3, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { BoundingInfo } from \"core/Culling/boundingInfo\";\r\n\r\ndeclare module \"./mesh\" {\r\n export interface Mesh {\r\n /**\r\n * Gets or sets a boolean defining if we want picking to pick thin instances as well\r\n */\r\n thinInstanceEnablePicking: boolean;\r\n /**\r\n * Creates a new thin instance\r\n * @param matrix the matrix or array of matrices (position, rotation, scale) of the thin instance(s) to create\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n * @returns the thin instance index number. If you pass an array of matrices, other instance indexes are index+1, index+2, etc\r\n */\r\n thinInstanceAdd(matrix: DeepImmutableObject<Matrix> | Array<DeepImmutableObject<Matrix>>, refresh?: boolean): number;\r\n\r\n /**\r\n * Adds the transformation (matrix) of the current mesh as a thin instance\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n * @returns the thin instance index number\r\n */\r\n thinInstanceAddSelf(refresh?: boolean): number;\r\n\r\n /**\r\n * Registers a custom attribute to be used with thin instances\r\n * @param kind name of the attribute\r\n * @param stride size in floats of the attribute\r\n */\r\n thinInstanceRegisterAttribute(kind: string, stride: number): void;\r\n\r\n /**\r\n * Sets the matrix of a thin instance\r\n * @param index index of the thin instance\r\n * @param matrix matrix to set\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n */\r\n thinInstanceSetMatrixAt(index: number, matrix: DeepImmutableObject<Matrix>, refresh?: boolean): void;\r\n\r\n /**\r\n * Sets the value of a custom attribute for a thin instance\r\n * @param kind name of the attribute\r\n * @param index index of the thin instance\r\n * @param value value to set\r\n * @param refresh true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance\r\n */\r\n thinInstanceSetAttributeAt(kind: string, index: number, value: Array<number>, refresh?: boolean): void;\r\n\r\n /**\r\n * Gets / sets the number of thin instances to display. Note that you can't set a number higher than what the underlying buffer can handle.\r\n */\r\n thinInstanceCount: number;\r\n\r\n /**\r\n * Sets a buffer to be used with thin instances. This method is a faster way to setup multiple instances than calling thinInstanceAdd repeatedly\r\n * @param kind name of the attribute. Use \"matrix\" to setup the buffer of matrices\r\n * @param buffer buffer to set\r\n * @param stride size in floats of each value of the buffer\r\n * @param staticBuffer indicates that the buffer is static, so that you won't change it after it is set (better performances - true by default)\r\n */\r\n thinInstanceSetBuffer(kind: string, buffer: Nullable<Float32Array>, stride?: number, staticBuffer?: boolean): void;\r\n\r\n /**\r\n * Gets the list of world matrices\r\n * @returns an array containing all the world matrices from the thin instances\r\n */\r\n thinInstanceGetWorldMatrices(): Matrix[];\r\n\r\n /**\r\n * Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer\r\n * @param kind name of the attribute to update. Use \"matrix\" to update the buffer of matrices\r\n */\r\n thinInstanceBufferUpdated(kind: string): void;\r\n\r\n /**\r\n * Applies a partial update to a buffer directly on the GPU\r\n * Note that the buffer located on the CPU is NOT updated! It's up to you to update it (or not) with the same data you pass to this method\r\n * @param kind name of the attribute to update. Use \"matrix\" to update the buffer of matrices\r\n * @param data the data to set in the GPU buffer\r\n * @param offset the offset in the GPU buffer where to update the data\r\n */\r\n thinInstancePartialBufferUpdate(kind: string, data: Float32Array, offset: number): void;\r\n\r\n /**\r\n * Refreshes the bounding info, taking into account all the thin instances defined\r\n * @param forceRefreshParentInfo true to force recomputing the mesh bounding info and use it to compute the aggregated bounding info\r\n * @param applySkeleton defines whether to apply the skeleton before computing the bounding info\r\n * @param applyMorph defines whether to apply the morph target before computing the bounding info\r\n */\r\n thinInstanceRefreshBoundingInfo(forceRefreshParentInfo?: boolean, applySkeleton?: boolean, applyMorph?: boolean): void;\r\n\r\n /** @internal */\r\n _thinInstanceInitializeUserStorage(): void;\r\n\r\n /** @internal */\r\n _thinInstanceUpdateBufferSize(kind: string, numInstances?: number): void;\r\n\r\n /** @internal */\r\n _thinInstanceCreateMatrixBuffer(kind: string, buffer: Nullable<Float32Array>, staticBuffer: boolean): Buffer;\r\n\r\n /** @internal */\r\n _userThinInstanceBuffersStorage: {\r\n data: { [key: string]: Float32Array };\r\n sizes: { [key: string]: number };\r\n vertexBuffers: { [key: string]: Nullable<VertexBuffer> };\r\n strides: { [key: string]: number };\r\n };\r\n }\r\n}\r\n\r\nMesh.prototype.thinInstanceAdd = function (matrix: DeepImmutableObject<Matrix> | Array<DeepImmutableObject<Matrix>>, refresh: boolean = true): number {\r\n if (!this.getScene().getEngine().getCaps().instancedArrays) {\r\n Logger.Error(\"Thin Instances are not supported on this device as Instanced Array extension not supported\");\r\n return -1;\r\n }\r\n\r\n this._thinInstanceUpdateBufferSize(\"matrix\", Array.isArray(matrix) ? matrix.length : 1);\r\n\r\n const index = this._thinInstanceDataStorage.instancesCount;\r\n\r\n if (Array.isArray(matrix)) {\r\n for (let i = 0; i < matrix.length; ++i) {\r\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh);\r\n }\r\n } else {\r\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh);\r\n }\r\n\r\n return index;\r\n};\r\n\r\nMesh.prototype.thinInstanceAddSelf = function (refresh: boolean = true): number {\r\n return this.thinInstanceAdd(Matrix.IdentityReadOnly, refresh);\r\n};\r\n\r\nMesh.prototype.thinInstanceRegisterAttribute = function (kind: string, stride: number): void {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n this.removeVerticesData(kind);\r\n\r\n this._thinInstanceInitializeUserStorage();\r\n\r\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); // Initial size\r\n this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]);\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n};\r\n\r\nMesh.prototype.thinInstanceSetMatrixAt = function (index: number, matrix: DeepImmutableObject<Matrix>, refresh: boolean = true): boolean {\r\n if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) {\r\n return false;\r\n }\r\n\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n matrix.copyToArray(matrixData, index * 16);\r\n\r\n if (this._thinInstanceDataStorage.worldMatrices) {\r\n this._thinInstanceDataStorage.worldMatrices[index] = matrix as Matrix;\r\n }\r\n\r\n if (refresh) {\r\n this.thinInstanceBufferUpdated(\"matrix\");\r\n\r\n if (!this.doNotSyncBoundingInfo) {\r\n this.thinInstanceRefreshBoundingInfo(false);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nMesh.prototype.thinInstanceSetAttributeAt = function (kind: string, index: number, value: Array<number>, refresh: boolean = true): boolean {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) {\r\n return false;\r\n }\r\n\r\n this._thinInstanceUpdateBufferSize(kind, 0); // make sur the buffer for the kind attribute is big enough\r\n\r\n this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]);\r\n\r\n if (refresh) {\r\n this.thinInstanceBufferUpdated(kind);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nObject.defineProperty(Mesh.prototype, \"thinInstanceCount\", {\r\n get: function (this: Mesh) {\r\n return this._thinInstanceDataStorage.instancesCount;\r\n },\r\n set: function (this: Mesh, value: number) {\r\n const matrixData = this._thinInstanceDataStorage.matrixData ?? this.source?._thinInstanceDataStorage.matrixData;\r\n const numMaxInstances = matrixData ? matrixData.length / 16 : 0;\r\n\r\n if (value <= numMaxInstances) {\r\n this._thinInstanceDataStorage.instancesCount = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nMesh.prototype._thinInstanceCreateMatrixBuffer = function (kind: string, buffer: Float32Array, staticBuffer: boolean = true): Buffer {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n const matrixBuffer = new Buffer(this.getEngine(), buffer, !staticBuffer, 16, false, true);\r\n\r\n for (let i = 0; i < 4; i++) {\r\n this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4));\r\n }\r\n\r\n return matrixBuffer;\r\n};\r\n\r\nMesh.prototype.thinInstanceSetBuffer = function (kind: string, buffer: Nullable<Float32Array>, stride: number = 0, staticBuffer: boolean = true): void {\r\n stride = stride || 16;\r\n\r\n if (kind === \"matrix\") {\r\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = null;\r\n this._thinInstanceDataStorage.matrixBufferSize = buffer ? buffer.length : 32 * stride;\r\n this._thinInstanceDataStorage.matrixData = buffer;\r\n this._thinInstanceDataStorage.worldMatrices = null;\r\n\r\n if (buffer !== null) {\r\n this._thinInstanceDataStorage.instancesCount = buffer.length / stride;\r\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", buffer, staticBuffer);\r\n\r\n if (!this.doNotSyncBoundingInfo) {\r\n this.thinInstanceRefreshBoundingInfo(false);\r\n }\r\n } else {\r\n this._thinInstanceDataStorage.instancesCount = 0;\r\n if (!this.doNotSyncBoundingInfo) {\r\n // mesh has no more thin instances, so need to recompute the bounding box because it's the regular mesh that will now be displayed\r\n this.refreshBoundingInfo();\r\n }\r\n }\r\n } else if (kind === \"previousMatrix\") {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.previousMatrixBuffer = null;\r\n this._thinInstanceDataStorage.previousMatrixData = buffer;\r\n if (buffer !== null) {\r\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", buffer, staticBuffer);\r\n }\r\n } else {\r\n // color for instanced mesh is ColorInstanceKind and not ColorKind because of native that needs to do the differenciation\r\n // hot switching kind here to preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (buffer === null) {\r\n if (this._userThinInstanceBuffersStorage?.data[kind]) {\r\n this.removeVerticesData(kind);\r\n delete this._userThinInstanceBuffersStorage.data[kind];\r\n delete this._userThinInstanceBuffersStorage.strides[kind];\r\n delete this._userThinInstanceBuffersStorage.sizes[kind];\r\n delete this._userThinInstanceBuffersStorage.vertexBuffers[kind];\r\n }\r\n } else {\r\n this._thinInstanceInitializeUserStorage();\r\n\r\n this._userThinInstanceBuffersStorage.data[kind] = buffer;\r\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = buffer.length;\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), buffer, kind, !staticBuffer, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstanceBufferUpdated = function (kind: string): void {\r\n if (kind === \"matrix\") {\r\n this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData!, 0, this._thinInstanceDataStorage.instancesCount);\r\n } else if (kind === \"previousMatrix\") {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData!, 0, this._thinInstanceDataStorage.instancesCount);\r\n } else {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]!.updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstancePartialBufferUpdate = function (kind: string, data: Float32Array, offset: number): void {\r\n if (kind === \"matrix\") {\r\n if (this._thinInstanceDataStorage.matrixBuffer) {\r\n this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset);\r\n }\r\n } else {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]!.updateDirectly(data, offset);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype.thinInstanceGetWorldMatrices = function (): Matrix[] {\r\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\r\n return [];\r\n }\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n if (!this._thinInstanceDataStorage.worldMatrices) {\r\n this._thinInstanceDataStorage.worldMatrices = [] as Matrix[];\r\n\r\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\r\n this._thinInstanceDataStorage.worldMatrices[i] = Matrix.FromArray(matrixData, i * 16);\r\n }\r\n }\r\n\r\n return this._thinInstanceDataStorage.worldMatrices;\r\n};\r\n\r\nMesh.prototype.thinInstanceRefreshBoundingInfo = function (forceRefreshParentInfo: boolean = false, applySkeleton: boolean = false, applyMorph: boolean = false) {\r\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\r\n return;\r\n }\r\n\r\n const vectors = this._thinInstanceDataStorage.boundingVectors;\r\n\r\n if (forceRefreshParentInfo || !this.rawBoundingInfo) {\r\n vectors.length = 0;\r\n this.refreshBoundingInfo(applySkeleton, applyMorph);\r\n const boundingInfo = this.getBoundingInfo();\r\n this.rawBoundingInfo = new BoundingInfo(boundingInfo.minimum, boundingInfo.maximum);\r\n }\r\n\r\n const boundingInfo = this.getBoundingInfo();\r\n const matrixData = this._thinInstanceDataStorage.matrixData;\r\n\r\n if (vectors.length === 0) {\r\n for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) {\r\n vectors.push(boundingInfo.boundingBox.vectors[v].clone());\r\n }\r\n }\r\n\r\n TmpVectors.Vector3[0].setAll(Number.POSITIVE_INFINITY); // min\r\n TmpVectors.Vector3[1].setAll(Number.NEGATIVE_INFINITY); // max\r\n\r\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\r\n Matrix.FromArrayToRef(matrixData, i * 16, TmpVectors.Matrix[0]);\r\n\r\n for (let v = 0; v < vectors.length; ++v) {\r\n Vector3.TransformCoordinatesToRef(vectors[v], TmpVectors.Matrix[0], TmpVectors.Vector3[2]);\r\n TmpVectors.Vector3[0].minimizeInPlace(TmpVectors.Vector3[2]);\r\n TmpVectors.Vector3[1].maximizeInPlace(TmpVectors.Vector3[2]);\r\n }\r\n }\r\n\r\n boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]);\r\n\r\n this._updateBoundingInfo();\r\n};\r\n\r\nMesh.prototype._thinInstanceUpdateBufferSize = function (kind: string, numInstances: number = 1) {\r\n // preserve backward compatibility\r\n if (kind === VertexBuffer.ColorKind) {\r\n kind = VertexBuffer.ColorInstanceKind;\r\n }\r\n\r\n const kindIsMatrix = kind === \"matrix\";\r\n\r\n if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) {\r\n return;\r\n }\r\n\r\n const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind];\r\n const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind];\r\n let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind];\r\n\r\n const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride;\r\n\r\n let newSize = currentSize;\r\n\r\n while (newSize < bufferSize) {\r\n newSize *= 2;\r\n }\r\n\r\n if (!data || currentSize != newSize) {\r\n if (!data) {\r\n data = new Float32Array(newSize);\r\n } else {\r\n const newData = new Float32Array(newSize);\r\n newData.set(data, 0);\r\n data = newData;\r\n }\r\n\r\n if (kindIsMatrix) {\r\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", data, false);\r\n this._thinInstanceDataStorage.matrixData = data;\r\n this._thinInstanceDataStorage.matrixBufferSize = newSize;\r\n if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) {\r\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\r\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", data, false);\r\n }\r\n } else {\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();\r\n\r\n this._userThinInstanceBuffersStorage.data[kind] = data;\r\n this._userThinInstanceBuffersStorage.sizes[kind] = newSize;\r\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), data, kind, true, false, stride, true);\r\n\r\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]!);\r\n }\r\n }\r\n};\r\n\r\nMesh.prototype._thinInstanceInitializeUserStorage = function () {\r\n if (!this._userThinInstanceBuffersStorage) {\r\n this._userThinInstanceBuffersStorage = {\r\n data: {},\r\n sizes: {},\r\n vertexBuffers: {},\r\n strides: {},\r\n };\r\n }\r\n};\r\n\r\nMesh.prototype._disposeThinInstanceSpecificData = function () {\r\n if (this._thinInstanceDataStorage?.matrixBuffer) {\r\n this._thinInstanceDataStorage.matrixBuffer.dispose();\r\n this._thinInstanceDataStorage.matrixBuffer = null;\r\n }\r\n};\r\n"]}
|
|
@@ -63,12 +63,21 @@ export interface INavigationEnginePlugin {
|
|
|
63
63
|
*/
|
|
64
64
|
moveAlongToRef(position: Vector3, destination: Vector3, result: Vector3): void;
|
|
65
65
|
/**
|
|
66
|
-
* Compute a navigation path from start to end. Returns an empty array if no path can be computed
|
|
66
|
+
* Compute a navigation path from start to end. Returns an empty array if no path can be computed.
|
|
67
|
+
* Path is straight.
|
|
67
68
|
* @param start world position
|
|
68
69
|
* @param end world position
|
|
69
70
|
* @returns array containing world position composing the path
|
|
70
71
|
*/
|
|
71
72
|
computePath(start: Vector3, end: Vector3): Vector3[];
|
|
73
|
+
/**
|
|
74
|
+
* Compute a navigation path from start to end. Returns an empty array if no path can be computed.
|
|
75
|
+
* Path follows navigation mesh geometry.
|
|
76
|
+
* @param start world position
|
|
77
|
+
* @param end world position
|
|
78
|
+
* @returns array containing world position composing the path
|
|
79
|
+
*/
|
|
80
|
+
computePathSmooth(start: Vector3, end: Vector3): Vector3[];
|
|
72
81
|
/**
|
|
73
82
|
* If this plugin is supported
|
|
74
83
|
* @returns true if plugin is supported
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"INavigationEngine.js","sourceRoot":"","sources":["../../../../dev/core/src/Navigation/INavigationEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Vector3 } from \"../Maths/math\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Scene } from \"../scene\";\r\n\r\n/**\r\n * Navigation plugin interface to add navigation constrained by a navigation mesh\r\n */\r\nexport interface INavigationEnginePlugin {\r\n /**\r\n * plugin name\r\n */\r\n name: string;\r\n\r\n /**\r\n * Creates a navigation mesh\r\n * @param meshes array of all the geometry used to compute the navigation mesh\r\n * @param parameters bunch of parameters used to filter geometry\r\n */\r\n createNavMesh(meshes: Array<Mesh>, parameters: INavMeshParameters): void;\r\n\r\n /**\r\n * Create a navigation mesh debug mesh\r\n * @param scene is where the mesh will be added\r\n * @returns debug display mesh\r\n */\r\n createDebugNavMesh(scene: Scene): Mesh;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, closest to the parameter position\r\n * @param position world position\r\n * @returns the closest point to position constrained by the navigation mesh\r\n */\r\n getClosestPoint(position: Vector3): Vector3;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, closest to the parameter position\r\n * @param position world position\r\n * @param result output the closest point to position constrained by the navigation mesh\r\n */\r\n getClosestPointToRef(position: Vector3, result: Vector3): void;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, within a particular radius\r\n * @param position world position\r\n * @param maxRadius the maximum distance to the constrained world position\r\n * @returns the closest point to position constrained by the navigation mesh\r\n */\r\n getRandomPointAround(position: Vector3, maxRadius: number): Vector3;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, within a particular radius\r\n * @param position world position\r\n * @param maxRadius the maximum distance to the constrained world position\r\n * @param result output the closest point to position constrained by the navigation mesh\r\n */\r\n getRandomPointAroundToRef(position: Vector3, maxRadius: number, result: Vector3): void;\r\n\r\n /**\r\n * Compute the final position from a segment made of destination-position\r\n * @param position world position\r\n * @param destination world position\r\n * @returns the resulting point along the navmesh\r\n */\r\n moveAlong(position: Vector3, destination: Vector3): Vector3;\r\n\r\n /**\r\n * Compute the final position from a segment made of destination-position\r\n * @param position world position\r\n * @param destination world position\r\n * @param result output the resulting point along the navmesh\r\n */\r\n moveAlongToRef(position: Vector3, destination: Vector3, result: Vector3): void;\r\n\r\n /**\r\n * Compute a navigation path from start to end. Returns an empty array if no path can be computed\r\n * @param start world position\r\n * @param end world position\r\n * @returns array containing world position composing the path\r\n */\r\n computePath(start: Vector3, end: Vector3): Vector3[];\r\n\r\n /**\r\n * If this plugin is supported\r\n * @returns true if plugin is supported\r\n */\r\n isSupported(): boolean;\r\n\r\n /**\r\n * Create a new Crowd so you can add agents\r\n * @param maxAgents the maximum agent count in the crowd\r\n * @param maxAgentRadius the maximum radius an agent can have\r\n * @param scene to attach the crowd to\r\n * @returns the crowd you can add agents to\r\n */\r\n createCrowd(maxAgents: number, maxAgentRadius: number, scene: Scene): ICrowd;\r\n\r\n /**\r\n * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)\r\n * The queries will try to find a solution within those bounds\r\n * default is (1,1,1)\r\n * @param extent x,y,z value that define the extent around the queries point of reference\r\n */\r\n setDefaultQueryExtent(extent: Vector3): void;\r\n\r\n /**\r\n * Get the Bounding box extent specified by setDefaultQueryExtent\r\n * @returns the box extent values\r\n */\r\n getDefaultQueryExtent(): Vector3;\r\n\r\n /**\r\n * build the navmesh from a previously saved state using getNavmeshData\r\n * @param data the Uint8Array returned by getNavmeshData\r\n */\r\n buildFromNavmeshData(data: Uint8Array): void;\r\n\r\n /**\r\n * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data\r\n * @returns data the Uint8Array that can be saved and reused\r\n */\r\n getNavmeshData(): Uint8Array;\r\n\r\n /**\r\n * Get the Bounding box extent result specified by setDefaultQueryExtent\r\n * @param result output the box extent values\r\n */\r\n getDefaultQueryExtentToRef(result: Vector3): void;\r\n\r\n /**\r\n * Set the time step of the navigation tick update.\r\n * Default is 1/60.\r\n * A value of 0 will disable fixed time update\r\n * @param newTimeStep the new timestep to apply to this world.\r\n */\r\n setTimeStep(newTimeStep: number): void;\r\n\r\n /**\r\n * Get the time step of the navigation tick update.\r\n * @returns the current time step\r\n */\r\n getTimeStep(): number;\r\n\r\n /**\r\n * If delta time in navigation tick update is greater than the time step\r\n * a number of sub iterations are done. If more iterations are need to reach deltatime\r\n * they will be discarded.\r\n * A value of 0 will set to no maximum and update will use as many substeps as needed\r\n * @param newStepCount the maximum number of iterations\r\n */\r\n setMaximumSubStepCount(newStepCount: number): void;\r\n\r\n /**\r\n * Get the maximum number of iterations per navigation tick update\r\n * @returns the maximum number of iterations\r\n */\r\n getMaximumSubStepCount(): number;\r\n\r\n /**\r\n * Creates a cylinder obstacle and add it to the navigation\r\n * @param position world position\r\n * @param radius cylinder radius\r\n * @param height cylinder height\r\n * @returns the obstacle freshly created\r\n */\r\n addCylinderObstacle(position: Vector3, radius: number, height: number): IObstacle;\r\n\r\n /**\r\n * Creates an oriented box obstacle and add it to the navigation\r\n * @param position world position\r\n * @param extent box size\r\n * @param angle angle in radians of the box orientation on Y axis\r\n * @returns the obstacle freshly created\r\n */\r\n addBoxObstacle(position: Vector3, extent: Vector3, angle: number): IObstacle;\r\n\r\n /**\r\n * Removes an obstacle created by addCylinderObstacle or addBoxObstacle\r\n * @param obstacle obstacle to remove from the navigation\r\n */\r\n removeObstacle(obstacle: IObstacle): void;\r\n\r\n /**\r\n * Release all resources\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * Obstacle interface\r\n */\r\nexport interface IObstacle {}\r\n\r\n/**\r\n * Crowd Interface. A Crowd is a collection of moving agents constrained by a navigation mesh\r\n */\r\nexport interface ICrowd {\r\n /**\r\n * Add a new agent to the crowd with the specified parameter a corresponding transformNode.\r\n * You can attach anything to that node. The node position is updated in the scene update tick.\r\n * @param pos world position that will be constrained by the navigation mesh\r\n * @param parameters agent parameters\r\n * @param transform hooked to the agent that will be update by the scene\r\n * @returns agent index\r\n */\r\n addAgent(pos: Vector3, parameters: IAgentParameters, transform: TransformNode): number;\r\n\r\n /**\r\n * Returns the agent position in world space\r\n * @param index agent index returned by addAgent\r\n * @returns world space position\r\n */\r\n getAgentPosition(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent position result in world space\r\n * @param index agent index returned by addAgent\r\n * @param result output world space position\r\n */\r\n getAgentPositionToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * Gets the agent velocity in world space\r\n * @param index agent index returned by addAgent\r\n * @returns world space velocity\r\n */\r\n getAgentVelocity(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent velocity result in world space\r\n * @param index agent index returned by addAgent\r\n * @param result output world space velocity\r\n */\r\n getAgentVelocityToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * Gets the agent next target point on the path\r\n * @param index agent index returned by addAgent\r\n * @returns world space position\r\n */\r\n getAgentNextTargetPath(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent state\r\n * @param index agent index returned by addAgent\r\n * @returns agent state\r\n */\r\n getAgentState(index: number): number;\r\n\r\n /**\r\n * returns true if the agent in over an off mesh link connection\r\n * @param index agent index returned by addAgent\r\n * @returns true if over an off mesh link connection\r\n */\r\n overOffmeshConnection(index: number): boolean;\r\n\r\n /**\r\n * Gets the agent next target point on the path\r\n * @param index agent index returned by addAgent\r\n * @param result output world space position\r\n */\r\n getAgentNextTargetPathToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * remove a particular agent previously created\r\n * @param index agent index returned by addAgent\r\n */\r\n removeAgent(index: number): void;\r\n\r\n /**\r\n * get the list of all agents attached to this crowd\r\n * @returns list of agent indices\r\n */\r\n getAgents(): number[];\r\n\r\n /**\r\n * Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function\r\n * @param deltaTime in seconds\r\n */\r\n update(deltaTime: number): void;\r\n\r\n /**\r\n * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh\r\n * @param index agent index returned by addAgent\r\n * @param destination targeted world position\r\n */\r\n agentGoto(index: number, destination: Vector3): void;\r\n\r\n /**\r\n * Teleport the agent to a new position\r\n * @param index agent index returned by addAgent\r\n * @param destination targeted world position\r\n */\r\n agentTeleport(index: number, destination: Vector3): void;\r\n\r\n /**\r\n * Update agent parameters\r\n * @param index agent index returned by addAgent\r\n * @param parameters agent parameters\r\n */\r\n updateAgentParameters(index: number, parameters: IAgentParameters): void;\r\n\r\n /**\r\n * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)\r\n * The queries will try to find a solution within those bounds\r\n * default is (1,1,1)\r\n * @param extent x,y,z value that define the extent around the queries point of reference\r\n */\r\n setDefaultQueryExtent(extent: Vector3): void;\r\n\r\n /**\r\n * Get the Bounding box extent specified by setDefaultQueryExtent\r\n * @returns the box extent values\r\n */\r\n getDefaultQueryExtent(): Vector3;\r\n\r\n /**\r\n * Get the Bounding box extent result specified by setDefaultQueryExtent\r\n * @param result output the box extent values\r\n */\r\n getDefaultQueryExtentToRef(result: Vector3): void;\r\n\r\n /**\r\n * Get the next corner points composing the path (max 4 points)\r\n * @param index agent index returned by addAgent\r\n * @returns array containing world position composing the path\r\n */\r\n getCorners(index: number): Vector3[];\r\n\r\n /**\r\n * Release all resources\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * Configures an agent\r\n */\r\nexport interface IAgentParameters {\r\n /**\r\n * Agent radius. [Limit: >= 0]\r\n */\r\n radius: number;\r\n\r\n /**\r\n * Agent height. [Limit: > 0]\r\n */\r\n height: number;\r\n\r\n /**\r\n * Maximum allowed acceleration. [Limit: >= 0]\r\n */\r\n maxAcceleration: number;\r\n\r\n /**\r\n * Maximum allowed speed. [Limit: >= 0]\r\n */\r\n maxSpeed: number;\r\n\r\n /**\r\n * Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]\r\n */\r\n collisionQueryRange: number;\r\n\r\n /**\r\n * The path visibility optimization range. [Limit: > 0]\r\n */\r\n pathOptimizationRange: number;\r\n\r\n /**\r\n * How aggressive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]\r\n */\r\n separationWeight: number;\r\n\r\n /**\r\n * Observers will be notified when agent gets inside the virtual circle with this Radius around destination point.\r\n * Default is agent radius\r\n */\r\n reachRadius?: number;\r\n}\r\n\r\n/**\r\n * Configures the navigation mesh creation\r\n */\r\nexport interface INavMeshParameters {\r\n /**\r\n * The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu]\r\n */\r\n cs: number;\r\n\r\n /**\r\n * The y-axis cell size to use for fields. [Limit: > 0] [Units: wu]\r\n */\r\n ch: number;\r\n\r\n /**\r\n * The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]\r\n */\r\n walkableSlopeAngle: number;\r\n\r\n /**\r\n * Minimum floor to 'ceiling' height that will still allow the floor area to\r\n * be considered walkable. [Limit: >= 3] [Units: vx]\r\n */\r\n walkableHeight: number;\r\n\r\n /**\r\n * Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]\r\n */\r\n walkableClimb: number;\r\n\r\n /**\r\n * The distance to erode/shrink the walkable area of the heightfield away from\r\n * obstructions. [Limit: >=0] [Units: vx]\r\n */\r\n walkableRadius: number;\r\n\r\n /**\r\n * The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]\r\n */\r\n maxEdgeLen: number;\r\n\r\n /**\r\n * The maximum distance a simplified contour's border edges should deviate\r\n * the original raw contour. [Limit: >=0] [Units: vx]\r\n */\r\n maxSimplificationError: number;\r\n\r\n /**\r\n * The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]\r\n */\r\n minRegionArea: number;\r\n\r\n /**\r\n * Any regions with a span count smaller than this value will, if possible,\r\n * be merged with larger regions. [Limit: >=0] [Units: vx]\r\n */\r\n mergeRegionArea: number;\r\n\r\n /**\r\n * The maximum number of vertices allowed for polygons generated during the\r\n * contour to polygon conversion process. [Limit: >= 3]\r\n */\r\n maxVertsPerPoly: number;\r\n\r\n /**\r\n * Sets the sampling distance to use when generating the detail mesh.\r\n * (For height detail only.) [Limits: 0 or >= 0.9] [Units: wu]\r\n */\r\n detailSampleDist: number;\r\n\r\n /**\r\n * The maximum distance the detail mesh surface should deviate from heightfield\r\n * data. (For height detail only.) [Limit: >=0] [Units: wu]\r\n */\r\n detailSampleMaxError: number;\r\n\r\n /**\r\n * If using obstacles, the navmesh must be subdivided internaly by tiles.\r\n * This member defines the tile cube side length in world units.\r\n * If no obstacles are needed, leave it undefined or 0.\r\n */\r\n tileSize?: number;\r\n\r\n /**\r\n * The size of the non-navigable border around the heightfield.\r\n */\r\n borderSize?: number;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"INavigationEngine.js","sourceRoot":"","sources":["../../../../dev/core/src/Navigation/INavigationEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Vector3 } from \"../Maths/math\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Scene } from \"../scene\";\r\n\r\n/**\r\n * Navigation plugin interface to add navigation constrained by a navigation mesh\r\n */\r\nexport interface INavigationEnginePlugin {\r\n /**\r\n * plugin name\r\n */\r\n name: string;\r\n\r\n /**\r\n * Creates a navigation mesh\r\n * @param meshes array of all the geometry used to compute the navigation mesh\r\n * @param parameters bunch of parameters used to filter geometry\r\n */\r\n createNavMesh(meshes: Array<Mesh>, parameters: INavMeshParameters): void;\r\n\r\n /**\r\n * Create a navigation mesh debug mesh\r\n * @param scene is where the mesh will be added\r\n * @returns debug display mesh\r\n */\r\n createDebugNavMesh(scene: Scene): Mesh;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, closest to the parameter position\r\n * @param position world position\r\n * @returns the closest point to position constrained by the navigation mesh\r\n */\r\n getClosestPoint(position: Vector3): Vector3;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, closest to the parameter position\r\n * @param position world position\r\n * @param result output the closest point to position constrained by the navigation mesh\r\n */\r\n getClosestPointToRef(position: Vector3, result: Vector3): void;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, within a particular radius\r\n * @param position world position\r\n * @param maxRadius the maximum distance to the constrained world position\r\n * @returns the closest point to position constrained by the navigation mesh\r\n */\r\n getRandomPointAround(position: Vector3, maxRadius: number): Vector3;\r\n\r\n /**\r\n * Get a navigation mesh constrained position, within a particular radius\r\n * @param position world position\r\n * @param maxRadius the maximum distance to the constrained world position\r\n * @param result output the closest point to position constrained by the navigation mesh\r\n */\r\n getRandomPointAroundToRef(position: Vector3, maxRadius: number, result: Vector3): void;\r\n\r\n /**\r\n * Compute the final position from a segment made of destination-position\r\n * @param position world position\r\n * @param destination world position\r\n * @returns the resulting point along the navmesh\r\n */\r\n moveAlong(position: Vector3, destination: Vector3): Vector3;\r\n\r\n /**\r\n * Compute the final position from a segment made of destination-position\r\n * @param position world position\r\n * @param destination world position\r\n * @param result output the resulting point along the navmesh\r\n */\r\n moveAlongToRef(position: Vector3, destination: Vector3, result: Vector3): void;\r\n\r\n /**\r\n * Compute a navigation path from start to end. Returns an empty array if no path can be computed.\r\n * Path is straight.\r\n * @param start world position\r\n * @param end world position\r\n * @returns array containing world position composing the path\r\n */\r\n computePath(start: Vector3, end: Vector3): Vector3[];\r\n\r\n /**\r\n * Compute a navigation path from start to end. Returns an empty array if no path can be computed.\r\n * Path follows navigation mesh geometry.\r\n * @param start world position\r\n * @param end world position\r\n * @returns array containing world position composing the path\r\n */\r\n computePathSmooth(start: Vector3, end: Vector3): Vector3[];\r\n\r\n /**\r\n * If this plugin is supported\r\n * @returns true if plugin is supported\r\n */\r\n isSupported(): boolean;\r\n\r\n /**\r\n * Create a new Crowd so you can add agents\r\n * @param maxAgents the maximum agent count in the crowd\r\n * @param maxAgentRadius the maximum radius an agent can have\r\n * @param scene to attach the crowd to\r\n * @returns the crowd you can add agents to\r\n */\r\n createCrowd(maxAgents: number, maxAgentRadius: number, scene: Scene): ICrowd;\r\n\r\n /**\r\n * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)\r\n * The queries will try to find a solution within those bounds\r\n * default is (1,1,1)\r\n * @param extent x,y,z value that define the extent around the queries point of reference\r\n */\r\n setDefaultQueryExtent(extent: Vector3): void;\r\n\r\n /**\r\n * Get the Bounding box extent specified by setDefaultQueryExtent\r\n * @returns the box extent values\r\n */\r\n getDefaultQueryExtent(): Vector3;\r\n\r\n /**\r\n * build the navmesh from a previously saved state using getNavmeshData\r\n * @param data the Uint8Array returned by getNavmeshData\r\n */\r\n buildFromNavmeshData(data: Uint8Array): void;\r\n\r\n /**\r\n * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data\r\n * @returns data the Uint8Array that can be saved and reused\r\n */\r\n getNavmeshData(): Uint8Array;\r\n\r\n /**\r\n * Get the Bounding box extent result specified by setDefaultQueryExtent\r\n * @param result output the box extent values\r\n */\r\n getDefaultQueryExtentToRef(result: Vector3): void;\r\n\r\n /**\r\n * Set the time step of the navigation tick update.\r\n * Default is 1/60.\r\n * A value of 0 will disable fixed time update\r\n * @param newTimeStep the new timestep to apply to this world.\r\n */\r\n setTimeStep(newTimeStep: number): void;\r\n\r\n /**\r\n * Get the time step of the navigation tick update.\r\n * @returns the current time step\r\n */\r\n getTimeStep(): number;\r\n\r\n /**\r\n * If delta time in navigation tick update is greater than the time step\r\n * a number of sub iterations are done. If more iterations are need to reach deltatime\r\n * they will be discarded.\r\n * A value of 0 will set to no maximum and update will use as many substeps as needed\r\n * @param newStepCount the maximum number of iterations\r\n */\r\n setMaximumSubStepCount(newStepCount: number): void;\r\n\r\n /**\r\n * Get the maximum number of iterations per navigation tick update\r\n * @returns the maximum number of iterations\r\n */\r\n getMaximumSubStepCount(): number;\r\n\r\n /**\r\n * Creates a cylinder obstacle and add it to the navigation\r\n * @param position world position\r\n * @param radius cylinder radius\r\n * @param height cylinder height\r\n * @returns the obstacle freshly created\r\n */\r\n addCylinderObstacle(position: Vector3, radius: number, height: number): IObstacle;\r\n\r\n /**\r\n * Creates an oriented box obstacle and add it to the navigation\r\n * @param position world position\r\n * @param extent box size\r\n * @param angle angle in radians of the box orientation on Y axis\r\n * @returns the obstacle freshly created\r\n */\r\n addBoxObstacle(position: Vector3, extent: Vector3, angle: number): IObstacle;\r\n\r\n /**\r\n * Removes an obstacle created by addCylinderObstacle or addBoxObstacle\r\n * @param obstacle obstacle to remove from the navigation\r\n */\r\n removeObstacle(obstacle: IObstacle): void;\r\n\r\n /**\r\n * Release all resources\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * Obstacle interface\r\n */\r\nexport interface IObstacle {}\r\n\r\n/**\r\n * Crowd Interface. A Crowd is a collection of moving agents constrained by a navigation mesh\r\n */\r\nexport interface ICrowd {\r\n /**\r\n * Add a new agent to the crowd with the specified parameter a corresponding transformNode.\r\n * You can attach anything to that node. The node position is updated in the scene update tick.\r\n * @param pos world position that will be constrained by the navigation mesh\r\n * @param parameters agent parameters\r\n * @param transform hooked to the agent that will be update by the scene\r\n * @returns agent index\r\n */\r\n addAgent(pos: Vector3, parameters: IAgentParameters, transform: TransformNode): number;\r\n\r\n /**\r\n * Returns the agent position in world space\r\n * @param index agent index returned by addAgent\r\n * @returns world space position\r\n */\r\n getAgentPosition(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent position result in world space\r\n * @param index agent index returned by addAgent\r\n * @param result output world space position\r\n */\r\n getAgentPositionToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * Gets the agent velocity in world space\r\n * @param index agent index returned by addAgent\r\n * @returns world space velocity\r\n */\r\n getAgentVelocity(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent velocity result in world space\r\n * @param index agent index returned by addAgent\r\n * @param result output world space velocity\r\n */\r\n getAgentVelocityToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * Gets the agent next target point on the path\r\n * @param index agent index returned by addAgent\r\n * @returns world space position\r\n */\r\n getAgentNextTargetPath(index: number): Vector3;\r\n\r\n /**\r\n * Gets the agent state\r\n * @param index agent index returned by addAgent\r\n * @returns agent state\r\n */\r\n getAgentState(index: number): number;\r\n\r\n /**\r\n * returns true if the agent in over an off mesh link connection\r\n * @param index agent index returned by addAgent\r\n * @returns true if over an off mesh link connection\r\n */\r\n overOffmeshConnection(index: number): boolean;\r\n\r\n /**\r\n * Gets the agent next target point on the path\r\n * @param index agent index returned by addAgent\r\n * @param result output world space position\r\n */\r\n getAgentNextTargetPathToRef(index: number, result: Vector3): void;\r\n\r\n /**\r\n * remove a particular agent previously created\r\n * @param index agent index returned by addAgent\r\n */\r\n removeAgent(index: number): void;\r\n\r\n /**\r\n * get the list of all agents attached to this crowd\r\n * @returns list of agent indices\r\n */\r\n getAgents(): number[];\r\n\r\n /**\r\n * Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function\r\n * @param deltaTime in seconds\r\n */\r\n update(deltaTime: number): void;\r\n\r\n /**\r\n * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh\r\n * @param index agent index returned by addAgent\r\n * @param destination targeted world position\r\n */\r\n agentGoto(index: number, destination: Vector3): void;\r\n\r\n /**\r\n * Teleport the agent to a new position\r\n * @param index agent index returned by addAgent\r\n * @param destination targeted world position\r\n */\r\n agentTeleport(index: number, destination: Vector3): void;\r\n\r\n /**\r\n * Update agent parameters\r\n * @param index agent index returned by addAgent\r\n * @param parameters agent parameters\r\n */\r\n updateAgentParameters(index: number, parameters: IAgentParameters): void;\r\n\r\n /**\r\n * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)\r\n * The queries will try to find a solution within those bounds\r\n * default is (1,1,1)\r\n * @param extent x,y,z value that define the extent around the queries point of reference\r\n */\r\n setDefaultQueryExtent(extent: Vector3): void;\r\n\r\n /**\r\n * Get the Bounding box extent specified by setDefaultQueryExtent\r\n * @returns the box extent values\r\n */\r\n getDefaultQueryExtent(): Vector3;\r\n\r\n /**\r\n * Get the Bounding box extent result specified by setDefaultQueryExtent\r\n * @param result output the box extent values\r\n */\r\n getDefaultQueryExtentToRef(result: Vector3): void;\r\n\r\n /**\r\n * Get the next corner points composing the path (max 4 points)\r\n * @param index agent index returned by addAgent\r\n * @returns array containing world position composing the path\r\n */\r\n getCorners(index: number): Vector3[];\r\n\r\n /**\r\n * Release all resources\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * Configures an agent\r\n */\r\nexport interface IAgentParameters {\r\n /**\r\n * Agent radius. [Limit: >= 0]\r\n */\r\n radius: number;\r\n\r\n /**\r\n * Agent height. [Limit: > 0]\r\n */\r\n height: number;\r\n\r\n /**\r\n * Maximum allowed acceleration. [Limit: >= 0]\r\n */\r\n maxAcceleration: number;\r\n\r\n /**\r\n * Maximum allowed speed. [Limit: >= 0]\r\n */\r\n maxSpeed: number;\r\n\r\n /**\r\n * Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]\r\n */\r\n collisionQueryRange: number;\r\n\r\n /**\r\n * The path visibility optimization range. [Limit: > 0]\r\n */\r\n pathOptimizationRange: number;\r\n\r\n /**\r\n * How aggressive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]\r\n */\r\n separationWeight: number;\r\n\r\n /**\r\n * Observers will be notified when agent gets inside the virtual circle with this Radius around destination point.\r\n * Default is agent radius\r\n */\r\n reachRadius?: number;\r\n}\r\n\r\n/**\r\n * Configures the navigation mesh creation\r\n */\r\nexport interface INavMeshParameters {\r\n /**\r\n * The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu]\r\n */\r\n cs: number;\r\n\r\n /**\r\n * The y-axis cell size to use for fields. [Limit: > 0] [Units: wu]\r\n */\r\n ch: number;\r\n\r\n /**\r\n * The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]\r\n */\r\n walkableSlopeAngle: number;\r\n\r\n /**\r\n * Minimum floor to 'ceiling' height that will still allow the floor area to\r\n * be considered walkable. [Limit: >= 3] [Units: vx]\r\n */\r\n walkableHeight: number;\r\n\r\n /**\r\n * Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]\r\n */\r\n walkableClimb: number;\r\n\r\n /**\r\n * The distance to erode/shrink the walkable area of the heightfield away from\r\n * obstructions. [Limit: >=0] [Units: vx]\r\n */\r\n walkableRadius: number;\r\n\r\n /**\r\n * The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]\r\n */\r\n maxEdgeLen: number;\r\n\r\n /**\r\n * The maximum distance a simplified contour's border edges should deviate\r\n * the original raw contour. [Limit: >=0] [Units: vx]\r\n */\r\n maxSimplificationError: number;\r\n\r\n /**\r\n * The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]\r\n */\r\n minRegionArea: number;\r\n\r\n /**\r\n * Any regions with a span count smaller than this value will, if possible,\r\n * be merged with larger regions. [Limit: >=0] [Units: vx]\r\n */\r\n mergeRegionArea: number;\r\n\r\n /**\r\n * The maximum number of vertices allowed for polygons generated during the\r\n * contour to polygon conversion process. [Limit: >= 3]\r\n */\r\n maxVertsPerPoly: number;\r\n\r\n /**\r\n * Sets the sampling distance to use when generating the detail mesh.\r\n * (For height detail only.) [Limits: 0 or >= 0.9] [Units: wu]\r\n */\r\n detailSampleDist: number;\r\n\r\n /**\r\n * The maximum distance the detail mesh surface should deviate from heightfield\r\n * data. (For height detail only.) [Limit: >=0] [Units: wu]\r\n */\r\n detailSampleMaxError: number;\r\n\r\n /**\r\n * If using obstacles, the navmesh must be subdivided internaly by tiles.\r\n * This member defines the tile cube side length in world units.\r\n * If no obstacles are needed, leave it undefined or 0.\r\n */\r\n tileSize?: number;\r\n\r\n /**\r\n * The size of the non-navigable border around the heightfield.\r\n */\r\n borderSize?: number;\r\n}\r\n"]}
|
|
@@ -125,13 +125,23 @@ export declare class RecastJSPlugin implements INavigationEnginePlugin {
|
|
|
125
125
|
* @param result output the resulting point along the navmesh
|
|
126
126
|
*/
|
|
127
127
|
moveAlongToRef(position: Vector3, destination: Vector3, result: Vector3): void;
|
|
128
|
+
private _convertNavPathPoints;
|
|
128
129
|
/**
|
|
129
130
|
* Compute a navigation path from start to end. Returns an empty array if no path can be computed
|
|
131
|
+
* Path is straight.
|
|
130
132
|
* @param start world position
|
|
131
133
|
* @param end world position
|
|
132
134
|
* @returns array containing world position composing the path
|
|
133
135
|
*/
|
|
134
136
|
computePath(start: Vector3, end: Vector3): Vector3[];
|
|
137
|
+
/**
|
|
138
|
+
* Compute a navigation path from start to end. Returns an empty array if no path can be computed.
|
|
139
|
+
* Path follows navigation mesh geometry.
|
|
140
|
+
* @param start world position
|
|
141
|
+
* @param end world position
|
|
142
|
+
* @returns array containing world position composing the path
|
|
143
|
+
*/
|
|
144
|
+
computePathSmooth(start: Vector3, end: Vector3): Vector3[];
|
|
135
145
|
/**
|
|
136
146
|
* Create a new Crowd so you can add agents
|
|
137
147
|
* @param maxAgents the maximum agent count in the crowd
|
|
@@ -197,6 +207,16 @@ export declare class RecastJSPlugin implements INavigationEnginePlugin {
|
|
|
197
207
|
* @returns true if plugin is supported
|
|
198
208
|
*/
|
|
199
209
|
isSupported(): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Returns the seed used for randomized functions like `getRandomPointAround`
|
|
212
|
+
* @returns seed number
|
|
213
|
+
*/
|
|
214
|
+
getRandomSeed(): number;
|
|
215
|
+
/**
|
|
216
|
+
* Set the seed used for randomized functions like `getRandomPointAround`
|
|
217
|
+
* @param seed number used as seed for random functions
|
|
218
|
+
*/
|
|
219
|
+
setRandomSeed(seed: number): void;
|
|
200
220
|
}
|
|
201
221
|
/**
|
|
202
222
|
* Recast detour crowd implementation
|
|
@@ -300,14 +300,24 @@ export class RecastJSPlugin {
|
|
|
300
300
|
const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);
|
|
301
301
|
result.set(ret.x, ret.y, ret.z);
|
|
302
302
|
}
|
|
303
|
+
_convertNavPathPoints(navPath) {
|
|
304
|
+
let pt;
|
|
305
|
+
const pointCount = navPath.getPointCount();
|
|
306
|
+
const positions = [];
|
|
307
|
+
for (pt = 0; pt < pointCount; pt++) {
|
|
308
|
+
const p = navPath.getPoint(pt);
|
|
309
|
+
positions.push(new Vector3(p.x, p.y, p.z));
|
|
310
|
+
}
|
|
311
|
+
return positions;
|
|
312
|
+
}
|
|
303
313
|
/**
|
|
304
314
|
* Compute a navigation path from start to end. Returns an empty array if no path can be computed
|
|
315
|
+
* Path is straight.
|
|
305
316
|
* @param start world position
|
|
306
317
|
* @param end world position
|
|
307
318
|
* @returns array containing world position composing the path
|
|
308
319
|
*/
|
|
309
320
|
computePath(start, end) {
|
|
310
|
-
let pt;
|
|
311
321
|
this._tempVec1.x = start.x;
|
|
312
322
|
this._tempVec1.y = start.y;
|
|
313
323
|
this._tempVec1.z = start.z;
|
|
@@ -315,13 +325,24 @@ export class RecastJSPlugin {
|
|
|
315
325
|
this._tempVec2.y = end.y;
|
|
316
326
|
this._tempVec2.z = end.z;
|
|
317
327
|
const navPath = this.navMesh.computePath(this._tempVec1, this._tempVec2);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
328
|
+
return this._convertNavPathPoints(navPath);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Compute a navigation path from start to end. Returns an empty array if no path can be computed.
|
|
332
|
+
* Path follows navigation mesh geometry.
|
|
333
|
+
* @param start world position
|
|
334
|
+
* @param end world position
|
|
335
|
+
* @returns array containing world position composing the path
|
|
336
|
+
*/
|
|
337
|
+
computePathSmooth(start, end) {
|
|
338
|
+
this._tempVec1.x = start.x;
|
|
339
|
+
this._tempVec1.y = start.y;
|
|
340
|
+
this._tempVec1.z = start.z;
|
|
341
|
+
this._tempVec2.x = end.x;
|
|
342
|
+
this._tempVec2.y = end.y;
|
|
343
|
+
this._tempVec2.z = end.z;
|
|
344
|
+
const navPath = this.navMesh.computePathSmooth(this._tempVec1, this._tempVec2);
|
|
345
|
+
return this._convertNavPathPoints(navPath);
|
|
325
346
|
}
|
|
326
347
|
/**
|
|
327
348
|
* Create a new Crowd so you can add agents
|
|
@@ -438,6 +459,20 @@ export class RecastJSPlugin {
|
|
|
438
459
|
isSupported() {
|
|
439
460
|
return this.bjsRECAST !== undefined;
|
|
440
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* Returns the seed used for randomized functions like `getRandomPointAround`
|
|
464
|
+
* @returns seed number
|
|
465
|
+
*/
|
|
466
|
+
getRandomSeed() {
|
|
467
|
+
return this.bjsRECAST._getRandomSeed();
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Set the seed used for randomized functions like `getRandomPointAround`
|
|
471
|
+
* @param seed number used as seed for random functions
|
|
472
|
+
*/
|
|
473
|
+
setRandomSeed(seed) {
|
|
474
|
+
this.bjsRECAST._setRandomSeed(seed);
|
|
475
|
+
}
|
|
441
476
|
}
|
|
442
477
|
/**
|
|
443
478
|
* Recast detour crowd implementation
|