Skip to main content

SubProjectileSystem

Trait SubProjectileSystem 

Source
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§

Required Methods§

Source

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.

Source

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".

Implementors§