From 72bb40b74e5d16ec86632609eea95554bd973a56 Mon Sep 17 00:00:00 2001 From: leElvyn Date: Sun, 23 Jan 2022 20:17:23 +0100 Subject: [PATCH 1/2] Added data (speed) to particle struct and system --- feather/server/src/client.rs | 2 +- libcraft/particles/src/particle.rs | 1 + quill/api/src/game.rs | 2 ++ quill/example-plugins/particle-example/src/lib.rs | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/feather/server/src/client.rs b/feather/server/src/client.rs index f18af09a1..c05f01609 100644 --- a/feather/server/src/client.rs +++ b/feather/server/src/client.rs @@ -557,7 +557,7 @@ impl Client { offset_x: particle.offset_x, offset_y: particle.offset_y, offset_z: particle.offset_z, - particle_data: 0.0, + particle_data: particle.data, particle_count: particle.count, }) } diff --git a/libcraft/particles/src/particle.rs b/libcraft/particles/src/particle.rs index 4e514fd4f..d8040612a 100644 --- a/libcraft/particles/src/particle.rs +++ b/libcraft/particles/src/particle.rs @@ -11,6 +11,7 @@ pub struct Particle { pub offset_y: f32, pub offset_z: f32, pub count: i32, + pub data: f32, } /// This is an enum over the kinds of particles diff --git a/quill/api/src/game.rs b/quill/api/src/game.rs index 9a72ab982..68318cf49 100644 --- a/quill/api/src/game.rs +++ b/quill/api/src/game.rs @@ -128,6 +128,8 @@ impl Game { /// offset_y: 0.0, /// offset_z: 0.0, /// count: 1, + /// pub particle_data: f32, + /// pub particle_count: i32, /// }; /// /// game.spawn_particle(position, particle); diff --git a/quill/example-plugins/particle-example/src/lib.rs b/quill/example-plugins/particle-example/src/lib.rs index bd84bb58d..2e90441d8 100644 --- a/quill/example-plugins/particle-example/src/lib.rs +++ b/quill/example-plugins/particle-example/src/lib.rs @@ -28,6 +28,7 @@ fn particle_system(_plugin: &mut ParticleExample, game: &mut Game) { offset_y: 0.0, offset_z: 0.0, count: 1, + data: 0.0, }; game.spawn_particle(position, particle); @@ -45,6 +46,7 @@ fn particle_system(_plugin: &mut ParticleExample, game: &mut Game) { offset_y: 0.0, offset_z: 0.0, count: 1, + data: 0.0, }; // Initialise an empty ecs-entity builder From 5b048516cbb9b3d9864e6528a6bd48552e8700de Mon Sep 17 00:00:00 2001 From: leElvyn Date: Sun, 23 Jan 2022 21:16:49 +0100 Subject: [PATCH 2/2] Correction of attribute names --- quill/api/src/game.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quill/api/src/game.rs b/quill/api/src/game.rs index 68318cf49..90a39ecd6 100644 --- a/quill/api/src/game.rs +++ b/quill/api/src/game.rs @@ -128,8 +128,7 @@ impl Game { /// offset_y: 0.0, /// offset_z: 0.0, /// count: 1, - /// pub particle_data: f32, - /// pub particle_count: i32, + /// data: 0.0, /// }; /// /// game.spawn_particle(position, particle);