Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- coalesceRecords(records: WGLDisplayRecord[]): void {
- const nRecords = records.length;
- if (nRecords === 0) {
- return;
- }
- let coalesced = 1;
- for (let i = 1; i < nRecords; ++i) {
- if (
- records[i - coalesced].geometryType === records[i].geometryType &&
- records[i - coalesced]["_materialInfo"] === records[i]["_materialInfo"]
- ) {
- records[i - coalesced].vertexCount += records[i].vertexCount;
- records[i - coalesced].indexCount += records[i].indexCount;
- ++coalesced;
- } else {
- records[i - coalesced + 1] = records[i];
- }
- }
- records.length = records.length - coalesced + 1;
- }
Add Comment
Please, Sign In to add comment