pub trait SubProjectileSystem: ProjectileSystem {
type Parent: Projectile;
// Required methods
fn spawn_step_sub(&mut self, parent: &mut Self::Parent, dt: f32) -> usize;
fn build_sub_projectile(
parent: &Self::Parent,
seed: f32,
) -> Self::Projectile;
}Expand description
A ProjectileSystem that spawns projectiles from a parent
ProjectileSystem’s alive particles.
Required Associated Types§
type Parent: Projectile
Required Methods§
Sourcefn spawn_step_sub(&mut self, parent: &mut Self::Parent, dt: f32) -> usize
fn spawn_step_sub(&mut self, parent: &mut Self::Parent, dt: f32) -> usize
Determines how many particles to spawn in a frame per particle.
You might want to keep track of this on a field in the parent’s particle.
Sourcefn build_sub_projectile(parent: &Self::Parent, seed: f32) -> Self::Projectile
fn build_sub_projectile(parent: &Self::Parent, seed: f32) -> Self::Projectile
Convert a random seed into a particle with parent information.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".