TheAtlasEngine
 
Loading...
Searching...
No Matches
components.hpp
1#pragma once
2#include <glm/glm.hpp>
3
4namespace atlas {
8 enum body_type : uint8_t {
9 fixed = 0,
10 kinematic = 1,
11 dynamic = 2,
12 bodynum,
13 };
14
21 enum body_layer : uint8_t {
22 non_moving = 0,
23 moving = 1,
24 layer_num,
25 };
26
27 enum activation : uint8_t { activate, deactivate };
28
34 struct physics_body {
35 glm::vec3 linear_velocity = glm::vec3(0.0);
36 glm::vec3 angular_velocity = glm::vec3(0.0f);
37
38 glm::vec3 force = glm::vec3(0.0f);
39 glm::vec3 impulse = glm::vec3(0.0f);
40 glm::vec3 torque = glm::vec3(0.0f);
41
42 float mass_factor = 1.0f;
43 glm::vec3 center_mass_position = glm::vec3(0.0f);
44 float linear_damping = 0.0f;
45 float angular_damping = 0.0f;
46
47 float gravity_factor = 1.0f;
48 float friction = 0.8f;
49 float restitution = 0.2f;
50
52 uint8_t body_movement_type = body_type::fixed;
53
56 uint8_t body_layer_type = body_layer::moving;
57 };
58
59 struct box_collider {
60 glm::vec3 half_extent = glm::vec3(0.5f);
61 };
62
64 float radius = 0.5f;
65 float half_height = 0.5f;
66 };
67
69 float radius = 0.5f;
70 };
71
72};
Definition components.hpp:59
Definition components.hpp:63
physics body data-driven representative
Definition components.hpp:34
uint8_t body_layer_type
body_layer (object layers) refer to the rules of the collision system specified in JoltPhysics
Definition components.hpp:56
uint8_t body_movement_type
body_type::fixed means this physics body is static
Definition components.hpp:52
Definition components.hpp:68