Unravel Engine C++ Reference
Loading...
Searching...
No Matches
particle_types.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <limits>
5
6namespace unravel
7{
8namespace ps_soa
9{
10
12{
13 uint16_t idx = std::numeric_limits<uint16_t>::max();
14};
15
16inline auto is_valid(emitter_handle handle) -> bool
17{
18 return handle.idx != std::numeric_limits<uint16_t>::max();
19}
20
22enum class emitter_shape : int
23{
24 sphere = 0,
26 circle,
27 box,
28 rect,
29 count
30};
31
33enum class emitter_direction : int
34{
35 up = 0,
36 outward,
37 inward,
38 count
39};
40
42enum class spawn_location : int
43{
44 inside = 0,
45 surface,
46 count
47};
48
50enum class simulation_space : int
51{
52 world = 0,
53 local,
54 count
55};
56
58enum class texture_mode : int
59{
60 multi_channel = 0,
61 mask,
62 count
63};
64
66enum class render_mode : int
67{
68 billboard = 0,
71 count
72};
73
75enum class blend_mode : int
76{
77 normal = 0,
80};
81
83enum class emitter_feature : uint32_t
84{
85 none = 0,
86 align_to_direction = 1u << 0,
87 texsheet = 1u << 1,
88 color_by_speed = 1u << 2,
89 size_by_speed = 1u << 3,
91 local_space = 1u << 5,
92 non_linear_ease = 1u << 6,
93};
94
96{
97 return static_cast<emitter_feature>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b));
98}
99
101{
102 return static_cast<emitter_feature>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b));
103}
104
105inline constexpr auto has_feature(emitter_feature mask, emitter_feature bit) -> bool
106{
107 return (static_cast<uint32_t>(mask) & static_cast<uint32_t>(bit)) != 0u;
108}
109
110} // namespace ps_soa
111} // namespace unravel
entt::handle b
entt::handle a
blend_mode
Blend mode. Ordinals match legacy BlendMode.
texture_mode
Texture interpretation. Ordinals match legacy TextureMode.
emitter_direction
Initial emission direction. Ordinals match legacy EmitterDirection.
constexpr auto operator&(emitter_feature a, emitter_feature b) -> emitter_feature
constexpr auto has_feature(emitter_feature mask, emitter_feature bit) -> bool
emitter_shape
Emission volume shape. Ordinals match legacy EmitterShape for content compatibility.
simulation_space
Simulation space. Ordinals match legacy SimulationSpace.
auto is_valid(emitter_handle handle) -> bool
spawn_location
Where particles spawn within the shape. Ordinals match legacy EmitterSpawnLocation.
constexpr auto operator|(emitter_feature a, emitter_feature b) -> emitter_feature
emitter_feature
Feature bits baked from authoring desc for specialized update/render paths.
render_mode
Billboard / facing mode. Ordinals match legacy RenderMode.
gfx::uniform_handle handle
Definition uniform.cpp:9