Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
Collider2D.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
10#pragma once
11
12#include "../../core/Types.hpp"
14#include "../../math/Math.hpp"
15
16namespace esengine::ecs {
17
21 glm::vec2 halfExtents{0.5f, 0.5f};
22
24 glm::vec2 offset{0.0f, 0.0f};
25
27 f32 density{1.0f};
28
31
34
36 bool isSensor{false};
37
39 bool enabled{true};
40
43
45 u32 maskBits{0xFFFF};
46
47 BoxCollider2D() = default;
48};
49
53 f32 radius{0.5f};
54
56 glm::vec2 offset{0.0f, 0.0f};
57
59 f32 density{1.0f};
60
63
66
68 bool isSensor{false};
69
71 bool enabled{true};
72
75
77 u32 maskBits{0xFFFF};
78
79 CircleCollider2D() = default;
80};
81
85 f32 radius{0.25f};
86
89
91 glm::vec2 offset{0.0f, 0.0f};
92
94 f32 density{1.0f};
95
98
101
103 bool isSensor{false};
104
106 bool enabled{true};
107
110
112 u32 maskBits{0xFFFF};
113
114 CapsuleCollider2D() = default;
115};
116
120 glm::vec2 point1{-0.5f, 0.0f};
121
123 glm::vec2 point2{0.5f, 0.0f};
124
127
130
133
135 bool isSensor{false};
136
138 bool enabled{true};
139
142
144 u32 maskBits{0xFFFF};
145
146 SegmentCollider2D() = default;
147};
148
149
150} // namespace esengine::ecs
Math utilities and GLM configuration for ESEngine.
Reflection and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
float f32
32-bit floating point
Definition Types.hpp:59