Skip to content

Added data field to the Particle Struct and particles system #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion feather/server/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
Expand Down
1 change: 1 addition & 0 deletions libcraft/particles/src/particle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions quill/api/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ impl Game {
/// offset_y: 0.0,
/// offset_z: 0.0,
/// count: 1,
/// data: 0.0,
/// };
///
/// game.spawn_particle(position, particle);
Expand Down
2 changes: 2 additions & 0 deletions quill/example-plugins/particle-example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down