Unravel Engine C++ Reference
Loading...
Searching...
No Matches
emitter_runtime.h
Go to the documentation of this file.
1#pragma once
2
3#include "particle_types.h"
4
5#include <bx/easing.h>
6#include <math/bbox.h>
7#include <math/math.h>
8#include <math/transform.hpp>
9
10#include <array>
11#include <cstdint>
12
13namespace unravel
14{
15namespace ps_soa
16{
17
26
31{
32 static constexpr size_t temporal_buffer_size = 8;
33
34 float emission_time_accum = 0.0f;
35 float start_delay_elapsed = 0.0f;
37 bool first_update = true;
38 bool playing = true;
39 bool loop = true;
41
42 std::array<math::vec3, temporal_buffer_size> temporal_positions{};
43 std::array<float, temporal_buffer_size> temporal_dts{};
44 uint32_t temporal_count = 0;
45
46 math::bbox world_bounds{math::vec3(-1.0f), math::vec3(1.0f)};
47
48 void reset();
49 void push_temporal_sample(const math::vec3& position, float dt);
50 auto calculate_smoothed_emitter_speed(float max_speed) const -> float;
51};
52
79
80} // namespace ps_soa
81} // namespace unravel
General purpose transformation class designed to maintain each component of the transformation separa...
Definition transform.hpp:27
math::vec3 position
Definition defaults.cpp:52
blend_mode
Blend mode. Ordinals match legacy BlendMode.
texture_mode
Texture interpretation. Ordinals match legacy TextureMode.
simulation_space
Simulation space. Ordinals match legacy SimulationSpace.
emitter_feature
Feature bits baked from authoring desc for specialized update/render paths.
render_mode
Billboard / facing mode. Ordinals match legacy RenderMode.
Storage for box vector values and wraps up common functionality.
Definition bbox.h:21
Hot-loop constants baked from desc (CPU now, CB-shaped for GPU later).
Mutable simulation bookkeeping owned by the soa emitter instance.
std::array< float, temporal_buffer_size > temporal_dts
std::array< math::vec3, temporal_buffer_size > temporal_positions
auto calculate_smoothed_emitter_speed(float max_speed) const -> float
static constexpr size_t temporal_buffer_size
void push_temporal_sample(const math::vec3 &position, float dt)
Per-frame transform inputs. Authoring desc never owns these.