Toast Engine
Loading...
Searching...
No Matches
fragment_extraction.hpp File Reference
#include "component_classification.hpp"
#include <array>
#include <glm/glm.hpp>
#include <optional>
#include <toast/voxel/mass_accumulator.hpp>
#include <toast/voxel/palette.hpp>
#include <toast/voxel/voxel_volume.hpp>
Include dependency graph for fragment_extraction.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  physics::RemovedVoxels
struct  physics::ExtractedFragment

Typedefs

using physics::DensityTable = std::array<uint32_t, voxel::k_palette_size>

Functions

auto physics::extractFragmentVolume (voxel::Volume &source, const DetachedComponent &component, const DensityTable &density) -> std::optional< ExtractedFragment >
void physics::restoreFragment (voxel::Volume &source, voxel::Volume &fragment, glm::ivec3 offset)
auto physics::discardComponent (voxel::Volume &source, const DetachedComponent &component, const DensityTable &density) -> RemovedVoxels

Detailed Description

Author
Xein
Date
20 Sep 2026

Function Documentation

◆ extractFragmentVolume()

auto physics::extractFragmentVolume ( voxel::Volume & source,
const DetachedComponent & component,
const DensityTable & density ) -> std::optional< ExtractedFragment >
nodiscard
Returns
nullopt with source untouched when the pool is short of bricks