c531b67da742d4a16f605fe75e6095474892aa234c2e7b13d7c4f9a3b4a88fcf.json 27 KB

1
  1. {"ast":null,"code":"import { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { TmpVectors, Vector3 } from \"../Maths/math.vector.js\";\nfunction getExtentCorners(extent) {\n const minX = extent.minimum.x;\n const minY = extent.minimum.y;\n const minZ = extent.minimum.z;\n const maxX = extent.maximum.x;\n const maxY = extent.maximum.y;\n const maxZ = extent.maximum.z;\n return [new Vector3(minX, minY, minZ), new Vector3(maxX, maxY, maxZ), new Vector3(maxX, minY, minZ), new Vector3(minX, maxY, minZ), new Vector3(minX, minY, maxZ), new Vector3(maxX, maxY, minZ), new Vector3(minX, maxY, maxZ), new Vector3(maxX, minY, maxZ)];\n}\n/**\n * Computes the maximum extents of the given meshes considering animation, skeleton, and morph targets.\n * @param meshes The array of meshes to compute\n * @param animationGroup An optional animation group to animate (must be started to take effect)\n * @param animationStep An optional value indicating the number of seconds to step while looping through the given animation group\n * @returns An array of world space extents corresponding to the given meshes\n */\nexport function computeMaxExtents(meshes, animationGroup = null, animationStep = 1 / 6) {\n // Local vector to avoid allocations.\n const position = TmpVectors.Vector3[0];\n const meshExtents = new Map();\n const skinnedMeshExtents = new Map();\n // Compute the non-skinned and skinned mesh extents.\n const maxLength = meshes.reduce((previous, current) => Math.max(previous, current.getTotalVertices()), 0);\n const minPositions = Array.from({\n length: maxLength\n }, () => new Vector3());\n const maxPositions = Array.from({\n length: maxLength\n }, () => new Vector3());\n for (const mesh of meshes) {\n const positions = mesh.getVerticesData(VertexBuffer.PositionKind);\n if (!positions) {\n continue;\n }\n // Initialize min/max positions with the original positions.\n const numVertices = mesh.getTotalVertices();\n minPositions.length = Math.max(minPositions.length, numVertices);\n maxPositions.length = Math.max(minPositions.length, numVertices);\n for (let i = 0, j = 0; i < numVertices; i++, j += 3) {\n position.set(positions[j], positions[j + 1], positions[j + 2]);\n minPositions[i].copyFrom(position);\n maxPositions[i].copyFrom(position);\n }\n // Apply morph targets to the min/max positions.\n const morphTargetManager = mesh.morphTargetManager;\n if (morphTargetManager) {\n for (let targetIndex = 0; targetIndex < morphTargetManager.numTargets; ++targetIndex) {\n const target = morphTargetManager.getTarget(targetIndex);\n const positions = target.getPositions();\n if (positions) {\n for (let i = 0, j = 0; i < numVertices; i++, j += 3) {\n position.set(positions[j], positions[j + 1], positions[j + 2]);\n minPositions[i].minimizeInPlace(position);\n maxPositions[i].maximizeInPlace(position);\n }\n }\n }\n }\n // Compute extent per mesh.\n const skeleton = mesh.skeleton;\n const weights = skeleton ? mesh.getVerticesData(VertexBuffer.MatricesWeightsKind) : null;\n const indices = skeleton ? mesh.getVerticesData(VertexBuffer.MatricesIndicesKind) : null;\n if (weights && indices) {\n // Compute extent per bone for skinned meshes.\n const needsExtra = mesh.numBoneInfluencers > 4;\n const weightsExtra = needsExtra ? mesh.getVerticesData(VertexBuffer.MatricesWeightsExtraKind) : null;\n const indicesExtra = needsExtra ? mesh.getVerticesData(VertexBuffer.MatricesIndicesExtraKind) : null;\n const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId) || new Map();\n skinnedMeshExtents.set(mesh.uniqueId, perBoneExtents);\n const updateExtents = (i, j, weights, indices) => {\n for (let k = j; k < j + 4; k++) {\n if (weights[k] > 0) {\n const boneIndex = indices[k];\n const extent = perBoneExtents.get(boneIndex);\n if (extent) {\n extent.minimum.minimizeInPlace(minPositions[i]);\n extent.maximum.maximizeInPlace(maxPositions[i]);\n } else {\n perBoneExtents.set(boneIndex, {\n minimum: minPositions[i].clone(),\n maximum: maxPositions[i].clone()\n });\n }\n }\n }\n };\n for (let i = 0, j = 0; i < numVertices; i++, j += 4) {\n updateExtents(i, j, weights, indices);\n if (weightsExtra && indicesExtra) {\n updateExtents(i, j, weightsExtra, indicesExtra);\n }\n }\n } else {\n // Compute extent for the whole mesh for non-skinned meshes.\n const extent = meshExtents.get(mesh.uniqueId) || {\n minimum: new Vector3().setAll(Number.POSITIVE_INFINITY),\n maximum: new Vector3().setAll(Number.NEGATIVE_INFINITY)\n };\n meshExtents.set(mesh.uniqueId, extent);\n for (let i = 0; i < numVertices; i++) {\n extent.minimum.minimizeInPlace(minPositions[i]);\n extent.maximum.maximizeInPlace(maxPositions[i]);\n }\n }\n }\n // Create the 8 corners of each non-skinned and skinned extent.\n const meshCorners = new Map();\n const skinnedMeshCorners = new Map();\n for (const mesh of meshes) {\n const extent = meshExtents.get(mesh.uniqueId);\n if (extent) {\n meshCorners.set(mesh.uniqueId, getExtentCorners(extent));\n } else {\n const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId);\n if (perBoneExtents) {\n const bones = mesh.skeleton.bones;\n const perBoneCorners = new Map();\n skinnedMeshCorners.set(mesh.uniqueId, perBoneCorners);\n perBoneExtents.forEach((extent, boneIndex) => {\n const corners = getExtentCorners(extent);\n // Transform the coordinates of the corners for skinned meshes to bone space.\n const inverseBindMatrix = bones[boneIndex].getAbsoluteInverseBindMatrix();\n for (const corner of corners) {\n Vector3.TransformCoordinatesToRef(corner, inverseBindMatrix, corner);\n }\n perBoneCorners.set(boneIndex, corners);\n });\n }\n }\n }\n const maxExtents = Array.from({\n length: meshes.length\n }, () => ({\n minimum: new Vector3().setAll(Number.POSITIVE_INFINITY),\n maximum: new Vector3().setAll(Number.NEGATIVE_INFINITY)\n }));\n const updateMaxExtents = () => {\n for (let i = 0; i < meshes.length; i++) {\n const mesh = meshes[i];\n const positions = mesh.getVerticesData(VertexBuffer.PositionKind);\n if (!positions) {\n continue;\n }\n const worldMatrix = mesh.computeWorldMatrix(true);\n const skeleton = mesh.skeleton;\n if (skeleton) {\n skeleton.prepare(true);\n const bones = skeleton.bones;\n const perBoneCorners = skinnedMeshCorners.get(mesh.uniqueId);\n perBoneCorners.forEach((corners, boneIndex) => {\n // Transform the per-bone corners into world space and update the max extent for each corner.\n for (const corner of corners) {\n const matrix = bones[boneIndex].getFinalMatrix().multiplyToRef(worldMatrix, TmpVectors.Matrix[0]);\n Vector3.TransformCoordinatesToRef(corner, matrix, position);\n maxExtents[i].minimum.minimizeInPlace(position);\n maxExtents[i].maximum.maximizeInPlace(position);\n }\n });\n } else {\n // Transform the corners into world space and update the max extent for each corner.\n for (const corner of meshCorners.get(mesh.uniqueId)) {\n Vector3.TransformCoordinatesToRef(corner, worldMatrix, position);\n maxExtents[i].minimum.minimizeInPlace(position);\n maxExtents[i].maximum.maximizeInPlace(position);\n }\n }\n }\n };\n if (animationGroup && animationGroup.isStarted) {\n const currentFrame = animationGroup.getCurrentFrame();\n const step = animationStep / animationGroup.getLength(0, 1);\n for (let frame = animationGroup.from; frame <= animationGroup.to; frame += step) {\n animationGroup.goToFrame(frame);\n updateMaxExtents();\n }\n animationGroup.goToFrame(currentFrame);\n } else {\n updateMaxExtents();\n }\n return maxExtents;\n}","map":{"version":3,"names":["VertexBuffer","TmpVectors","Vector3","getExtentCorners","extent","minX","minimum","x","minY","y","minZ","z","maxX","maximum","maxY","maxZ","computeMaxExtents","meshes","animationGroup","animationStep","position","meshExtents","Map","skinnedMeshExtents","maxLength","reduce","previous","current","Math","max","getTotalVertices","minPositions","Array","from","length","maxPositions","mesh","positions","getVerticesData","PositionKind","numVertices","i","j","set","copyFrom","morphTargetManager","targetIndex","numTargets","target","getTarget","getPositions","minimizeInPlace","maximizeInPlace","skeleton","weights","MatricesWeightsKind","indices","MatricesIndicesKind","needsExtra","numBoneInfluencers","weightsExtra","MatricesWeightsExtraKind","indicesExtra","MatricesIndicesExtraKind","perBoneExtents","get","uniqueId","updateExtents","k","boneIndex","clone","setAll","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","meshCorners","skinnedMeshCorners","bones","perBoneCorners","forEach","corners","inverseBindMatrix","getAbsoluteInverseBindMatrix","corner","TransformCoordinatesToRef","maxExtents","updateMaxExtents","worldMatrix","computeWorldMatrix","prepare","matrix","getFinalMatrix","multiplyToRef","Matrix","isStarted","currentFrame","getCurrentFrame","step","getLength","frame","to","goToFrame"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/meshUtils.js"],"sourcesContent":["import { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { TmpVectors, Vector3 } from \"../Maths/math.vector.js\";\nfunction getExtentCorners(extent) {\n const minX = extent.minimum.x;\n const minY = extent.minimum.y;\n const minZ = extent.minimum.z;\n const maxX = extent.maximum.x;\n const maxY = extent.maximum.y;\n const maxZ = extent.maximum.z;\n return [\n new Vector3(minX, minY, minZ),\n new Vector3(maxX, maxY, maxZ),\n new Vector3(maxX, minY, minZ),\n new Vector3(minX, maxY, minZ),\n new Vector3(minX, minY, maxZ),\n new Vector3(maxX, maxY, minZ),\n new Vector3(minX, maxY, maxZ),\n new Vector3(maxX, minY, maxZ),\n ];\n}\n/**\n * Computes the maximum extents of the given meshes considering animation, skeleton, and morph targets.\n * @param meshes The array of meshes to compute\n * @param animationGroup An optional animation group to animate (must be started to take effect)\n * @param animationStep An optional value indicating the number of seconds to step while looping through the given animation group\n * @returns An array of world space extents corresponding to the given meshes\n */\nexport function computeMaxExtents(meshes, animationGroup = null, animationStep = 1 / 6) {\n // Local vector to avoid allocations.\n const position = TmpVectors.Vector3[0];\n const meshExtents = new Map();\n const skinnedMeshExtents = new Map();\n // Compute the non-skinned and skinned mesh extents.\n const maxLength = meshes.reduce((previous, current) => Math.max(previous, current.getTotalVertices()), 0);\n const minPositions = Array.from({ length: maxLength }, () => new Vector3());\n const maxPositions = Array.from({ length: maxLength }, () => new Vector3());\n for (const mesh of meshes) {\n const positions = mesh.getVerticesData(VertexBuffer.PositionKind);\n if (!positions) {\n continue;\n }\n // Initialize min/max positions with the original positions.\n const numVertices = mesh.getTotalVertices();\n minPositions.length = Math.max(minPositions.length, numVertices);\n maxPositions.length = Math.max(minPositions.length, numVertices);\n for (let i = 0, j = 0; i < numVertices; i++, j += 3) {\n position.set(positions[j], positions[j + 1], positions[j + 2]);\n minPositions[i].copyFrom(position);\n maxPositions[i].copyFrom(position);\n }\n // Apply morph targets to the min/max positions.\n const morphTargetManager = mesh.morphTargetManager;\n if (morphTargetManager) {\n for (let targetIndex = 0; targetIndex < morphTargetManager.numTargets; ++targetIndex) {\n const target = morphTargetManager.getTarget(targetIndex);\n const positions = target.getPositions();\n if (positions) {\n for (let i = 0, j = 0; i < numVertices; i++, j += 3) {\n position.set(positions[j], positions[j + 1], positions[j + 2]);\n minPositions[i].minimizeInPlace(position);\n maxPositions[i].maximizeInPlace(position);\n }\n }\n }\n }\n // Compute extent per mesh.\n const skeleton = mesh.skeleton;\n const weights = skeleton ? mesh.getVerticesData(VertexBuffer.MatricesWeightsKind) : null;\n const indices = skeleton ? mesh.getVerticesData(VertexBuffer.MatricesIndicesKind) : null;\n if (weights && indices) {\n // Compute extent per bone for skinned meshes.\n const needsExtra = mesh.numBoneInfluencers > 4;\n const weightsExtra = needsExtra ? mesh.getVerticesData(VertexBuffer.MatricesWeightsExtraKind) : null;\n const indicesExtra = needsExtra ? mesh.getVerticesData(VertexBuffer.MatricesIndicesExtraKind) : null;\n const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId) || new Map();\n skinnedMeshExtents.set(mesh.uniqueId, perBoneExtents);\n const updateExtents = (i, j, weights, indices) => {\n for (let k = j; k < j + 4; k++) {\n if (weights[k] > 0) {\n const boneIndex = indices[k];\n const extent = perBoneExtents.get(boneIndex);\n if (extent) {\n extent.minimum.minimizeInPlace(minPositions[i]);\n extent.maximum.maximizeInPlace(maxPositions[i]);\n }\n else {\n perBoneExtents.set(boneIndex, {\n minimum: minPositions[i].clone(),\n maximum: maxPositions[i].clone(),\n });\n }\n }\n }\n };\n for (let i = 0, j = 0; i < numVertices; i++, j += 4) {\n updateExtents(i, j, weights, indices);\n if (weightsExtra && indicesExtra) {\n updateExtents(i, j, weightsExtra, indicesExtra);\n }\n }\n }\n else {\n // Compute extent for the whole mesh for non-skinned meshes.\n const extent = meshExtents.get(mesh.uniqueId) || {\n minimum: new Vector3().setAll(Number.POSITIVE_INFINITY),\n maximum: new Vector3().setAll(Number.NEGATIVE_INFINITY),\n };\n meshExtents.set(mesh.uniqueId, extent);\n for (let i = 0; i < numVertices; i++) {\n extent.minimum.minimizeInPlace(minPositions[i]);\n extent.maximum.maximizeInPlace(maxPositions[i]);\n }\n }\n }\n // Create the 8 corners of each non-skinned and skinned extent.\n const meshCorners = new Map();\n const skinnedMeshCorners = new Map();\n for (const mesh of meshes) {\n const extent = meshExtents.get(mesh.uniqueId);\n if (extent) {\n meshCorners.set(mesh.uniqueId, getExtentCorners(extent));\n }\n else {\n const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId);\n if (perBoneExtents) {\n const bones = mesh.skeleton.bones;\n const perBoneCorners = new Map();\n skinnedMeshCorners.set(mesh.uniqueId, perBoneCorners);\n perBoneExtents.forEach((extent, boneIndex) => {\n const corners = getExtentCorners(extent);\n // Transform the coordinates of the corners for skinned meshes to bone space.\n const inverseBindMatrix = bones[boneIndex].getAbsoluteInverseBindMatrix();\n for (const corner of corners) {\n Vector3.TransformCoordinatesToRef(corner, inverseBindMatrix, corner);\n }\n perBoneCorners.set(boneIndex, corners);\n });\n }\n }\n }\n const maxExtents = Array.from({ length: meshes.length }, () => ({\n minimum: new Vector3().setAll(Number.POSITIVE_INFINITY),\n maximum: new Vector3().setAll(Number.NEGATIVE_INFINITY),\n }));\n const updateMaxExtents = () => {\n for (let i = 0; i < meshes.length; i++) {\n const mesh = meshes[i];\n const positions = mesh.getVerticesData(VertexBuffer.PositionKind);\n if (!positions) {\n continue;\n }\n const worldMatrix = mesh.computeWorldMatrix(true);\n const skeleton = mesh.skeleton;\n if (skeleton) {\n skeleton.prepare(true);\n const bones = skeleton.bones;\n const perBoneCorners = skinnedMeshCorners.get(mesh.uniqueId);\n perBoneCorners.forEach((corners, boneIndex) => {\n // Transform the per-bone corners into world space and update the max extent for each corner.\n for (const corner of corners) {\n const matrix = bones[boneIndex].getFinalMatrix().multiplyToRef(worldMatrix, TmpVectors.Matrix[0]);\n Vector3.TransformCoordinatesToRef(corner, matrix, position);\n maxExtents[i].minimum.minimizeInPlace(position);\n maxExtents[i].maximum.maximizeInPlace(position);\n }\n });\n }\n else {\n // Transform the corners into world space and update the max extent for each corner.\n for (const corner of meshCorners.get(mesh.uniqueId)) {\n Vector3.TransformCoordinatesToRef(corner, worldMatrix, position);\n maxExtents[i].minimum.minimizeInPlace(position);\n maxExtents[i].maximum.maximizeInPlace(position);\n }\n }\n }\n };\n if (animationGroup && animationGroup.isStarted) {\n const currentFrame = animationGroup.getCurrentFrame();\n const step = animationStep / animationGroup.getLength(0, 1);\n for (let frame = animationGroup.from; frame <= animationGroup.to; frame += step) {\n animationGroup.goToFrame(frame);\n updateMaxExtents();\n }\n animationGroup.goToFrame(currentFrame);\n }\n else {\n updateMaxExtents();\n }\n return maxExtents;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,sBAAsB;AACnD,SAASC,UAAU,EAAEC,OAAO,QAAQ,yBAAyB;AAC7D,SAASC,gBAAgBA,CAACC,MAAM,EAAE;EAC9B,MAAMC,IAAI,GAAGD,MAAM,CAACE,OAAO,CAACC,CAAC;EAC7B,MAAMC,IAAI,GAAGJ,MAAM,CAACE,OAAO,CAACG,CAAC;EAC7B,MAAMC,IAAI,GAAGN,MAAM,CAACE,OAAO,CAACK,CAAC;EAC7B,MAAMC,IAAI,GAAGR,MAAM,CAACS,OAAO,CAACN,CAAC;EAC7B,MAAMO,IAAI,GAAGV,MAAM,CAACS,OAAO,CAACJ,CAAC;EAC7B,MAAMM,IAAI,GAAGX,MAAM,CAACS,OAAO,CAACF,CAAC;EAC7B,OAAO,CACH,IAAIT,OAAO,CAACG,IAAI,EAAEG,IAAI,EAAEE,IAAI,CAAC,EAC7B,IAAIR,OAAO,CAACU,IAAI,EAAEE,IAAI,EAAEC,IAAI,CAAC,EAC7B,IAAIb,OAAO,CAACU,IAAI,EAAEJ,IAAI,EAAEE,IAAI,CAAC,EAC7B,IAAIR,OAAO,CAACG,IAAI,EAAES,IAAI,EAAEJ,IAAI,CAAC,EAC7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