Estella
0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
ParticleEasing.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3
#pragma once
4
5
#include "
../core/Types.hpp
"
6
#include "
../animation/EasingFunctions.hpp
"
7
#include "
../ecs/components/ParticleEmitter.hpp
"
8
9
namespace
esengine::particle
{
10
11
// The enum's single source is the ES_ENUM ParticleEasing beside the component
12
// fields that serialize it (EHT generates the TS const + editor dropdown from
13
// there); the sim keeps its historical local name.
14
using
EasingType
=
ecs::ParticleEasing
;
15
16
// Delegates to the shared easing library so the math lives in ONE place
17
// (easing consolidation). Particle keeps its own 4-value
18
// enum (its serialized data format); the formulas are byte-identical to the quad
19
// easings, so this is behavior-preserving.
20
inline
f32
applyEasing
(
EasingType
type,
f32
t) {
21
switch
(type) {
22
case
EasingType::EaseIn:
return
animation::easeInQuad
(t);
23
case
EasingType::EaseOut:
return
animation::easeOutQuad
(t);
24
case
EasingType::EaseInOut:
return
animation::easeInOutQuad
(t);
25
case
EasingType::Linear:
26
default
:
return
animation::easeLinear
(t);
27
}
28
}
29
30
}
// namespace esengine::particle
EasingFunctions.hpp
ParticleEmitter.hpp
Types.hpp
Core type definitions and utilities for ESEngine.
esengine::animation::easeInQuad
f32 easeInQuad(f32 t)
Definition
EasingFunctions.hpp:18
esengine::animation::easeOutQuad
f32 easeOutQuad(f32 t)
Definition
EasingFunctions.hpp:22
esengine::animation::easeInOutQuad
f32 easeInOutQuad(f32 t)
Definition
EasingFunctions.hpp:26
esengine::animation::easeLinear
f32 easeLinear(f32 t)
Definition
EasingFunctions.hpp:14
esengine::ecs::ParticleEasing
ParticleEasing
Definition
ParticleEmitter.hpp:28
esengine::particle
Definition
Particle.cpp:5
esengine::particle::EasingType
ecs::ParticleEasing EasingType
Definition
ParticleEasing.hpp:14
esengine::particle::applyEasing
f32 applyEasing(EasingType type, f32 t)
Definition
ParticleEasing.hpp:20
esengine::f32
float f32
32-bit floating point
Definition
Types.hpp:59
src
esengine
particle
ParticleEasing.hpp
Generated by
1.15.0