Skip to content

@modoki/engine / index / Mat2D

Interface: Mat2D

Pure 2D affine-skinning math for the .rig2d.json runtime (skin2DSystem).

A 2×3 affine matrix Mat2D maps a point (x,y) → (a·x + c·y + e, b·x + d·y + f):

 | a  c  e |     | x |     | a·x + c·y + e |
 | b  d  f |  ·  | y |  =  | b·x + d·y + f |
 | 0  0  1 |     | 1 |     |       1       |

Everything here is deterministic (only Math.cos/Math.sin/arithmetic — no wall-clock, no RNG) so the skinning fits the verification harness and the determinism guard. Angles are RADIANS, matching Transform.rz at runtime.

No imports — this module is unit-tested in isolation (rig2dMath.test.ts) and consumed by both skin2DSystem (deform) and the rig loader (inverse-bind).

Skinning

a

a: number


b

b: number


c

c: number


d

d: number


e

e: number


f

f: number

Built with Modoki.