Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
collider.hpp
1
8
9
#pragma once
10
#include "
../shape.hpp
"
11
12
#include <
toast/world/node_3d.hpp
>
13
14
namespace
physics {
15
16
class
Simulator
;
17
18
class
[[ToastNode, Hidden, Interface, Color(
"Green"
)]] TOAST_API
Collider
:
public
toast::Node3D
{
19
friend
class
Simulator;
20
21
public
:
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
46
private
:
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
}
physics::Collider
Definition
collider.hpp:18
physics::Simulator
Definition
simulator.hpp:57
toast::Node3D
Definition
node_3d.hpp:25
node_3d.hpp
Node with 3D spatial transforms.
shape.hpp
Shape identifiers, geometry, and runtime records.
physics::ShapeID
Definition
shape.hpp:29
engine
src
toast
physics
nodes
collider.hpp
Generated by
1.17.0