Placement of an AlphaMask in scene coordinates, with optional rotation around a pivot point. Used by the *OverlapTransformed variants when the masks may be rotated.

The transform takes a mask-local point (mx, my) to a scene-space point (sx, sy) via:

dx = mx - pivotX
dy = my - pivotY
sx = x + cos(rotation) * dx - sin(rotation) * dy
sy = y + sin(rotation) * dx + cos(rotation) * dy

That means (x, y) is the scene-space coordinate of the mask's pivot point, and the mask rotates around (pivotX, pivotY) in its own coordinate system. With the defaults (pivotX=0, pivotY=0, rotation=0), (x, y) is the scene-space coord of the mask's top-left corner — matching the (mx, my) parameter convention of the axis-aligned maskMaskOverlap / maskBitmapOverlap.

interface MaskTransform {
    pivotX?: number;
    pivotY?: number;
    rotation?: number;
    x: number;
    y: number;
}

Properties

pivotX?: number

Mask-local coordinate of the rotation pivot. Default (0, 0).

pivotY?: number
rotation?: number

Rotation in radians around the pivot. Default 0.

x: number

Scene-space coordinate of the mask's pivot point.

y: number