uvAt method

LightmapUv uvAt(
  1. LightmapFace face,
  2. double su,
  3. double sv
)

The second texture coordinate of a face's corner, where su and sv are −1 or 1 along LightmapFace.u and LightmapFace.v — the same corners BrushGeometry emits.

Implementation

LightmapUv uvAt(LightmapFace face, double su, double sv) => LightmapUv(
  u: (face.x + (su + 1.0) * 0.5 * face.extentU * texelsPerMeter) / width,
  v: (face.y + (sv + 1.0) * 0.5 * face.extentV * texelsPerMeter) / height,
);