Vector2Transform function

Vector2 Vector2Transform(
  1. Vector2 v,
  2. Matrix4 mat
)

Transform v as a 2D point (x, y, 0, 1) by mat.

Implementation

Vector2 Vector2Transform(Vector2 v, Matrix4 mat) => Vector2(
  mat[0] * v.x + mat[4] * v.y + mat[12],
  mat[1] * v.x + mat[5] * v.y + mat[13],
);