The 2D layer · type
Affine2D
Six numbers, laid out the way a 2D graphics API has laid them out for thirty years:
Explained in Sprites and tilemaps.
type Affine2D = Float32Arrayimport type { Affine2D } from '@driftengine/ui2d';In depth
ndc.x = m[0] * x + m[2] * y + m[4]
ndc.y = m[1] * x + m[3] * y + m[5]A Float32Array rather than six fields because it is uploaded as two vec4s and read by the
vertex stage every frame; an object would be repacked on the way.