Triangle flags bit 1: flip the hit's frontFace. Set by
assembleTraceScene on a merged mesh's triangles (mergeStaticInstances,
static-merge.ts) that come from a mirrored source instance: they are stored
in world space, where a mirror reverses the authored winding. Builders never
write it, and an input's triangleFlags may not set it (only bit 0;
bits 1-31 throw). Bits 2-15 are reserved, 0. Bits 16-31 hold the
triangle's material (MATERIAL_SHIFT: material + 1, 0 for none):
the mesh input's triangleMaterials, which every builder writes, and in a
merged mesh its source's (the source triangle's, else the source
instance's), which assembleTraceScene writes.
Triangle
flagsbit 1: flip the hit'sfrontFace. Set byassembleTraceSceneon a merged mesh's triangles (mergeStaticInstances, static-merge.ts) that come from a mirrored source instance: they are stored in world space, where a mirror reverses the authored winding. Builders never write it, and an input'striangleFlagsmay not set it (only bit 0; bits 1-31 throw). Bits 2-15 are reserved, 0. Bits 16-31 hold the triangle's material (MATERIAL_SHIFT: material + 1, 0 for none): the mesh input'striangleMaterials, which every builder writes, and in a merged mesh its source's (the source triangle's, else the source instance's), whichassembleTraceScenewrites.