{"version":3,"file":"transformVertices.mjs","sources":["../../../../../../src/rendering/renderers/shared/geometry/utils/transformVertices.ts"],"sourcesContent":["import type { Matrix } from '../../../../../maths/matrix/Matrix';\n\n/**\n * Transforms the vertices in an array with the given matrix.\n * @param vertices - the vertices to transform\n * @param m - the matrix to apply to the vertices\n * @param offset - the offset of the vertices (defaults to 0)\n * @param stride - the stride of the vertices (defaults to 2)\n * @param size - the size of the vertices (defaults to vertices.length / stride - offset)\n * @memberof rendering\n */\nexport function transformVertices(vertices: number[], m: Matrix, offset?: number, stride?: number, size?: number)\n{\n    const a = m.a;\n    const b = m.b;\n    const c = m.c;\n    const d = m.d;\n    const tx = m.tx;\n    const ty = m.ty;\n\n    offset = offset || 0;\n    stride = stride || 2;\n    size = size || (vertices.length / stride) - offset;\n\n    let index = offset * stride;\n\n    for (let i = 0; i < size; i++)\n    {\n        const x = vertices[index];\n        const y = vertices[index + 1];\n\n        vertices[index] = (a * x) + (c * y) + tx;\n        vertices[index + 1] = (b * x) + (d * y) + ty;\n\n        index += stride;\n    }\n}\n"],"names":[],"mappings":";AAWO,SAAS,iBAAkB,CAAA,QAAA,EAAoB,CAAW,EAAA,MAAA,EAAiB,QAAiB,IACnG,EAAA;AACI,EAAA,MAAM,IAAI,CAAE,CAAA,CAAA,CAAA;AACZ,EAAA,MAAM,IAAI,CAAE,CAAA,CAAA,CAAA;AACZ,EAAA,MAAM,IAAI,CAAE,CAAA,CAAA,CAAA;AACZ,EAAA,MAAM,IAAI,CAAE,CAAA,CAAA,CAAA;AACZ,EAAA,MAAM,KAAK,CAAE,CAAA,EAAA,CAAA;AACb,EAAA,MAAM,KAAK,CAAE,CAAA,EAAA,CAAA;AAEb,EAAA,MAAA,GAAS,MAAU,IAAA,CAAA,CAAA;AACnB,EAAA,MAAA,GAAS,MAAU,IAAA,CAAA,CAAA;AACnB,EAAO,IAAA,GAAA,IAAA,IAAS,QAAS,CAAA,MAAA,GAAS,MAAU,GAAA,MAAA,CAAA;AAE5C,EAAA,IAAI,QAAQ,MAAS,GAAA,MAAA,CAAA;AAErB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,IAAA,EAAM,CAC1B,EAAA,EAAA;AACI,IAAM,MAAA,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACxB,IAAM,MAAA,CAAA,GAAI,QAAS,CAAA,KAAA,GAAQ,CAAC,CAAA,CAAA;AAE5B,IAAA,QAAA,CAAS,KAAK,CAAA,GAAK,CAAI,GAAA,CAAA,GAAM,IAAI,CAAK,GAAA,EAAA,CAAA;AACtC,IAAA,QAAA,CAAS,QAAQ,CAAC,CAAA,GAAK,CAAI,GAAA,CAAA,GAAM,IAAI,CAAK,GAAA,EAAA,CAAA;AAE1C,IAAS,KAAA,IAAA,MAAA,CAAA;AAAA,GACb;AACJ;;;;"}