Toast Engine
Loading...
Searching...
No Matches
collider.hpp
1
8
9#pragma once
10#include "../shape.hpp"
11
13
14namespace physics {
15
16class Simulator;
17
18class [[ToastNode, Hidden, Interface, Color("Green")]] TOAST_API Collider : public toast::Node3D {
19 friend class Simulator;
20
21public:
22 [[Reflect]]
23 bool disabled = false;
24
25 [[Reflect]]
26 bool draw_debug = true;
27
28 [[Reflect, Color]]
29 glm::vec4 debug_color = glm::vec4(0.0f, 1.0f, 0.251f, 0.5f); // Matches editor green
30
31 [[Reflect]]
32 bool debug_fill = true;
33
34 [[Reflect, Name("Show AABB"), Group("AABB")]]
35 bool show_aabb = false;
36
37 [[Reflect, Color, Name("AABB Color"), Group("AABB")]]
38 glm::vec4 aabb_color = glm::vec4(1.0f, 0.75f, 0.15f, 0.6f);
39
40 [[Reflect, Name("Fill Shape"), Group("AABB")]]
41 bool aabb_fill = false;
42
43 void overrideColor(glm::vec4 color);
44 void clearColorOverride();
45
46private:
47 void updateInspectorMessages() override;
48 void init();
49 void destroy();
50 void onEnable();
51 void onDisable();
52 void drawDebug();
53
54 void assignShape(ShapeID shape) noexcept { m_shape = shape; }
55
56 ShapeID m_shape;
57 bool m_debug_visible = false;
58 bool m_override_color = false;
59 glm::vec4 m_overridden_color;
60};
61
62}
Definition collider.hpp:18
Definition simulator.hpp:57
Definition node_3d.hpp:25
Node with 3D spatial transforms.
Shape identifiers, geometry, and runtime records.
Definition shape.hpp:29