use nightshade::ecs::cloth::commands::{
reset_cloth as engine_reset_cloth, spawn_cloth as engine_spawn_cloth,
};
use nightshade::ecs::cloth::components::{Cloth, ClothPinning};
use nightshade::prelude::*;
pub fn spawn_cloth(
world: &mut World,
position: Vec3,
width: f32,
height: f32,
columns: u32,
rows: u32,
) -> Entity {
let cloth = Cloth {
columns,
rows,
width,
height,
pinning: ClothPinning::TopRow,
..Default::default()
};
engine_spawn_cloth(world, cloth, position, "api::cloth".to_string())
}
pub fn reset_cloth(world: &mut World, entity: Entity) {
engine_reset_cloth(world, entity);
}
pub fn set_wind(world: &mut World, direction: Vec3, strength: f32) {
world.res_mut::<nightshade::render::wind::Wind>().direction = direction;
world.res_mut::<nightshade::render::wind::Wind>().strength = strength;
}