Toast Engine
Toggle main menu visibility
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>
13
#include <
toast/voxel/connectivity.hpp
>
14
15
namespace
physics {
16
17
enum class
ComponentClass : uint8_t {
18
anchored,
19
detached,
20
dropped,
21
};
22
23
[[nodiscard]]
24
auto
classifyComponents(
const
voxel::Connectivity& c, glm::uvec3 brick_size, AnchorMask mask) -> std::vector<ComponentClass>;
25
26
struct
DetachedComponent
{
27
uint32_t component = 0;
28
std::vector<voxel::BrickPiece> pieces;
29
uint32_t voxel_count = 0;
30
};
31
32
[[nodiscard]]
33
auto
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
38
inline
auto
maxFragmentExtentBricks() -> int32_t {
39
return
tunables().max_fragment_extent_bricks;
40
}
41
42
[[nodiscard]]
43
auto
splitBySpatialCompactness(std::vector<DetachedComponent> components, int32_t max_extent_bricks = maxFragmentExtentBricks())
44
-> std::vector<DetachedComponent>;
45
46
}
anchor_mask.hpp
TODO: Brief description of the file's purpose.
connectivity.hpp
physics_settings.hpp
physics::DetachedComponent
Definition
component_classification.hpp:26
voxel::Connectivity
Labels are deterministic with pieces in brick order and components by first appearance.
Definition
connectivity.hpp:65
engine
src
toast
physics
component_classification.hpp
Generated by
1.17.0