/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/scene/sprite-tiling/utils/applyMatrix.ts
37 строк
825 B
Zyie
chore: documentation overhaul with typedoc (#11423)
19 май 2025, 11:44
Не верифицирован
19 май 2025, 11:44
34926f0
Код
Авторство
О чём код?
import type { Matrix } from '../../../maths/matrix/Matrix'; import type { TypedArray } from '../../../rendering/renderers/shared/buffer/Buffer'; /** * @param array * @param stride * @param offset * @param matrix * @internal */ export function applyMatrix(array: TypedArray, stride: number, offset: number, matrix: Matrix) { let index = 0; const size = array.length / (stride || 2); const a = matrix.a; const b = matrix.b; const c = matrix.c; const d = matrix.d; const tx = matrix.tx; const ty = matrix.ty; offset *= stride; while (index < size) { const x = array[offset]; const y = array[offset + 1]; array[offset] = (a * x) + (c * y) + tx; array[offset + 1] = (b * x) + (d * y) + ty; offset += stride; index++; } }