Estella
0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
ParticleCollider.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
"
13
#include "
../../core/Reflection.hpp
"
14
#include "
../../math/Math.hpp
"
15
16
namespace
esengine::ecs
{
17
18
ES_ENUM
(stability=beta)
19
enum class
ParticleColliderShape
:
i32
{
20
Sphere
= 0,
21
Box
= 1,
22
Capsule
= 2,
23
};
24
25
ES_COMPONENT
(stability=beta)
26
struct
ParticleCollider
{
27
ES_PROPERTY
(
enum
=
ParticleColliderShape
, category=
Shape
)
28
i32
shape
{
static_cast<
i32
>
(
ParticleColliderShape::Sphere
)};
29
30
// A sphere's radius, and a capsule's round its axis.
31
ES_PROPERTY
(min=0, category=
Shape
)
32
f32
radius
{50.0f};
33
34
// A capsule's axis runs along the entity's up, this far each way from its centre.
35
ES_PROPERTY
(min=0, category=
Shape
)
36
f32
halfHeight
{50.0f};
37
38
ES_PROPERTY
(category=
Shape
)
39
glm::vec3
halfExtents
{50.0f, 50.0f, 50.0f};
40
41
// Keeps particles in rather than out: a dome round a spell, the inside of a jar.
42
ES_PROPERTY
(category=
Shape
)
43
bool
inverted
{
false
};
44
45
// Which emitters it stops: one that shares a bit with this in its collisionMask.
46
ES_PROPERTY
(bitmask_source=collisionLayers, min=0, max=65535, step=1, category=
Shape
)
47
u32
mask
{65535};
48
49
ES_PROPERTY
()
50
bool
enabled
{
true
};
51
52
ParticleCollider
() =
default
;
53
};
54
55
}
// namespace esengine::ecs
Math.hpp
Math utilities and GLM configuration for ESEngine.
Reflection.hpp
Reflection and metadata system for automatic binding generation.
ES_COMPONENT
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
Definition
Reflection.hpp:46
ES_ENUM
#define ES_ENUM(...)
Mark an enum that should be exposed to scripts.
Definition
Reflection.hpp:119
ES_PROPERTY
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Definition
Reflection.hpp:95
Types.hpp
Core type definitions and utilities for ESEngine.
esengine::ecs
Definition
AotComponents.generated.hpp:8
esengine::ecs::ParticleColliderShape
ParticleColliderShape
Definition
ParticleCollider.hpp:19
esengine::ecs::ParticleColliderShape::Box
@ Box
Definition
ParticleCollider.hpp:21
esengine::ecs::ParticleColliderShape::Capsule
@ Capsule
Definition
ParticleCollider.hpp:22
esengine::ecs::ParticleColliderShape::Sphere
@ Sphere
Definition
ParticleCollider.hpp:20
esengine::i32
std::int32_t i32
Signed 32-bit integer.
Definition
Types.hpp:54
esengine::u32
std::uint32_t u32
Unsigned 32-bit integer.
Definition
Types.hpp:45
esengine::RenderType::Shape
@ Shape
Definition
RenderItem.hpp:28
esengine::f32
float f32
32-bit floating point
Definition
Types.hpp:59
esengine::ecs::ParticleCollider::inverted
bool inverted
Definition
ParticleCollider.hpp:43
esengine::ecs::ParticleCollider::ParticleCollider
ParticleCollider()=default
esengine::ecs::ParticleCollider::halfExtents
glm::vec3 halfExtents
Definition
ParticleCollider.hpp:39
esengine::ecs::ParticleCollider::mask
u32 mask
Definition
ParticleCollider.hpp:47
esengine::ecs::ParticleCollider::shape
i32 shape
Definition
ParticleCollider.hpp:28
esengine::ecs::ParticleCollider::halfHeight
f32 halfHeight
Definition
ParticleCollider.hpp:36
esengine::ecs::ParticleCollider::enabled
bool enabled
Definition
ParticleCollider.hpp:50
esengine::ecs::ParticleCollider::radius
f32 radius
Definition
ParticleCollider.hpp:32
src
esengine
ecs
components
ParticleCollider.hpp
Generated by
1.15.0