Toast Engine
Loading...
Searching...
No Matches
vox_import.hpp File Reference
#include <cstdint>
#include <glm/glm.hpp>
#include <optional>
#include <span>
#include <string>
#include <toast/export.hpp>
#include <toast/voxel/brick_pool.hpp>
#include <toast/voxel/palette.hpp>
#include <toast/voxel/stamp.hpp>
#include <toast/voxel/voxel_volume.hpp>
#include <vector>
Include dependency graph for vox_import.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  assets::VoxVoxel
struct  assets::VoxModel
struct  assets::VoxTransform
 Translation positions the node centre not its corner. More...
struct  assets::VoxNode
struct  assets::VoxScene
struct  assets::VoxPlacement

Functions

auto assets::voxOrientationFromByte (uint8_t rotation) -> std::optional< voxel::LatticeOrientation >
 Bits 0-1 source axis of x bits 2-3 source axis of y bits 4-6 negate x y z so the identity is 4 not 0.
auto assets::voxOrientationToByte (const LatticeOrientation &orientation) -> uint8_t
auto assets::composeVoxTransforms (const VoxTransform &parent, const VoxTransform &local) -> VoxTransform
auto assets::voxPlacementOf (const VoxTransform &world, glm::uvec3 model_dims) -> voxel::LatticePlacement
 Half the size moves into the offset floored on unflipped axes and rounded up on flipped ones.
auto assets::flattenVoxScene (const VoxScene &scene) -> std::vector< VoxPlacement >
auto assets::buildVoxVolume (const VoxModel &model, BrickPool &pool) -> std::optional< Volume >
auto assets::importVox (std::span< const uint8_t > data) -> VoxScene

Variables

constexpr uint32_t assets::k_vox_max_dim = 256

Detailed Description

Author
dario
Date
12/09/2026

Function Documentation

◆ importVox()

TOAST_API auto assets::importVox ( std::span< const uint8_t > data) -> VoxScene
nodiscard
Exceptions
std::runtime_erroron anything unrepresentable