Toast Engine
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
17namespace physics {
18
20 std::optional<glm::vec3> point;
21 glm::vec3 direction {};
22 float speed = 0.0f;
23 float max_impulse = 0.0f;
24};
25
26struct 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
36 glm::vec3 point {};
37 float force = 0.0f;
38 float falloff = tunables().explosion_falloff;
39 Hardness max_hardness = k_hardest;
40};
41
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
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 identifiers, creation data, and copied runtime state.
Tiers of how hard a material is to break.
Shape identifiers, geometry, and runtime records.
Definition damage_command.hpp:26
Definition body.hpp:20
Definition damage_command.hpp:56
Definition damage_command.hpp:42
Definition damage_command.hpp:35
Definition damage_command.hpp:19
Definition shape.hpp:29