Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
voxel_shape_data.hpp
Go to the documentation of this file.
1
7
8
#pragma once
9
10
#include "
anchor_mask.hpp
"
11
#include "
component_classification.hpp
"
12
#include "
damage_command.hpp
"
13
#include "
shape.hpp
"
14
15
#include <cstdint>
16
#include <memory>
17
#include <optional>
18
#include <
toast/voxel/mass_accumulator.hpp
>
19
#include <
toast/voxel/palette.hpp
>
20
#include <
toast/voxel/runtime_pool.hpp
>
21
#include <
toast/voxel/surface.hpp
>
22
#include <
toast/voxel/voxel_volume.hpp
>
23
24
namespace
physics {
25
26
struct
VoxelShapeData
{
27
voxel::Volume
* volume =
nullptr
;
28
voxel::VolumeSurface
surface;
29
voxel::MassMoments
moments;
30
voxel::Palette
palette;
31
voxel::MaterialLibrary
materials;
33
uint64_t
palette_uid
= 0;
34
uint32_t source_revision = 0;
35
uint32_t surface_revision = 1;
36
uint32_t solid_voxel_count = 0;
37
AnchorMask anchor_mask = k_anchor_null;
38
bool
connectivity_dirty =
false
;
39
std::optional<FragmentPush> pending_push;
40
std::vector<DetachedComponent> detached_components;
41
std::unique_ptr<voxel::Volume> owned_volume;
42
BodyID
fragment_origin;
43
uint64_t fragment_sequence = 0;
44
float
fragment_sleep_seconds = 0.0f;
45
};
46
47
struct
VoxelShapeSlot {
48
VoxelShapeSlot() =
default
;
49
VoxelShapeSlot(
const
VoxelShapeSlot&) =
delete
;
50
auto
operator=(
const
VoxelShapeSlot&) -> VoxelShapeSlot& =
delete
;
51
VoxelShapeSlot(VoxelShapeSlot&&)
noexcept
=
default
;
52
auto
operator=(VoxelShapeSlot&&)
noexcept
-> VoxelShapeSlot& =
default
;
53
54
std::optional<VoxelShapeData> data;
55
uint32_t generation = 1;
56
};
57
58
}
anchor_mask.hpp
TODO: Brief description of the file's purpose.
voxel::VolumeSurface
Keyed by brick slot not pool id since uniform bricks have no pool id and shared bricks differ per ins...
Definition
surface.hpp:174
voxel::Volume
Definition
voxel_volume.hpp:21
component_classification.hpp
TODO: Brief description of the file's purpose.
damage_command.hpp
The kinds of damage that break voxels.
mass_accumulator.hpp
palette.hpp
runtime_pool.hpp
shape.hpp
Shape identifiers, geometry, and runtime records.
physics::BodyID
Definition
body.hpp:20
physics::VoxelShapeData
Definition
voxel_shape_data.hpp:26
physics::VoxelShapeData::palette_uid
uint64_t palette_uid
Source palette uid so a hot reload can refresh the copies above.
Definition
voxel_shape_data.hpp:33
voxel::MassMoments
Definition
mass_accumulator.hpp:18
voxel::MaterialLibrary
Definition
palette.hpp:143
voxel::Palette
Entry 0 is the empty voxel and must stay all zero.
Definition
palette.hpp:59
surface.hpp
voxel_volume.hpp
engine
src
toast
physics
voxel_shape_data.hpp
Generated by
1.17.0