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

Go to the source code of this file.

Classes

struct  voxel::LatticeOrientation
 Output axis i reads input axis source[i] negated when flip[i]. More...
struct  voxel::LatticePlacement
struct  voxel::PaletteRemap
struct  voxel::StampResult

Typedefs

using voxel::PaletteRemapTable = std::array<uint8_t, k_palette_size>
 Index 0 always maps to 0.

Functions

auto voxel::allLatticeOrientations () -> std::array< LatticeOrientation, 48 >
auto voxel::toMatrix (const LatticeOrientation &orientation) -> glm::mat3
auto voxel::placeVoxel (const LatticePlacement &placement, glm::ivec3 voxel) noexcept -> glm::ivec3
 A flipped axis lands cell [v, v + 1] on [-v - 1, -v] hence the -1.
auto voxel::placementFromTransform (const glm::mat4 &transform, float voxel_size=k_voxel_size, float tolerance=1e-4f) -> std::optional< LatticePlacement >
 Matrix entries within tolerance of 0 or +/-1 and translation within a millimetre of a voxel boundary.
auto voxel::identityRemap () -> PaletteRemapTable
auto voxel::buildRemap (const Palette &piece, const Palette &master) -> PaletteRemap
auto voxel::stamp (Volume &target, const Volume &piece, const LatticePlacement &placement, const PaletteRemapTable &remap) -> StampResult
 target and piece must be different volumes

Detailed Description

Author
dario
Date
11/09/2026