Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
damage_command.hpp
Go to the documentation of this file.
1
7
8
#pragma once
9
#include "
body.hpp
"
10
#include "
hardness.hpp
"
11
#include "
physics_settings.hpp
"
12
#include "
shape.hpp
"
13
14
#include <glm/glm.hpp>
15
#include <optional>
16
17
namespace
physics {
18
19
struct
FragmentPush
{
20
std::optional<glm::vec3> point;
21
glm::vec3 direction {};
22
float
speed = 0.0f;
23
float
max_impulse = 0.0f;
24
};
25
26
struct
AreaDamage
{
27
glm::vec3 point {};
28
float
fracture_radius = 0.0f;
29
float
energy_density = 0.0f;
30
glm::vec3 direction {};
31
Hardness max_hardness = k_hardest;
32
std::optional<FragmentPush> push;
33
};
34
35
struct
ExplosionDamage
{
36
glm::vec3 point {};
37
float
force = 0.0f;
38
float
falloff = tunables().explosion_falloff;
39
Hardness max_hardness = k_hardest;
40
};
41
42
struct
DamageCommand
{
43
ShapeID
shape;
44
glm::vec3 world_center {};
45
float
fracture_radius = 0.0f;
46
float
energy_density = 0.0f;
47
glm::vec3 direction {};
48
Hardness max_hardness = k_hardest;
49
BodyID
source;
50
uint64_t seed = 0;
51
52
float
shell_voxels = tunables().fracture_shell_voxels;
53
std::optional<FragmentPush> push;
54
};
55
56
struct
CapsuleSmash
{
57
float
energy_density = 0.0f;
58
glm::vec3 direction {};
59
float
force = 0.0f;
60
float
max_speed = 0.0f;
61
Hardness max_hardness = k_hardest;
62
};
63
64
}
body.hpp
Body identifiers, creation data, and copied runtime state.
hardness.hpp
Tiers of how hard a material is to break.
physics_settings.hpp
shape.hpp
Shape identifiers, geometry, and runtime records.
physics::AreaDamage
Definition
damage_command.hpp:26
physics::BodyID
Definition
body.hpp:20
physics::CapsuleSmash
Definition
damage_command.hpp:56
physics::DamageCommand
Definition
damage_command.hpp:42
physics::ExplosionDamage
Definition
damage_command.hpp:35
physics::FragmentPush
Definition
damage_command.hpp:19
physics::ShapeID
Definition
shape.hpp:29
engine
src
toast
physics
damage_command.hpp
Generated by
1.17.0