mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:07:09 +00:00
Add support for type 4 decoding
This commit is contained in:
@@ -84,8 +84,12 @@ const DougalBinaryLoader = {
|
|||||||
for (let k = 0; k < values.length; k++) {
|
for (let k = 0; k < values.length; k++) {
|
||||||
values[k] = new (k === 0 ? Uint16Array : k === 1 ? Uint32Array : k === 2 ? BigUint64Array : Float32Array)(totalCount);
|
values[k] = new (k === 0 ? Uint16Array : k === 1 ? Uint32Array : k === 2 ? BigUint64Array : Float32Array)(totalCount);
|
||||||
}
|
}
|
||||||
|
} else if (udv == 4) {
|
||||||
|
for (let k = 0; k < values.length; k++) {
|
||||||
|
values[k] = new (k === 0 ? Uint16Array : k === 1 ? Uint32Array : k === 2 ? Uint16Array : Float32Array)(totalCount);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Invalid udv: Expected 0, 1, or 2; found ${udv}`);
|
throw new Error(`Invalid udv: Expected 0, 1, 2, or 4; found ${udv}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
@@ -110,7 +114,7 @@ const DougalBinaryLoader = {
|
|||||||
offset += chunk.jCount;
|
offset += chunk.jCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Parsed ${totalCount} points, ${values.length} value arrays`);
|
console.log(`Parsed ${totalCount} points, ${values.length} value arrays, udv = ${udv}`);
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
getPosition: {
|
getPosition: {
|
||||||
|
|||||||
Reference in New Issue
Block a user