@playcanvas/splat-transform
Version:
Library and CLI tool for 3D Gaussian splat format conversion and transformation
35 lines (34 loc) • 1.11 kB
TypeScript
/**
* Encode block coordinates to Morton code (17 bits per axis = 51 bits total).
* Supports up to 131,072 blocks per axis.
*
* @param x - Block X coordinate
* @param y - Block Y coordinate
* @param z - Block Z coordinate
* @returns Morton code with interleaved bits: ...z2y2x2 z1y1x1 z0y0x0
*/
declare function xyzToMorton(x: number, y: number, z: number): number;
/**
* Count the number of set bits in a 32-bit integer.
*
* @param n - 32-bit integer
* @returns Number of bits set to 1
*/
declare function popcount(n: number): number;
/**
* Check if a voxel mask represents a solid block (all 64 bits set).
*
* @param lo - Lower 32 bits of mask
* @param hi - Upper 32 bits of mask
* @returns True if all 64 voxels are solid
*/
declare function isSolid(lo: number, hi: number): boolean;
/**
* Check if a voxel mask represents an empty block (no bits set).
*
* @param lo - Lower 32 bits of mask
* @param hi - Upper 32 bits of mask
* @returns True if all 64 voxels are empty
*/
declare function isEmpty(lo: number, hi: number): boolean;
export { xyzToMorton, popcount, isSolid, isEmpty };