euv_core/game/particles/
struct.rs1use super::*;
2
3#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
5pub struct Particle {
6 #[get(type(copy))]
8 pub(crate) active: bool,
9 #[get(type(copy))]
11 pub(crate) position: Point,
12 #[get(type(copy))]
14 pub(crate) velocity: Point,
15 #[get(type(copy))]
17 pub(crate) age: f32,
18 #[get(type(copy))]
20 pub(crate) lifetime: f32,
21 #[get(type(copy))]
23 pub(crate) start_size: f32,
24 #[get(type(copy))]
26 pub(crate) end_size: f32,
27 #[get(type(copy))]
29 pub(crate) start_color: Color,
30 #[get(type(copy))]
32 pub(crate) end_color: Color,
33 #[get(type(copy))]
35 pub(crate) drag: f32,
36}
37
38#[derive(Clone, Copy, Data, Debug, PartialEq)]
40pub struct ParticleEmitterConfig {
41 #[get(type(copy))]
43 pub(crate) base_angle: f32,
44 #[get(type(copy))]
46 pub(crate) spread_rad: f32,
47 #[get(type(copy))]
49 pub(crate) min_speed: f32,
50 #[get(type(copy))]
52 pub(crate) max_speed: f32,
53 #[get(type(copy))]
55 pub(crate) min_life: f32,
56 #[get(type(copy))]
58 pub(crate) max_life: f32,
59 #[get(type(copy))]
61 pub(crate) start_size: f32,
62 #[get(type(copy))]
64 pub(crate) end_size: f32,
65 #[get(type(copy))]
67 pub(crate) start_color: Color,
68 #[get(type(copy))]
70 pub(crate) end_color: Color,
71 #[get(type(copy))]
73 pub(crate) drag: f32,
74}
75
76#[derive(Clone, Data, Debug)]
78pub struct ParticleSystem {
79 pub(crate) pool: Vec<Particle>,
81 #[get(pub(crate), type(copy))]
83 #[set(pub(crate))]
84 pub(crate) cursor: usize,
85 #[get(pub(crate), type(copy))]
87 #[set(pub(crate))]
88 pub(crate) rng_state: u64,
89 #[get(type(copy))]
91 pub(crate) gravity: Point,
92 #[get(type(copy))]
94 pub(crate) active_count: usize,
95}