entityFromVoxModel()
entityFromVox for a model already parsed with the renderer's parseVox.
function entityFromVoxModel(m: VoxModel, opts?: FromVoxOptions): Entity;Defined in: engine/src/vox.ts:54
Parameters
| Parameter | Type |
|---|---|
m | VoxModel |
opts? | FromVoxOptions |
Returns
entityFromVox()
Parse a .vox buffer into an entity, cropped to its occupied box. Each distinct palette colour becomes a role (color.0, color.1, ... in first-seen order, colours from the file's palette), so the entity can be restyled like a generated one. Only the first model in the file is read; colours past...
entityToVox()
Serialise an entity to .vox. MagicaVoxel stores coordinates in single bytes, so no axis may exceed 255; larger models throw rather than silently wrapping. Role colours become the file's palette (role v at index v); materials, rigs and clips are not written. Dense models only: a sparse model has...