-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic addition of particles #5
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
base: sample_color_model
Are you sure you want to change the base?
Conversation
create a bigger buffer than necessary + store a u32 to know the actual number of particles Not working yet.
1932085
to
0fbcbfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename with postfix 2
phase: None, | ||
color: None, | ||
}; | ||
particles.push(particle_proto); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: fix bug where we access particles[0]
particle.position += vector![1.0, 0.0] * (i as f32) * cell_width * 1.1; | ||
physics.push_particle(queue, &particle); | ||
} | ||
physics.reset_graphics = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: cleaner way to update graphics with same strategy.
mut materials: ResMut<Assets<BevyMaterial>>, | ||
to_clear: Query<Entity, With<InstanceMaterialData>>, | ||
) { | ||
if physics_context.reset_graphics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment warnign about performance if we merge as-is.
create a bigger buffer than necessary + store a u32 to know the actual number of particles
Current status
Working 🎉 ; some polishing to do: