Toast Engine
Loading...
Searching...
No Matches
component_classification.hpp
Go to the documentation of this file.
1
7
8#pragma once
9#include "anchor_mask.hpp"
10#include "physics_settings.hpp"
11
12#include <glm/glm.hpp>
14
15namespace physics {
16
17enum class ComponentClass : uint8_t {
18 anchored,
19 detached,
20 dropped,
21};
22
23[[nodiscard]]
24auto classifyComponents(const voxel::Connectivity& c, glm::uvec3 brick_size, AnchorMask mask) -> std::vector<ComponentClass>;
25
27 uint32_t component = 0;
28 std::vector<voxel::BrickPiece> pieces;
29 uint32_t voxel_count = 0;
30};
31
32[[nodiscard]]
33auto buildDetachedComponents(
34 const voxel::Connectivity& c, std::span<const ComponentClass> classes, glm::uvec3 brick_size,
35 ComponentClass target_class = ComponentClass::detached
36) -> std::vector<DetachedComponent>;
37
38inline auto maxFragmentExtentBricks() -> int32_t {
39 return tunables().max_fragment_extent_bricks;
40}
41
42[[nodiscard]]
43auto splitBySpatialCompactness(std::vector<DetachedComponent> components, int32_t max_extent_bricks = maxFragmentExtentBricks())
44 -> std::vector<DetachedComponent>;
45
46}
TODO: Brief description of the file's purpose.
Definition component_classification.hpp:26
Labels are deterministic with pieces in brick order and components by first appearance.
Definition connectivity.hpp:65