I fear I might be Begging The Question here, but I attempt to push a variable to a vector of the type &mut Boid in a query, but iterating through the query returns Mut<'_, Boid>. Do I have to cast it? Refactor? Or is there another way?
Here's the code:
// Somewhere exists: pub static mut BOIDS: Vec<&mut Boid> = Vec::new();
pub fn start(mut query: Query<&mut Boid>)
{
for mut boid in query.iter_mut()
{
unsafe
{
BOIDS.push(boid); // Of course this doesn't work, but how can I cast it?
}
}
}
Thanks!