Writes a merged group's hit identity into a tree's triangle records, built
from group.geometry by any builder: each record's original index (the
builder's, an index into the group's geometry) becomes the source mesh's
triangle index, the padding word the source instance index, flags bit 1
is set for a mirrored source, and flags bits 16-31 get the triangle's
material + 1 (group.sourceMaterials: its source triangle's, else its
source instance's; 0 for none). Bit 0 (the filter flag) is kept; a record with
any other flag bit set throws, since builders only write bit 0.
Call it once on fresh records (it reads the builder's original index):
assembleTraceScene does, on its own copy, so a MeshBvh can be
assembled again or swapped for another builder's tree the same way.
Writes a merged group's hit identity into a tree's triangle records, built from
group.geometryby any builder: each record's original index (the builder's, an index into the group's geometry) becomes the source mesh's triangle index, the padding word the source instance index, flags bit 1 is set for a mirrored source, and flags bits 16-31 get the triangle's material + 1 (group.sourceMaterials: its source triangle's, else its source instance's; 0 for none). Bit 0 (the filter flag) is kept; a record with any other flag bit set throws, since builders only write bit 0.Call it once on fresh records (it reads the builder's original index):
assembleTraceScenedoes, on its own copy, so aMeshBvhcan be assembled again or swapped for another builder's tree the same way.